pyroscope 0.4.0-x86_64-linux → 0.5.0-x86_64-linux

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e7e0a308394bd54ce968d7649712148526d1696b363c3d6e37f8b62bf8d83ceb
4
- data.tar.gz: 7527ddda6ca70869a9115e8264510fc09ea4880aaa3e3da749efa07bd83334da
3
+ metadata.gz: b692aa36e6a159bec5b036ac9b55ec84270191f5bfaf187aa47a1d1f3a0de653
4
+ data.tar.gz: c7a365213abab197873d98a74bdf076cb93c5ef3c8471dc39e176c173f43082c
5
5
  SHA512:
6
- metadata.gz: ef8491839fcb25cb469c8d44ab1a57ccfc8100fb6d08b8ba12192063dc89289e741cde042e1b66f73fc4345ec2c7418535968d8399d5f41a54b3918b26046693
7
- data.tar.gz: 48d7c8c58f94ba89ad36728a998fc04ed49e38a4bb4809eb0d602c1a1a3f7b7168cdeb4f498cc3b84d28b4eeb9a0dd72634c3653b7417f7c0ac5281041e07db7
6
+ metadata.gz: 8b078b81690d727f8f3f602324e1020ea673b0979f56bf60e62e54d4dd718beea20b08074016f8dfdd7968dfdef168d6f2a5a3b8c18d21664d80ab1c09414b36
7
+ data.tar.gz: 4a94af4c840e8aed35d97caab5d3eecc1e2a596f5f787fb84373965f7c88ca5cd57c3be93bd6c0fd77473005b24e1626dd50bfdf9ceb3b42ebfcebece8aeba46
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
 
data/lib/rbspy/rbspy.so CHANGED
Binary file
Binary file
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: x86_64-linux
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