pyroscope 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15d405da85cfd950ffe3b25c9ea6a3b5df68c57cfb52cd0b53f91cf26f22a955
4
- data.tar.gz: 76422633bd992c1a1b148f66a9be25c6974bb47fba0d70e38e09c749fa389109
3
+ metadata.gz: 743ff4c97e82300fb18a63cb6ebe626f241ce77a1bf0fd034198db698b5c5aca
4
+ data.tar.gz: 76d3705d25132cb5779b9e430eb2972894597d4bd4732a30c28a8995ec18fcaa
5
5
  SHA512:
6
- metadata.gz: 67550275be573ffe4dac71dc62386dc917bed9cb0be052b155cd33d11d18107100e1323c0454d3dd55eaaa269c2c3a58b039fa48a54ba07170d755ac2f4d768c
7
- data.tar.gz: a4d1a8a11ffc44762a7dcb30ea7d946960696e35e77936e56c67f520d94744161cde0255cdf6457482b6c419522341ba46051b569c36c9580f1dee0f89a48c58
6
+ metadata.gz: 4bc08bbdc5fa0081806d4e2030eef6a6032c1e5fb68d53784fc5e0565f7ed4d57a85171d87ff91213d3fc0209967d47279593ac2025739a611588771d36e8c0d
7
+ data.tar.gz: 5d27f0e63129001f60bb11fab6f19e837b82a350bc746b6ac7a1bd0e072c1ea7546b3d0b9ea32ff4d864c8feb1b71c718f2a67e9d606d98b2b518c689b9e49fc
data/README.md CHANGED
@@ -1,3 +1,3 @@
1
1
  # pyroscope-ruby
2
2
 
3
- This is a repo for pyroscope ruby integration. It is currently under development and is not yet released.
3
+ This is a repo for pyroscope ruby integration. See [examples/ruby](https://github.com/pyroscope-io/pyroscope/tree/main/examples/ruby) in the main repo for examples.
@@ -1,3 +1,3 @@
1
1
  module Pyroscope
2
- VERSION = "0.1.0".freeze
2
+ VERSION = "0.1.1".freeze
3
3
  end
data/lib/pyroscope.rb CHANGED
@@ -2,7 +2,7 @@ require "pyroscope/version"
2
2
  require "pyroscope_c"
3
3
 
4
4
  module Pyroscope
5
- Config = Struct.new(:app_name, :server_address, :auth_token, :sample_rate, :with_subprocesses, :log_level)
5
+ Config = Struct.new(:app_name, :server_address, :auth_token, :sample_rate, :with_subprocesses, :log_level, :tags)
6
6
 
7
7
  class << self
8
8
  def configure
@@ -16,6 +16,7 @@ module Pyroscope
16
16
  @configuration.with_subprocesses || 0,
17
17
  @configuration.log_level || "error",
18
18
  )
19
+ tag(@configuration.tags) if @configuration.tags
19
20
  end
20
21
 
21
22
  def stop
@@ -38,13 +39,13 @@ module Pyroscope
38
39
 
39
40
  def tag(tags)
40
41
  tags.each_pair do |key, val|
41
- _set_tag(key, val)
42
+ _set_tag(key.to_s, val.to_s)
42
43
  end
43
44
  end
44
45
 
45
46
  def remove_tags(*keys)
46
47
  keys.each do |key|
47
- _set_tag(key, "")
48
+ _set_tag(key.to_s, "")
48
49
  end
49
50
  end
50
51
 
data/test.rb CHANGED
@@ -1,10 +1,12 @@
1
- require 'pyroscope'
2
-
3
- puts "prestart #{Process.pid}"
1
+ require "pyroscope"
4
2
 
5
3
  Pyroscope.configure do |config|
6
- config.app_name = "test.ruby.app{}"
7
- config.server_address = "http://localhost:4040/"
4
+ config.app_name = "test.ruby.app"
5
+ config.server_address = "http://pyroscope:4040/"
6
+ config.tags = {
7
+ :region => "us-east-1",
8
+ :hostname => ENV["hostname"]
9
+ }
8
10
  end
9
11
 
10
12
  def work(n)
@@ -15,17 +17,15 @@ def work(n)
15
17
  end
16
18
 
17
19
  def fast_function
18
- Pyroscope.tag_wrapper({ "function" => "fast"}) do
19
- work(20_000)
20
- end
20
+ work(20000)
21
21
  end
22
22
 
23
23
  def slow_function
24
- Pyroscope.tag({ "function" => "slow"})
25
- work(80_000)
26
- Pyroscope.remove_tags("function")
24
+ work(80000)
27
25
  end
28
26
 
27
+ Pyroscope.tag({ "region" => "us-east-1" })
28
+
29
29
  while true
30
30
  fast_function
31
31
  slow_function
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pyroscope
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pyroscope Team