pyroscope 0.5.0-arm64-darwin → 0.5.1-arm64-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/lib/pyroscope/version.rb +1 -1
 - data/lib/pyroscope.rb +53 -13
 - data/lib/rbspy/rbspy.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: f328c6c7cb2f5835c2c54a6fc98204c27f0e24c276b1a30395cc36af7ecc2dcf
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: b833d35f0b6b77d47867411f5550f1f9fd9928c634eb0491c87c2e559800e302
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: b1bf24d27f82e6a35a839fe94f9d3faed53200e107ec3e6f722d3c9a942672c58c360921d75dbadbbc37545ea7ffe0c1c826df1f94276e3c0c0f8ca057b5084f
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: b632502ee52af7a3973953d9b5078053ba4a45cf68e635b18e37b3e6ca691a72cdd16f3241821d58eb77ece1821e955cd541f8a097ab89099553995951701493
         
     | 
    
        data/lib/pyroscope/version.rb
    CHANGED
    
    
    
        data/lib/pyroscope.rb
    CHANGED
    
    | 
         @@ -22,7 +22,32 @@ module Pyroscope 
     | 
|
| 
       22 
22 
     | 
    
         
             
                attach_function :thread_id, [], :uint64
         
     | 
| 
       23 
23 
     | 
    
         
             
              end
         
     | 
| 
       24 
24 
     | 
    
         | 
| 
       25 
     | 
    
         
            -
               
     | 
| 
      
 25 
     | 
    
         
            +
              if defined?(::Rails::Engine)
         
     | 
| 
      
 26 
     | 
    
         
            +
                class Engine < ::Rails::Engine
         
     | 
| 
      
 27 
     | 
    
         
            +
                  config.after_initialize do
         
     | 
| 
      
 28 
     | 
    
         
            +
                    next unless ::Pyroscope.current_config && ::Pyroscope.current_config.autoinstrument_rails
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
                    ::Pyroscope.initialize_rails_hooks
         
     | 
| 
      
 31 
     | 
    
         
            +
                  end
         
     | 
| 
      
 32 
     | 
    
         
            +
                end
         
     | 
| 
      
 33 
     | 
    
         
            +
              end
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
              Config = Struct.new(
         
     | 
| 
      
 36 
     | 
    
         
            +
                :application_name,
         
     | 
| 
      
 37 
     | 
    
         
            +
                :app_name,
         
     | 
| 
      
 38 
     | 
    
         
            +
                :server_address,
         
     | 
| 
      
 39 
     | 
    
         
            +
                :auth_token,
         
     | 
| 
      
 40 
     | 
    
         
            +
                :log_level,
         
     | 
| 
      
 41 
     | 
    
         
            +
                :sample_rate,
         
     | 
| 
      
 42 
     | 
    
         
            +
                :detect_subprocesses,
         
     | 
| 
      
 43 
     | 
    
         
            +
                :oncpu,
         
     | 
| 
      
 44 
     | 
    
         
            +
                :report_pid,
         
     | 
| 
      
 45 
     | 
    
         
            +
                :report_thread_id,
         
     | 
| 
      
 46 
     | 
    
         
            +
                :tags,
         
     | 
| 
      
 47 
     | 
    
         
            +
                :compression,
         
     | 
| 
      
 48 
     | 
    
         
            +
                :report_encoding,
         
     | 
| 
      
 49 
     | 
    
         
            +
                :autoinstrument_rails,
         
     | 
| 
      
 50 
     | 
    
         
            +
              ) do
         
     | 
| 
       26 
51 
     | 
    
         
             
                def initialize(*)
         
     | 
| 
       27 
52 
     | 
    
         
             
                  super
         
     | 
| 
       28 
53 
     | 
    
         
             
                  # defaults:
         
     | 
| 
         @@ -38,10 +63,15 @@ module Pyroscope 
     | 
|
| 
       38 
63 
     | 
    
         
             
                  self.tags = {}
         
     | 
| 
       39 
64 
     | 
    
         
             
                  self.compression = 'gzip'
         
     | 
| 
       40 
65 
     | 
    
         
             
                  self.report_encoding = 'pprof'
         
     | 
| 
      
 66 
     | 
    
         
            +
                  self.autoinstrument_rails = true
         
     | 
| 
       41 
67 
     | 
    
         
             
                end
         
     | 
| 
       42 
68 
     | 
    
         
             
              end
         
     | 
| 
       43 
69 
     | 
    
         | 
| 
       44 
70 
     | 
    
         
             
              class << self
         
     | 
| 
      
 71 
     | 
    
         
            +
                def current_config
         
     | 
| 
      
 72 
     | 
    
         
            +
                  @config
         
     | 
| 
      
 73 
     | 
    
         
            +
                end
         
     | 
| 
      
 74 
     | 
    
         
            +
             
     | 
| 
       45 
75 
     | 
    
         
             
                def configure
         
     | 
| 
       46 
76 
     | 
    
         
             
                  @config = Config.new
         
     | 
| 
       47 
77 
     | 
    
         | 
| 
         @@ -64,11 +94,8 @@ module Pyroscope 
     | 
|
| 
       64 
94 
     | 
    
         
             
                    @log_level = 50
         
     | 
| 
       65 
95 
     | 
    
         
             
                  end
         
     | 
| 
       66 
96 
     | 
    
         | 
| 
       67 
     | 
    
         
            -
                  # Initialize Logging
         
     | 
| 
       68 
97 
     | 
    
         
             
                  Rust.initialize_logging(@log_level)
         
     | 
| 
       69 
98 
     | 
    
         | 
| 
       70 
     | 
    
         
            -
             
     | 
| 
       71 
     | 
    
         
            -
                  # initialize Pyroscope Agent
         
     | 
| 
       72 
99 
     | 
    
         
             
                  Rust.initialize_agent(
         
     | 
| 
       73 
100 
     | 
    
         
             
                    # these are defaults in case user-provided values are nil:
         
     | 
| 
       74 
101 
     | 
    
         
             
                    @config.app_name || @config.application_name || "",
         
     | 
| 
         @@ -85,6 +112,17 @@ module Pyroscope 
     | 
|
| 
       85 
112 
     | 
    
         
             
                  )
         
     | 
| 
       86 
113 
     | 
    
         
             
                end
         
     | 
| 
       87 
114 
     | 
    
         | 
| 
      
 115 
     | 
    
         
            +
                def initialize_rails_hooks
         
     | 
| 
      
 116 
     | 
    
         
            +
                  block = lambda do |ctrl, action|
         
     | 
| 
      
 117 
     | 
    
         
            +
                    Pyroscope.tag_wrapper({
         
     | 
| 
      
 118 
     | 
    
         
            +
                      "action" => "#{ctrl.controller_name}/#{ctrl.action_name}"
         
     | 
| 
      
 119 
     | 
    
         
            +
                    }, &action)
         
     | 
| 
      
 120 
     | 
    
         
            +
                  end
         
     | 
| 
      
 121 
     | 
    
         
            +
             
     | 
| 
      
 122 
     | 
    
         
            +
                  ActionController::API.__send__(:around_action, block) if defined? ActionController::API
         
     | 
| 
      
 123 
     | 
    
         
            +
                  ActionController::Base.__send__(:around_action, block) if defined? ActionController::Base
         
     | 
| 
      
 124 
     | 
    
         
            +
                end
         
     | 
| 
      
 125 
     | 
    
         
            +
             
     | 
| 
       88 
126 
     | 
    
         
             
                def tag_wrapper(tags)
         
     | 
| 
       89 
127 
     | 
    
         
             
                  tid = thread_id
         
     | 
| 
       90 
128 
     | 
    
         
             
                  _add_tags(tid, tags)
         
     | 
| 
         @@ -103,32 +141,34 @@ module Pyroscope 
     | 
|
| 
       103 
141 
     | 
    
         
             
                  warn("deprecated. Use `Pyroscope.tag_wrapper` instead.")
         
     | 
| 
       104 
142 
     | 
    
         
             
                end
         
     | 
| 
       105 
143 
     | 
    
         | 
| 
       106 
     | 
    
         
            -
                # convert tags object to string
         
     | 
| 
       107 
     | 
    
         
            -
                def tags_to_string(tags)
         
     | 
| 
       108 
     | 
    
         
            -
                  tags.map { |k, v| "#{k}=#{v}" }.join(',')
         
     | 
| 
       109 
     | 
    
         
            -
                end
         
     | 
| 
       110 
     | 
    
         
            -
             
     | 
| 
       111 
     | 
    
         
            -
                # get thread id
         
     | 
| 
       112 
144 
     | 
    
         
             
                def thread_id
         
     | 
| 
       113 
145 
     | 
    
         
             
                  return Utils.thread_id
         
     | 
| 
       114 
146 
     | 
    
         
             
                end
         
     | 
| 
       115 
147 
     | 
    
         | 
| 
       116 
     | 
    
         
            -
                # add tags
         
     | 
| 
       117 
148 
     | 
    
         
             
                def _add_tags(thread_id, tags)
         
     | 
| 
       118 
149 
     | 
    
         
             
                  tags.each do |tag_name, tag_value|
         
     | 
| 
       119 
150 
     | 
    
         
             
                    Rust.add_thread_tag(thread_id, tag_name.to_s, tag_value.to_s)
         
     | 
| 
       120 
151 
     | 
    
         
             
                  end
         
     | 
| 
       121 
152 
     | 
    
         
             
                end
         
     | 
| 
       122 
153 
     | 
    
         | 
| 
       123 
     | 
    
         
            -
                # remove tags
         
     | 
| 
       124 
154 
     | 
    
         
             
                def _remove_tags(thread_id, tags)
         
     | 
| 
       125 
155 
     | 
    
         
             
                  tags.each do |tag_name, tag_value|
         
     | 
| 
       126 
156 
     | 
    
         
             
                    Rust.remove_thread_tag(thread_id, tag_name.to_s, tag_value.to_s)
         
     | 
| 
       127 
157 
     | 
    
         
             
                  end
         
     | 
| 
       128 
158 
     | 
    
         
             
                end
         
     | 
| 
       129 
159 
     | 
    
         | 
| 
       130 
     | 
    
         
            -
                def  
     | 
| 
      
 160 
     | 
    
         
            +
                def stop
         
     | 
| 
       131 
161 
     | 
    
         
             
                  Rust.drop_agent
         
     | 
| 
       132 
162 
     | 
    
         
             
                end
         
     | 
| 
      
 163 
     | 
    
         
            +
             
     | 
| 
      
 164 
     | 
    
         
            +
                def shutdown
         
     | 
| 
      
 165 
     | 
    
         
            +
                  stop
         
     | 
| 
      
 166 
     | 
    
         
            +
                end
         
     | 
| 
      
 167 
     | 
    
         
            +
             
     | 
| 
      
 168 
     | 
    
         
            +
                private
         
     | 
| 
      
 169 
     | 
    
         
            +
             
     | 
| 
      
 170 
     | 
    
         
            +
                def tags_to_string(tags)
         
     | 
| 
      
 171 
     | 
    
         
            +
                  tags.map { |k, v| "#{k}=#{v}" }.join(',')
         
     | 
| 
      
 172 
     | 
    
         
            +
                end
         
     | 
| 
       133 
173 
     | 
    
         
             
              end
         
     | 
| 
       134 
174 
     | 
    
         
             
            end
         
     | 
    
        data/lib/rbspy/rbspy.bundle
    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.5. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.5.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: arm64-darwin
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Pyroscope Team
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2022-09- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2022-09-08 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: ffi
         
     |