pyroscope_beta 0.1.9-x86_64-linux → 0.2.2-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: f5797523af0c37d359fcef35a8f5b7bfcbd8c8b78c01a4fe893e6bce1f5c18e3
4
- data.tar.gz: 8651c68e3282c079b6b79717852760fd919b01cf9913901911378afe93b91237
3
+ metadata.gz: 702b2dab6aad1a14a9c9e5ac62869a351a216bf9152b9cfe1e5b13503572a24b
4
+ data.tar.gz: d5e24f18ef95403ef1a88614a7420f4c81c8ae3c1e1e635658c9662c3b28282f
5
5
  SHA512:
6
- metadata.gz: 2dd159aa5f65b561bc970c8c5a5a7907ba3becea6d64709dc9be7f6203d4201bf58fa475bca9d3f0a81bbaf6a4e98df4deecdf4c63747da5125f8fdb32ec3a35
7
- data.tar.gz: 190e673603a7b60bf8ae07bf4535d0cdd2c451331f64597dac45e132900bc0df960768633dc7ed54808ae76e576156665f964eb708a0f794e8d6eef57856e888
6
+ metadata.gz: 6fa5635126297466e3b8dc55f9f563a6eba480c06edc2d10ab5762125c7469f5eb688d1d5d734eca237f42c881692cd20ec0c4da5e32f8657093722d351add86
7
+ data.tar.gz: b936e9ff462fd1caebe926a78c89d6ee5a9ced584cfc4a0dcf0d877ac668a94234faf49e94374f0968cdb8ce8a5c66dffcc84d202183e7868c8e5a45f00767cf
data/ext/rbspy/Cargo.lock CHANGED
@@ -204,9 +204,9 @@ dependencies = [
204
204
 
205
205
  [[package]]
206
206
  name = "clap"
207
- version = "3.1.18"
207
+ version = "3.2.1"
208
208
  source = "registry+https://github.com/rust-lang/crates.io-index"
209
- checksum = "d2dbdf4bdacb33466e854ce889eee8dfd5729abf7ccd7664d0a2d60cd384440b"
209
+ checksum = "a836566fa5f52f7ddf909a8a2f9029b9f78ca584cd95cf7e87f8073110f4c5c9"
210
210
  dependencies = [
211
211
  "atty",
212
212
  "bitflags",
@@ -221,9 +221,9 @@ dependencies = [
221
221
 
222
222
  [[package]]
223
223
  name = "clap_derive"
224
- version = "3.1.18"
224
+ version = "3.2.1"
225
225
  source = "registry+https://github.com/rust-lang/crates.io-index"
226
- checksum = "25320346e922cffe59c0bbc5410c8d8784509efb321488971081313cb1e1a33c"
226
+ checksum = "986fd75d1dfd2c34eb8c9275ae38ad87ea9478c9b79e87f1801f7d866dfb1e37"
227
227
  dependencies = [
228
228
  "heck",
229
229
  "proc-macro-error",
@@ -234,9 +234,9 @@ dependencies = [
234
234
 
235
235
  [[package]]
236
236
  name = "clap_lex"
237
- version = "0.2.0"
237
+ version = "0.2.2"
238
238
  source = "registry+https://github.com/rust-lang/crates.io-index"
239
- checksum = "a37c35f1112dad5e6e0b1adaff798507497a18fceeb30cceb3bae7d1427b9213"
239
+ checksum = "5538cd660450ebeb4234cfecf8f2284b844ffc4c50531e66d584ad5b91293613"
240
240
  dependencies = [
241
241
  "os_str_bytes",
242
242
  ]
@@ -708,7 +708,7 @@ checksum = "1a3cb215599901c8f491666421d44ffaed08d6872b4c7ced6f425683b951271e"
708
708
  dependencies = [
709
709
  "ahash",
710
710
  "atty",
711
- "clap 3.1.18",
711
+ "clap 3.2.1",
712
712
  "crossbeam-channel",
713
713
  "crossbeam-utils",
714
714
  "dashmap",
@@ -931,7 +931,7 @@ version = "0.13.0"
931
931
  source = "registry+https://github.com/rust-lang/crates.io-index"
932
932
  checksum = "e7d66043b25d4a6cccb23619d10c19c25304b355a7dccd4a8e11423dd2382146"
933
933
  dependencies = [
934
- "clap 3.1.18",
934
+ "clap 3.2.1",
935
935
  "rand 0.8.5",
936
936
  ]
937
937
 
@@ -1343,7 +1343,7 @@ checksum = "bcbebdf0037de5a92722b0bca2965ce0a76cd5c962225cf355e31ac668ea653f"
1343
1343
  dependencies = [
1344
1344
  "anyhow",
1345
1345
  "chrono",
1346
- "clap 3.1.18",
1346
+ "clap 3.2.1",
1347
1347
  "ctrlc",
1348
1348
  "directories",
1349
1349
  "elf",
data/ext/rbspy/Rakefile CHANGED
@@ -44,6 +44,7 @@ class RbspyRakeCargoHelper
44
44
 
45
45
  def self.flags
46
46
  cc_flags = Shellwords.split(RbConfig.expand(RbConfig::MAKEFILE_CONFIG["CC"].dup))
47
+ puts RbConfig::MAKEFILE_CONFIG.inspect
47
48
 
48
49
  ["-C", "linker=#{cc_flags.shift}",
49
50
  *cc_flags.flat_map {|a| ["-C", "link-arg=#{a}"] },
data/ext/rbspy/src/lib.rs CHANGED
@@ -36,17 +36,24 @@ fn signalpass() -> &'static SignalPass {
36
36
 
37
37
  #[no_mangle]
38
38
  pub extern "C" fn initialize_agent(
39
- application_name: *const c_char, server_address: *const c_char, sample_rate: u32,
40
- detect_subprocesses: bool, tags: *const c_char,
39
+ application_name: *const c_char, server_address: *const c_char, auth_token: *const c_char,
40
+ sample_rate: u32, detect_subprocesses: bool, tags: *const c_char,
41
41
  ) -> bool {
42
42
  let application_name = unsafe { CStr::from_ptr(application_name) }
43
43
  .to_str()
44
44
  .unwrap()
45
45
  .to_string();
46
+
46
47
  let server_address = unsafe { CStr::from_ptr(server_address) }
47
48
  .to_str()
48
49
  .unwrap()
49
50
  .to_string();
51
+
52
+ let auth_token = unsafe { CStr::from_ptr(auth_token) }
53
+ .to_str()
54
+ .unwrap()
55
+ .to_string();
56
+
50
57
  let tags_string = unsafe { CStr::from_ptr(tags) }
51
58
  .to_str()
52
59
  .unwrap()
@@ -65,11 +72,16 @@ pub extern "C" fn initialize_agent(
65
72
  let tags_ref = tags_string.as_str();
66
73
  let tags = string_to_tags(tags_ref);
67
74
  let rbspy = rbspy_backend(rbspy_config);
68
- let agent = PyroscopeAgent::builder(server_address, application_name)
75
+
76
+ let mut agent_builder = PyroscopeAgent::builder(server_address, application_name)
69
77
  .backend(rbspy)
70
- .tags(tags)
71
- .build()
72
- .unwrap();
78
+ .tags(tags);
79
+
80
+ if auth_token != "" {
81
+ agent_builder = agent_builder.auth_token(auth_token);
82
+ }
83
+
84
+ let agent = agent_builder.build().unwrap();
73
85
 
74
86
  let agent_running = agent.start().unwrap();
75
87
 
@@ -1,3 +1,3 @@
1
1
  module Pyroscope
2
- VERSION = '0.1.9'.freeze
2
+ VERSION = '0.2.2'.freeze
3
3
  end
@@ -1,24 +1,27 @@
1
1
  require 'ffi'
2
- require 'fiddle'
3
-
4
- $libm = Fiddle.dlopen(File.expand_path(File.dirname(__FILE__)) + "/thread_id/thread_id.#{RbConfig::CONFIG["DLEXT"]}")
5
-
6
2
 
7
3
  module Rust
8
4
  extend FFI::Library
9
5
  ffi_lib File.expand_path(File.dirname(__FILE__)) + "/rbspy/rbspy.#{RbConfig::CONFIG["DLEXT"]}"
10
- attach_function :initialize_agent, [:string, :string, :int, :bool, :string], :bool
6
+ attach_function :initialize_agent, [:string, :string, :string, :int, :bool, :string], :bool
11
7
  attach_function :add_tag, [:uint64, :string, :string], :bool
12
8
  attach_function :remove_tag, [:uint64, :string, :string], :bool
13
9
  attach_function :drop_agent, [], :bool
14
10
  end
15
11
 
12
+ module Utils
13
+ extend FFI::Library
14
+ ffi_lib File.expand_path(File.dirname(__FILE__)) + "/thread_id/thread_id.#{RbConfig::CONFIG["DLEXT"]}"
15
+ attach_function :thread_id, [], :uint64
16
+ end
17
+
16
18
  module Pyroscope
17
- Config = Struct.new(:application_name, :server_address, :sample_rate, :detect_subprocesses, :log_level, :tags) do
19
+ Config = Struct.new(:application_name, :server_address, :auth_token, :sample_rate, :detect_subprocesses, :log_level, :tags) do
18
20
  def initialize(*)
19
21
  super
20
22
  self.application_name ||= ''
21
23
  self.server_address ||= 'http://localhost:4040'
24
+ self.auth_token ||= ''
22
25
  self.sample_rate ||= 100
23
26
  self.detect_subprocesses ||= true
24
27
  self.log_level ||= 'info'
@@ -36,6 +39,7 @@ module Pyroscope
36
39
  Rust.initialize_agent(
37
40
  @config.application_name,
38
41
  @config.server_address,
42
+ @config.auth_token,
39
43
  @config.sample_rate,
40
44
  @config.detect_subprocesses,
41
45
  tags_to_string(@config.tags)
@@ -66,8 +70,7 @@ end
66
70
 
67
71
  # get thread id
68
72
  def thread_id
69
- thread_id = Fiddle::Function.new($libm['thread_id'], [], Fiddle::TYPE_LONG_LONG)
70
- thread_id.call
73
+ return Utils.thread_id()
71
74
  end
72
75
 
73
76
  # add tags
data/lib/rbspy/rbspy.so CHANGED
Binary file
Binary file
data/pyroscope.gemspec CHANGED
@@ -26,7 +26,6 @@ Gem::Specification.new do |s|
26
26
  s.extensions = ['ext/rbspy/extconf.rb', 'ext/thread_id/extconf.rb']
27
27
 
28
28
  s.add_dependency 'ffi'
29
- s.add_dependency 'fiddle'
30
29
 
31
30
  s.add_development_dependency 'bundler'
32
31
  s.add_development_dependency 'rake', '~> 13.0'
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pyroscope_beta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.2
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Pyroscope Team
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2022-06-13 00:00:00.000000000 Z
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: fiddle
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: bundler
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -94,7 +80,7 @@ homepage: https://pyroscope.io
94
80
  licenses:
95
81
  - Apache-2.0
96
82
  metadata: {}
97
- post_install_message:
83
+ post_install_message:
98
84
  rdoc_options: []
99
85
  require_paths:
100
86
  - lib
@@ -109,8 +95,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
95
  - !ruby/object:Gem::Version
110
96
  version: '0'
111
97
  requirements: []
112
- rubygems_version: 3.4.0.dev
113
- signing_key:
98
+ rubygems_version: 3.3.7
99
+ signing_key:
114
100
  specification_version: 4
115
101
  summary: Pyroscope Beta
116
102
  test_files: []