Class: Vernier::Collector::CustomCollector
Instance Attribute Summary
#stack_table
Instance Method Summary
collapse
#add_marker, #current_time, new, #record_interval, #stop
Constructor Details
Returns a new instance of CustomCollector.
9
10
11
12
13
14
15
16
17
|
# File 'lib/vernier/collector.rb', line 9
def initialize(mode, options)
@stack_table = StackTable.new
@samples = []
@timestamps = []
@started_at = Process.clock_gettime(Process::CLOCK_MONOTONIC, :nanosecond)
super
end
|
Instance Method Details
#finish ⇒ Object
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/vernier/collector.rb', line 27
def finish
result = Result.new
result.instance_variable_set(:@threads, {
0 => {
tid: 0,
name: "custom",
started_at: @started_at,
samples: @samples,
weights: [1] * @samples.size,
timestamps: @timestamps,
sample_categories: [0] * @samples.size,
}
})
result.instance_variable_set(:@meta, {
started_at: @started_at
})
result
end
|
#sample ⇒ Object
19
20
21
22
|
# File 'lib/vernier/collector.rb', line 19
def sample
@samples << @stack_table.current_stack
@timestamps << Process.clock_gettime(Process::CLOCK_MONOTONIC, :nanosecond)
end
|
#start ⇒ Object
24
25
|
# File 'lib/vernier/collector.rb', line 24
def start
end
|