Class: ManageEngine::Tracker::DefaultTracker
- Inherits:
-
Object
- Object
- ManageEngine::Tracker::DefaultTracker
show all
- Defined in:
- lib/agent/trackers/default_tracker.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(name = "unknown", time = ManageEngine::APMObjectHolder.instance.util.currenttimemillis) ⇒ DefaultTracker
Returns a new instance of DefaultTracker.
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
6
7
8
|
# File 'lib/agent/trackers/default_tracker.rb', line 6
def children
@children
end
|
#component ⇒ Object
Returns the value of attribute component.
6
7
8
|
# File 'lib/agent/trackers/default_tracker.rb', line 6
def component
@component
end
|
#endtime ⇒ Object
Returns the value of attribute endtime.
6
7
8
|
# File 'lib/agent/trackers/default_tracker.rb', line 6
def endtime
@endtime
end
|
#error ⇒ Object
Returns the value of attribute error.
6
7
8
|
# File 'lib/agent/trackers/default_tracker.rb', line 6
def error
@error
end
|
#name ⇒ Object
Returns the value of attribute name.
6
7
8
|
# File 'lib/agent/trackers/default_tracker.rb', line 6
def name
@name
end
|
#parent ⇒ Object
Returns the value of attribute parent.
6
7
8
|
# File 'lib/agent/trackers/default_tracker.rb', line 6
def parent
@parent
end
|
#starttime ⇒ Object
Returns the value of attribute starttime.
6
7
8
|
# File 'lib/agent/trackers/default_tracker.rb', line 6
def starttime
@starttime
end
|
Instance Method Details
#==(obj) ⇒ Object
52
53
54
|
# File 'lib/agent/trackers/default_tracker.rb', line 52
def ==(obj)
return obj != nil && @name == obj.name
end
|
#duration ⇒ Object
43
44
45
46
47
48
49
50
|
# File 'lib/agent/trackers/default_tracker.rb', line 43
def duration
begin
(@endtime - @starttime).to_i
rescue Exception=>e
@logger.warn "Name: #{name} Starttime: #{starttime} Endtime: #{endtime}"
raise e
end
end
|
#error? ⇒ Boolean
31
32
33
|
# File 'lib/agent/trackers/default_tracker.rb', line 31
def error?
@error != nil
end
|
#finish(time = ManageEngine::APMObjectHolder.instance.util.currenttimemillis) ⇒ Object
#getAdditionalInfo ⇒ Object
#getTrace ⇒ Object
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
# File 'lib/agent/trackers/default_tracker.rb', line 72
def getTrace
trace = Array.new(7)
trace[0] = @starttime
trace[1] = @name
trace[2] = @component
trace[3] = duration()
trace[4] = trace[3] trace[5] = getAdditionalInfo()
if (children.length > 0)
trace[6] = Array.new
children.each do |child|
trace[4] -= child.duration() trace[6].push(child.getTrace())
end
end trace
end
|
#hash ⇒ Object
56
57
58
|
# File 'lib/agent/trackers/default_tracker.rb', line 56
def hash
return @name.hash
end
|
#setError(exception) ⇒ Object
35
36
37
|
# File 'lib/agent/trackers/default_tracker.rb', line 35
def setError(exception)
@error = exception
end
|
#setName(context) ⇒ Object
39
40
41
|
# File 'lib/agent/trackers/default_tracker.rb', line 39
def setName(context)
@name = context
end
|
#setParent(parentTracker) ⇒ Object
20
21
22
23
24
25
|
# File 'lib/agent/trackers/default_tracker.rb', line 20
def setParent(parentTracker)
@parent = parentTracker
if parentTracker != nil
parentTracker.children[parentTracker.children.length]=self
end
end
|
#to_s ⇒ Object
60
61
62
|
# File 'lib/agent/trackers/default_tracker.rb', line 60
def to_s
@name
end
|