Class: APMInsight::API::CustomAPIHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/agent/handler/custom_api_handler.rb

Class Method Summary collapse

Class Method Details

.exitTracker(tracker) ⇒ Object



24
25
26
27
28
29
# File 'lib/agent/handler/custom_api_handler.rb', line 24

def self.exitTracker tracker
  if tracker != nil
    tracker.finish
    ManageEngine::Agent::TrackerHandler.exitTracker(tracker)
  end
end

.invokeTracker(name) ⇒ Object

Create tracker for custom instrumented methods and send them to tracker handler



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/agent/handler/custom_api_handler.rb', line 8

def self.invokeTracker name
  begin
#          @obj = ManageEngine::APMObjectHolder.instance
            
    if Thread.current[:apminsight] != nil
      tracker = ManageEngine::Tracker::DefaultTracker.new(name)
      tracker = ManageEngine::Agent::TrackerHandler.invokeTracker(tracker)
      return tracker
    end
    
    return nil
  rescue Exception=>e
    return nil
  end
end

.track_exception(exception) ⇒ Object



31
32
33
34
35
36
# File 'lib/agent/handler/custom_api_handler.rb', line 31

def self.track_exception exception
  seqBook = Thread.current[:apminsight]
  if seqBook != nil
    seqBook.addExceptionInfo exception
  end
end