vernier 1.7.0 → 1.7.1

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: 2419244a8929351d5c81f18b90766f20d7d9e29d4909c876deb06d2a9ad39f2d
4
- data.tar.gz: 94ead7ad3797a5cca2311cebc0ba0a57de369b7a6d09a07cbe4b6fad1f8826ac
3
+ metadata.gz: 356fbbcbb8c60616fe3a92c4eed26d7cac97f3a1e230e4904571f9666f4b64aa
4
+ data.tar.gz: cb7f9542080591e8fe680ab7f1b5688f0c5265e8d32d8ce2d8d56efab639ded0
5
5
  SHA512:
6
- metadata.gz: 25551c8b2d537ca00de410e0bbd2173a2cd0452462f8c8ed5c27fd9b6592fa60f7ff1eceb01b429eba69b1989287a7244acef7448b4335b3e2ef87e731af59df
7
- data.tar.gz: e510284f293ae3efd17e82c8e643b800ccbce5d84ffca04ef35fb16b5edf796672080465384cb40ea59eeacc7cc3cea57cb25e73805183956359a4e58e464f8c
6
+ metadata.gz: 2bf9a5882a9494b23c6a695836ee253a04054c501bab46b20b12b73516d7b21c103d1bb306ccb2a6ac3b5dce61d882620e6abbc53e056d0fd3e9260e68e97c44
7
+ data.tar.gz: e82f4becfb5a9e30cafebbe5271bd6b2e9883c3422eb5e61ee2ffae8589a0861f55a19b190c9d5a829894755a227438c7f4d2aa2225d55697f0f954738a49f10
data/README.md CHANGED
@@ -32,7 +32,7 @@ gem "vernier", "~> 1.0"
32
32
 
33
33
  ## Usage
34
34
 
35
- The output can be viewed in the web app at https://vernier.prof, locally using the [`profile-viewer` gem](https://github.com/tenderlove/profiler/tree/ruby) (both lightly customized versions of the firefox profiler frontend which profiles are compatible with), or by using the `vernier view` command in the CLI.
35
+ The output can be viewed in the web app at https://vernier.prof, locally using the [`profile-viewer` gem](https://github.com/tenderlove/profiler/tree/ruby) (both lightly customized versions of the Firefox profiler frontend which profiles are compatible with), or by using the `vernier view` command in the CLI.
36
36
 
37
37
  - **Flame Graph**: Shows proportionally how much time is spent within particular stack frames. Frames are grouped together, which means that x-axis / left-to-right order is not meaningful.
38
38
  - **Stack Chart**: Shows the stack at each sample with the x-axis representing time and can be read left-to-right.
@@ -133,10 +133,26 @@ ruby -r vernier -e 'Vernier.trace_retained(out: "irb_profile.json") { require "i
133
133
  | `mode` | N/A | Sampling mode: `:wall`, `:retained`, or `:custom`. | `:wall` (`:wall`) |
134
134
  | `out` | N/A | File to write the profile to. | N/A (Auto-generated) |
135
135
  | `interval` | `vernier_interval` | Sampling interval (µs). Only in `:wall` mode. | `500` (`200`) |
136
- | `allocation_interval` | `vernier_allocation_interval` | Allocation sampling interval. Only in `:wall` mode. | `0`/disabled (`200`) |
136
+ | `allocation_interval` | `vernier_allocation_interval` | Allocation sampling interval. Only in `:wall` mode. | `0` i.e. disabled (`200`) |
137
137
  | `gc` | N/A | Run full GC cycle before profiling. Only in `:retained` mode. | `true` (N/A) |
138
138
  | `metadata` | N/A | Metadata key-value pairs to include in the profile. | `{}` (N/A) |
139
139
 
140
+ #### Hook options
141
+
142
+ Vernier offers some optional hooks:
143
+
144
+ - `:rails` / `:activesupport` - Adds selected Active Support event markers to the Firefox output
145
+
146
+ - `:memory_usage` - Adds a memory usage counter to the Firefox output
147
+
148
+ Usage example:
149
+
150
+ ```ruby
151
+ Vernier.profile(out: "time_profile.json", hooks: [:rails, :memory_usage]) do
152
+ # ...
153
+ end
154
+ ```
155
+
140
156
  ## Development
141
157
 
142
158
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "filename_filter"
4
- require "cgi/util"
4
+ require "cgi/escape"
5
5
 
6
6
  module Vernier
7
7
  module Output
@@ -93,7 +93,7 @@ module Vernier
93
93
  end
94
94
 
95
95
  def output(gzip: false)
96
- result = ::JSON.fast_generate(data)
96
+ result = ::JSON.generate(data)
97
97
  if gzip
98
98
  require "zlib"
99
99
  result = Zlib.gzip(result)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Vernier
4
- VERSION = "1.7.0"
4
+ VERSION = "1.7.1"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vernier
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Hawthorn
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-04-03 00:00:00.000000000 Z
10
+ date: 2025-05-16 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: activesupport