Module: Pyroscope

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

Defined Under Namespace

Classes: Config

Constant Summary collapse

VERSION =
'0.2.2'.freeze

Class Method Summary collapse

Class Method Details

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

Yields:

  • (@config)


33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/pyroscope_beta.rb', line 33

def configure
  @config = Config.new

  # Pass config to the block
  yield @config

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

  puts @config
end

.dropObject



60
61
62
# File 'lib/pyroscope_beta.rb', line 60

def drop
  Rust.drop_agent
end

.tag_wrapper(tags) ⇒ Object



51
52
53
54
55
56
57
58
# File 'lib/pyroscope_beta.rb', line 51

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