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 +4 -4
- data/ext/rbspy/src/lib.rs +12 -2
- data/lib/pyroscope/version.rb +1 -1
- data/lib/pyroscope.rb +5 -3
- data/lib/rbspy/rbspy.so +0 -0
- data/lib/thread_id/thread_id.so +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b692aa36e6a159bec5b036ac9b55ec84270191f5bfaf187aa47a1d1f3a0de653
|
4
|
+
data.tar.gz: c7a365213abab197873d98a74bdf076cb93c5ef3c8471dc39e176c173f43082c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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);
|
data/lib/pyroscope/version.rb
CHANGED
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
|
data/lib/thread_id/thread_id.so
CHANGED
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
|
+
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-
|
11
|
+
date: 2022-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|