Module: Bulldogger::Probe::Writer
- Defined in:
- lib/bulldogger/probe/writer.rb
Overview
Writes one probe session's aggregated MethodStats as
tmp/bulldogger/run-.../probe-NNN-
Filenames use their own "probe-NNN-" sequence, not Run#next_path
(which produces plain "NNN-
Class Attribute Summary collapse
-
.mutex ⇒ Object
readonly
Returns the value of attribute mutex.
-
.sequence ⇒ Object
Returns the value of attribute sequence.
Class Method Summary collapse
Class Attribute Details
.mutex ⇒ Object (readonly)
Returns the value of attribute mutex.
28 29 30 |
# File 'lib/bulldogger/probe/writer.rb', line 28 def mutex @mutex end |
.sequence ⇒ Object
Returns the value of attribute sequence.
27 28 29 |
# File 'lib/bulldogger/probe/writer.rb', line 27 def sequence @sequence end |
Class Method Details
.write(run:, config:, targets:, stats:, started_at:) ⇒ Object
31 32 33 34 35 36 37 38 39 |
# File 'lib/bulldogger/probe/writer.rb', line 31 def self.write(run:, config:, targets:, stats:, started_at:) dir = run.dir return nil unless dir path = File.join(dir, format("probe-%03d-%s.json", next_sequence, slug_for(targets))) File.write(path, "#{JSON.pretty_generate(payload_for(config: config, targets: targets, stats: stats, started_at: started_at))}\n") path end |