pyroscope 0.3.1-x86_64-darwin → 0.3.2-x86_64-darwin
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 +71 -1
- data/lib/pyroscope/version.rb +1 -1
- data/lib/rbspy/rbspy.bundle +0 -0
- data/lib/thread_id/thread_id.bundle +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: 04463bc7a3a932eef056c8d20e677b042fc921b5df2df4296279fd34c7dc9bfd
|
4
|
+
data.tar.gz: 4fa8c6865eea79b89781600691c06c63a1160a66b7d4815881fc4ae4be37c622
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b23669db4195412878522947572126877e33fa0596f24086efdd80b2ad6f46874520ea3201687a78d1f1da8093ad77493eb0b0390ad5a4aeab7cdd280866c5c
|
7
|
+
data.tar.gz: 4bdbccad469ba8adf06b181b60544faa04b634d9bfeedce3c048ca54fd6aa645a460cf2b79abd4f307353fa79f02ffcdc9ed69cce545c1bfa91813fc13b3b191
|
data/ext/rbspy/src/lib.rs
CHANGED
@@ -1,11 +1,80 @@
|
|
1
1
|
use ffikit::Signal;
|
2
|
-
use pyroscope::backend::Tag;
|
2
|
+
use pyroscope::backend::{Report, StackFrame, Tag};
|
3
3
|
use pyroscope::PyroscopeAgent;
|
4
4
|
use pyroscope_rbspy::{rbspy_backend, RbspyConfig};
|
5
5
|
use std::collections::hash_map::DefaultHasher;
|
6
6
|
use std::ffi::CStr;
|
7
7
|
use std::hash::Hasher;
|
8
8
|
use std::os::raw::c_char;
|
9
|
+
use std::env;
|
10
|
+
|
11
|
+
pub fn transform_report(report: Report) -> Report {
|
12
|
+
let cwd = env::current_dir().unwrap();
|
13
|
+
let cwd = cwd.to_str().unwrap_or("");
|
14
|
+
|
15
|
+
let data = report
|
16
|
+
.data
|
17
|
+
.iter()
|
18
|
+
.map(|(stacktrace, count)| {
|
19
|
+
let new_frames = stacktrace
|
20
|
+
.frames
|
21
|
+
.iter()
|
22
|
+
.map(|frame| {
|
23
|
+
let frame = frame.to_owned();
|
24
|
+
let mut s = frame.filename.unwrap();
|
25
|
+
match s.find(cwd) {
|
26
|
+
Some(i) => {
|
27
|
+
s = s[(i+cwd.len()+1)..].to_string();
|
28
|
+
}
|
29
|
+
None => {
|
30
|
+
match s.find("/gems/") {
|
31
|
+
Some(i) => {
|
32
|
+
s = s[(i+1)..].to_string();
|
33
|
+
}
|
34
|
+
None => {
|
35
|
+
match s.find("/ruby/") {
|
36
|
+
Some(i) => {
|
37
|
+
s = s[(i+6)..].to_string();
|
38
|
+
match s.find("/") {
|
39
|
+
Some(i) => {
|
40
|
+
s = s[(i+1)..].to_string();
|
41
|
+
}
|
42
|
+
None => {
|
43
|
+
}
|
44
|
+
}
|
45
|
+
}
|
46
|
+
None => {
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
// something
|
55
|
+
StackFrame::new(
|
56
|
+
frame.module,
|
57
|
+
frame.name,
|
58
|
+
Some(s.to_string()),
|
59
|
+
frame.relative_path,
|
60
|
+
frame.absolute_path,
|
61
|
+
frame.line,
|
62
|
+
)
|
63
|
+
})
|
64
|
+
.collect();
|
65
|
+
|
66
|
+
let mut mystack = stacktrace.to_owned();
|
67
|
+
|
68
|
+
mystack.frames = new_frames;
|
69
|
+
|
70
|
+
(mystack, count.to_owned())
|
71
|
+
})
|
72
|
+
.collect();
|
73
|
+
|
74
|
+
let new_report = Report::new(data).metadata(report.metadata.clone());
|
75
|
+
|
76
|
+
new_report
|
77
|
+
}
|
9
78
|
|
10
79
|
#[no_mangle]
|
11
80
|
pub extern "C" fn initialize_agent(
|
@@ -52,6 +121,7 @@ pub extern "C" fn initialize_agent(
|
|
52
121
|
|
53
122
|
let mut agent_builder = PyroscopeAgent::builder(server_address, application_name)
|
54
123
|
.backend(rbspy)
|
124
|
+
.func(transform_report)
|
55
125
|
.tags(tags);
|
56
126
|
|
57
127
|
if auth_token != "" {
|
data/lib/pyroscope/version.rb
CHANGED
data/lib/rbspy/rbspy.bundle
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.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: x86_64-darwin
|
6
6
|
authors:
|
7
7
|
- Pyroscope Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|