pyroscope 0.4.0 → 0.5.0

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: eba4490cd4dc65fb1219814e002baab05754afe2270e083e8bb697cfa5c452ea
4
- data.tar.gz: 69e27707297c593ca5aacd3978fe318dd92219e54caa66c2d2451d24a2a0d70b
3
+ metadata.gz: c54d01d273a289584bf1ecd0f69c7349e775f3e8a8b0a07a71a78095b4bbc78c
4
+ data.tar.gz: ef6dfa8b2da02bcfdd17d8a6d49cd86cfe7666615bcbb690bd04459c0300599d
5
5
  SHA512:
6
- metadata.gz: 6c9950536925d36afc03c2461d62793f33ebb514e81b3bc308708bdea33fa4dba560d19ef1b5ccd450e0c5b58604e36d1231caa218bb5d1861dd7e3149f932f0
7
- data.tar.gz: d08dcba721bf53f1ea3ce929c3bbbe2dd8b6866da347151d442f0d9281fbc779ccc08c16ef37dd7ec1c1b38846b64d2c8e6357d5906e3b81c15908cd3106f546
6
+ metadata.gz: c45a42bff9b659125547281a11a9623ef12469a91b61444a178d7895482a3889a6ed687f650cde9bb7bdfdaee163f5c1fa8a905e254116ad50ec6ece06f983d8
7
+ data.tar.gz: '0108e948e4d9bf98a729b5628fe6d243d849e7d7721463b8f5623629330d8ebbbaa1cc95dbddd5966ab0849409ca9858240414169d69182a7dbc92e583ebb6dd'
data/ext/rbspy/src/lib.rs CHANGED
@@ -10,6 +10,7 @@ use pyroscope_rbspy::{rbspy_backend, RbspyConfig};
10
10
 
11
11
  use pyroscope::{pyroscope::Compression, PyroscopeAgent};
12
12
  use pyroscope::backend::{Report, StackFrame, Tag};
13
+ use pyroscope::pyroscope::ReportEncoding;
13
14
 
14
15
  pub fn transform_report(report: Report) -> Report {
15
16
  let cwd = env::current_dir().unwrap();
@@ -107,7 +108,8 @@ pub extern "C" fn initialize_logging(logging_level: u32) -> bool {
107
108
  pub extern "C" fn initialize_agent(
108
109
  application_name: *const c_char, server_address: *const c_char, auth_token: *const c_char,
109
110
  sample_rate: u32, detect_subprocesses: bool, oncpu: bool, report_pid: bool,
110
- report_thread_id: bool, tags: *const c_char, compression: *const c_char
111
+ report_thread_id: bool, tags: *const c_char, compression: *const c_char,
112
+ report_encoding: *const c_char
111
113
  ) -> bool {
112
114
  // Initialize FFIKit
113
115
  let recv = ffikit::initialize_ffi().unwrap();
@@ -137,7 +139,14 @@ pub extern "C" fn initialize_agent(
137
139
  .unwrap()
138
140
  .to_string();
139
141
 
142
+ let report_encoding = unsafe { CStr::from_ptr(report_encoding) }
143
+ .to_str()
144
+ .unwrap()
145
+ .to_string();
146
+
140
147
  let compression = Compression::from_str(&compression_string);
148
+ let report_encoding = ReportEncoding::from_str(&report_encoding)
149
+ .unwrap_or(ReportEncoding::FOLDED);
141
150
 
142
151
  let pid = std::process::id();
143
152
 
@@ -156,7 +165,8 @@ pub extern "C" fn initialize_agent(
156
165
  let mut agent_builder = PyroscopeAgent::builder(server_address, application_name)
157
166
  .backend(rbspy)
158
167
  .func(transform_report)
159
- .tags(tags);
168
+ .tags(tags)
169
+ .report_encoding(report_encoding);
160
170
 
161
171
  if auth_token != "" {
162
172
  agent_builder = agent_builder.auth_token(auth_token);
@@ -1,3 +1,3 @@
1
1
  module Pyroscope
2
- VERSION = '0.4.0'.freeze
2
+ VERSION = '0.5.0'.freeze
3
3
  end
data/lib/pyroscope.rb CHANGED
@@ -8,7 +8,7 @@ module Pyroscope
8
8
  extend FFI::Library
9
9
  ffi_lib File.expand_path(File.dirname(__FILE__)) + "/rbspy/rbspy.#{RbConfig::CONFIG["DLEXT"]}"
10
10
  attach_function :initialize_logging, [:int], :bool
11
- attach_function :initialize_agent, [:string, :string, :string, :int, :bool, :bool, :bool, :bool, :string, :string], :bool
11
+ attach_function :initialize_agent, [:string, :string, :string, :int, :bool, :bool, :bool, :bool, :string, :string, :string], :bool
12
12
  attach_function :add_thread_tag, [:uint64, :string, :string], :bool
13
13
  attach_function :remove_thread_tag, [:uint64, :string, :string], :bool
14
14
  attach_function :add_global_tag, [:string, :string], :bool
@@ -22,7 +22,7 @@ module Pyroscope
22
22
  attach_function :thread_id, [], :uint64
23
23
  end
24
24
 
25
- Config = Struct.new(:application_name, :app_name, :server_address, :auth_token, :log_level, :sample_rate, :detect_subprocesses, :oncpu, :report_pid, :report_thread_id, :tags, :compression) do
25
+ Config = Struct.new(:application_name, :app_name, :server_address, :auth_token, :log_level, :sample_rate, :detect_subprocesses, :oncpu, :report_pid, :report_thread_id, :tags, :compression, :report_encoding) do
26
26
  def initialize(*)
27
27
  super
28
28
  # defaults:
@@ -37,6 +37,7 @@ module Pyroscope
37
37
  self.log_level = 'error'
38
38
  self.tags = {}
39
39
  self.compression = 'gzip'
40
+ self.report_encoding = 'pprof'
40
41
  end
41
42
  end
42
43
 
@@ -79,7 +80,8 @@ module Pyroscope
79
80
  @config.report_pid || false,
80
81
  @config.report_thread_id || false,
81
82
  tags_to_string(@config.tags || {}),
82
- @config.compression || ""
83
+ @config.compression || "",
84
+ @config.report_encoding || "pprof"
83
85
  )
84
86
  end
85
87
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pyroscope
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pyroscope Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-06 00:00:00.000000000 Z
11
+ date: 2022-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi