Sha256: 492553f63279e3302d33f6e8de68c15ad1094e42b9445afda35fee58e385ee8f

Contents?: true

Size: 1.77 KB

Versions: 4

Compression:

Stored size: 1.77 KB

Contents

require 'agent/trackers/default_tracker'

module ManageEngine
  module Tracker
    class RootTracker < DefaultTracker
      
      attr_accessor :status, :url, :txnType
      
      def url=(url = "unknown")
        @url = ManageEngine::APMObjectHolder.instance.txn_util.normalizeName(url)
      end
      
      def getTxnName
        ManageEngine::APMObjectHolder.instance.constants.mf_transaction + getTxnType() + ManageEngine::APMObjectHolder.instance.constants.mf_separator + @url
      end
      
      def setTxnType(type)
        @txnType=type
      end
      
      def getTxnType
        if (@txnType == nil)
          @txnType = ManageEngine::APMObjectHolder.instance.constants.mf_http
        end
        @txnType
      end
      
      def http_method(method)
        @http_method = method
      end
      
      def http_params(params)
        @http_params = params
      end
      
      def queryString(querystring)
        @queryString = querystring
      end
      
      def setStatus(httpcode)
        @status = httpcode
      end
      
      def addCustomParam key, value
        if (@params == nil)
          @params = Hash.new
        end
        @params[key] = value
      end
      
      def addAdditionalInfo param
        @params = param
      end
      
      def getAdditionalInfo
        info = super
        if (@http_method != nil && @queryString != nil && @status != nil)
          if (info == nil)
            info = Hash.new
          end
          info["http_method_name"] = @http_method
          info["http_query_str"] = @queryString
          info["httpcode"] = @status
        end
        if (@params != nil)
          if (info == nil)
            info = Hash.new
          end
          info["custom_params"] = @params
        end
        info
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
site24x7_apminsight-1.9.2 lib/agent/trackers/root_tracker.rb
site24x7_apminsight-1.9.1 lib/agent/trackers/root_tracker.rb
apminsight-1.9.0 lib/agent/trackers/root_tracker.rb
site24x7_apminsight-1.9.0 lib/agent/trackers/root_tracker.rb