Sha256: 8de53c0524ebb6ee49eab87b7bc622cdb704821f4a6711ae0d85cba328f029d5

Contents?: true

Size: 1.24 KB

Versions: 9

Compression:

Stored size: 1.24 KB

Contents

module ManageEngine
  module Tracker
    
    class DefaultTracker
      
    attr_accessor :name, :error, :endtime, :starttime, :child, :sibling
      
      def initialize(name = "unknonwn", time = ManageEngine::APMObjectHolder.instance.util.currenttimemillis)
        @starttime = time.to_i
        @name = name
        @logger = ManageEngine::APMObjectHolder.instance.log
      end
      
      def finish(time = ManageEngine::APMObjectHolder.instance.util.currenttimemillis)
        @endtime = time.to_i
      end
      
      def error?
        @error != nil
      end
      
      def setError(exception)
        @error = exception
      end
      
      def setName(context)
        @name = context
      end
      
      def duration
        (@endtime - @starttime).to_i
      end
      
      def ==(obj)
        return obj != nil && @name == obj.name
      end
      
      def hash
        return @name.hash
      end
      
      def to_s
        @name
      end
      
      def getAdditionalInfo
        if error?
          {ManageEngine::APMObjectHolder.instance.constants.mf_exception_st => ManageEngine::APMObjectHolder.instance.util.formatStacktrace(@error.backtrace)}
        else
          nil
        end
      end
      
    end
    
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
apminsight-1.8.2 lib/agent/trackers/default_tracker.rb
site24x7_apminsight-1.8.2 lib/agent/trackers/default_tracker.rb
site24x7_apminsight-1.8.1 lib/agent/trackers/default_tracker.rb
site24x7_apminsight-1.8.0 lib/agent/trackers/default_tracker.rb
site24x7_apminsight-1.7.3.0 lib/agent/trackers/default_tracker.rb
site24x7_apminsight-1.7.2 lib/agent/trackers/default_tracker.rb
site24x7_apminsight-1.7.0 lib/agent/trackers/default_tracker.rb
site24x7_apminsight-1.6.1 lib/agent/trackers/default_tracker.rb
site24x7_apminsight-1.6.0 lib/agent/trackers/default_tracker.rb