Module: Pyroscope

Defined in:
lib/pyroscope_beta.rb,
lib/pyroscope/version.rb

Defined Under Namespace

Classes: Config

Constant Summary collapse

VERSION =
'0.1.2'.freeze

Class Method Summary collapse

Class Method Details

.configure {|@config| ... } ⇒ Object

Yields:

  • (@config)


30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/pyroscope_beta.rb', line 30

def configure
  @config = Config.new

  # Pass config to the block
  yield @config

  Rust.initialize_agent(
    @config.application_name,
    @config.server_address,
    @config.sample_rate,
    @config.detect_subprocesses,
    tags_to_string(@config.tags)
  )

  puts @config
end

.dropObject



56
57
58
# File 'lib/pyroscope_beta.rb', line 56

def drop
  Rust.drop_agent
end

.tag_wrapper(tags) ⇒ Object



47
48
49
50
51
52
53
54
# File 'lib/pyroscope_beta.rb', line 47

def tag_wrapper(tags)
  add_tags(tags)
  begin
    yield
  ensure
    remove_tags(tags)
  end
end