pyroscope 0.0.13 → 0.0.14

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: 42f5e0729331e9002034247e8e90daf55c4efee52fd9c73a09bcf97ea3faf073
4
- data.tar.gz: a15a4611dd40f44d1a3dd82d3fc15fe92efd3ac61bcba0ea4eb94e94748a34e4
3
+ metadata.gz: 619c59b1c6e494e5e1b4b47889ea9de7eed5c44264ec0bd9f1372ea87c6a94d0
4
+ data.tar.gz: d4c3632f2ee191e8bb60529bd5699e11100500cc3ca1cbb4d119a183c38e279d
5
5
  SHA512:
6
- metadata.gz: 702c84e56457539ce3872df0b9639c0f1ca3d8f70b6a5053a62056bec9cfb52272a99f8a4b9b795fc340dca5b34d9d1b2c02985f4a36ff96ae65f2981da69413
7
- data.tar.gz: 3c8bef0ab7f2bd2a86e8971eed949ea22e6a4edf1c0ad5bd274ab91c0f8d4538cef49a9ee441c54d0941b173329bd364ba434a17ffa49e2afe9919c52acd3143
6
+ metadata.gz: 98d120335fbe70f9527e4f9eeb3678dd8db7dfac0aefb1e44fb639c499911ddec9370bb91e9f22bd9ecda519cb3fa92e6982dd9eda135e7be9efe3f26042295d
7
+ data.tar.gz: '09f603d60123a92e983ac22eeefff6468e047edc99f5cffd4278dfa94e51fc837522daa669838430459bf0009f14eef4d31c1aaae8c647b0196bcd4bedeb0cb6'
data/Rakefile CHANGED
@@ -42,14 +42,16 @@ task :build => [:clean, :compile]
42
42
  task :default => [:build, :spec]
43
43
 
44
44
  task :test do
45
- system "rsync -a /home/dmitry/rbspy/ /home/dmitry/pyroscope/third_party/local-clones/rbspy"
46
- # system "cd ../pyroscope && DOCKER_BUILDKIT=1 docker build -f Dockerfile.static-libs --output type=local,dest=out ." if RUBY_PLATFORM.include?("linux")
47
- system "cd ../pyroscope && rm out/*.a"
48
- system "cd ../pyroscope && ENABLED_SPIES=rbspy make build-rust-dependencies"
49
- system "cd ../pyroscope && make build-rbspy-static-library"
50
- system "cd ../pyroscope && cp third_party/rustdeps/target/x86_64-unknown-linux-gnu/release/librustdeps.a ./out/librustdeps.a"
45
+ # system "rsync -a /home/dmitry/rbspy/ /home/dmitry/pyroscope/third_party/local-clones/rbspy"
46
+ # # system "cd ../pyroscope && DOCKER_BUILDKIT=1 docker build -f Dockerfile.static-libs --output type=local,dest=out ." if RUBY_PLATFORM.include?("linux")
47
+ # system "cd ../pyroscope && rm out/*.a"
48
+ # system "cd ../pyroscope && ENABLED_SPIES=rbspy make build-rust-dependencies"
49
+ # system "cd ../pyroscope && make build-rbspy-static-library"
50
+ # system "cd ../pyroscope && cp third_party/rustdeps/target/x86_64-unknown-linux-gnu/release/librustdeps.a ./out/librustdeps.a"
51
+ extra_env = "PYROSCOPE_RUBY_LOCAL=1"
52
+ extra_env = ""
51
53
 
52
- system "PYROSCOPE_RUBY_LOCAL=1 rake build && PYROSCOPE_RUBY_LOCAL=1 sudo -E gem install pkg/pyroscope-#{Pyroscope::VERSION}.gem && sudo -E ruby test.rb"
54
+ system "#{extra_env} rake build && #{extra_env} sudo -E gem install pkg/pyroscope-#{Pyroscope::VERSION}.gem && sudo -E ruby test.rb"
53
55
  end
54
56
 
55
57
  task :test_exec do
@@ -9,7 +9,7 @@ HEADER_DIRS = [INCLUDEDIR]
9
9
 
10
10
  LIB_DIRS = [LIBDIR, File.expand_path(File.join(File.dirname(__FILE__), "lib"))]
11
11
 
12
- COMMIT = "39a3d9c"
12
+ COMMIT = "a263249"
13
13
 
14
14
  # TODO: this is not very accurate, but it works for now
15
15
  OS = RUBY_PLATFORM.include?("darwin") ? "mac" : "linux"
@@ -25,32 +25,35 @@ if ENV["PYROSCOPE_RUBY_LOCAL"]
25
25
  system "cp #{ENV["HOME"]}/pyroscope/out/librustdeps.a #{File.join(ROOT, "lib/librustdeps.a")}"
26
26
  else
27
27
  Net::HTTP.start("dl.pyroscope.io", 443, :use_ssl => true) do |http|
28
- req = Net::HTTP::Get.new(PREFIX+"/libpyroscope.rbspy.combo.a.gz")
29
- http.request(req) do |resp|
30
- raise "HTTP error: #{resp.code}" unless resp.code == "200"
31
-
32
- r, w = IO.pipe
33
-
34
- t = Thread.new do
35
- zreader = Zlib::GzipReader.new(r)
36
- File.open(File.join(ROOT, "lib/libpyroscope.rbspy.combo.a"), "wb") do |f|
37
- loop do
38
- begin
39
- chunk = zreader.readpartial(32768)
40
- break if chunk.nil?
41
- rescue EOFError
42
- break
28
+ ["libpyroscope.rbspy.a", "librustdeps.a"].each do |name|
29
+ url = PREFIX+"/#{name}.gz"
30
+ req = Net::HTTP::Get.new(url)
31
+ http.request(req) do |resp|
32
+ raise "HTTP error: #{resp.code}" unless resp.code == "200"
33
+
34
+ r, w = IO.pipe
35
+
36
+ t = Thread.new do
37
+ zreader = Zlib::GzipReader.new(r)
38
+ File.open(File.join(ROOT, "lib/#{name}"), "wb") do |f|
39
+ loop do
40
+ begin
41
+ chunk = zreader.readpartial(32768)
42
+ break if chunk.nil?
43
+ rescue EOFError
44
+ break
45
+ end
46
+ f.write(chunk)
43
47
  end
44
- f.write(chunk)
45
48
  end
46
49
  end
47
- end
48
50
 
49
- resp.read_body do |chunk|
50
- w.write(chunk)
51
- end
51
+ resp.read_body do |chunk|
52
+ w.write(chunk)
53
+ end
52
54
 
53
- t.join
55
+ t.join
56
+ end
54
57
  end
55
58
  end
56
59
  end
@@ -60,7 +63,7 @@ end
60
63
 
61
64
  dir_config('pyroscope', HEADER_DIRS, LIB_DIRS)
62
65
 
63
- libs = ['-lpyroscope.rbspy.combo']
66
+ libs = ['-lpyroscope.rbspy', '-lrustdeps']
64
67
  libs.each do |lib|
65
68
  $LOCAL_LIBS << "#{lib} "
66
69
  end
File without changes
Binary file
@@ -1,3 +1,3 @@
1
1
  module Pyroscope
2
- VERSION = "0.0.13".freeze
2
+ VERSION = "0.0.14".freeze
3
3
  end
data/test.rb CHANGED
@@ -1,11 +1,11 @@
1
- # require 'pyroscope'
1
+ require 'pyroscope'
2
2
 
3
3
  puts "prestart #{Process.pid}"
4
4
 
5
- # Pyroscope.configure do |config|
6
- # config.app_name = "test.ruby.app{}"
7
- # config.server_address = "http://localhost:4040/"
8
- # end
5
+ Pyroscope.configure do |config|
6
+ config.app_name = "test.ruby.app{}"
7
+ config.server_address = "http://localhost:4040/"
8
+ end
9
9
 
10
10
  puts "start"
11
11
  iteration=0
@@ -39,13 +39,13 @@ while true
39
39
  sleep_job
40
40
  elsif r < 0.5
41
41
  puts(" * test.ruby.app{job=0}")
42
- # Pyroscope.change_name("test.ruby.app{job=0}")
42
+ Pyroscope.change_name("test.ruby.app{job=0}")
43
43
  job_0
44
- # Pyroscope.change_name("test.ruby.app{}")
44
+ Pyroscope.change_name("test.ruby.app{}")
45
45
  else
46
46
  puts(" * test.ruby.app{job=1}")
47
- # Pyroscope.change_name("test.ruby.app{job=1}")
47
+ Pyroscope.change_name("test.ruby.app{job=1}")
48
48
  job_1
49
- # Pyroscope.change_name("test.ruby.app{}")
49
+ Pyroscope.change_name("test.ruby.app{}")
50
50
  end
51
51
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pyroscope
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pyroscope Team
@@ -94,6 +94,7 @@ files:
94
94
  - Rakefile
95
95
  - ext/pyroscope/Makefile.example
96
96
  - ext/pyroscope/extconf.rb
97
+ - ext/pyroscope/lib/.gitkeep
97
98
  - ext/pyroscope/lib/libpyroscope.rbspy.a
98
99
  - ext/pyroscope/lib/libpyroscope.rbspy.combo.a
99
100
  - ext/pyroscope/lib/librustdeps.a