Method: Datadog::Profiling::Exporter#initialize

Defined in:
lib/datadog/profiling/exporter.rb

#initialize(pprof_recorder:, worker:, info_collector:, code_provenance_collector:, internal_metadata:, minimum_duration_seconds: PROFILE_DURATION_THRESHOLD_SECONDS, time_provider: Time) ⇒ Exporter

Returns a new instance of Exporter.



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/datadog/profiling/exporter.rb', line 33

def initialize(
  pprof_recorder:,
  worker:,
  info_collector:,
  code_provenance_collector:,
  internal_metadata:,
  minimum_duration_seconds: PROFILE_DURATION_THRESHOLD_SECONDS,
  time_provider: Time
)
  @pprof_recorder = pprof_recorder
  @worker = worker
  @code_provenance_collector = code_provenance_collector
  @minimum_duration_seconds = minimum_duration_seconds
  @time_provider = time_provider
  @last_flush_finish_at = nil
  @created_at = time_provider.now.utc
  @internal_metadata = 
  # NOTE: At the time of this comment collected info does not change over time so we'll hardcode
  #       it on startup to prevent serializing the same info on every flush.
  @info_json = JSON.fast_generate(info_collector.info).freeze
end