singed 0.1.0 → 0.1.1

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: 5276eb42b69baf43de15c7ad5a3549f048d00865f225998eb4479b6e7723f2b8
4
- data.tar.gz: 0f46bfb076f12a4766e060a017f2cb0e9ad6af98a96b8f96ebf05b58205aac21
3
+ metadata.gz: 6cc0d66eb51327ad33ea4c7ebb3a912dfed9d0dcf3c136c50b88352df68231bd
4
+ data.tar.gz: b02a7c770155ace82da51f37024d89a25836f7f4fffbc77983a067789f172aad
5
5
  SHA512:
6
- metadata.gz: 81b34cf130fbe187680d65ba593ee68ce606e72cbb5db99284aba82beb6bf9ac17cef5104850a49ebba7bce87cc8a11b39f4b0897accb9bc6e0cb268ee35168e
7
- data.tar.gz: 23e265212f1f70ebe105c218dde2025728782ae1574ef2abcf4705b04e13eeab7bd9b6197442b950517492c5a540a2ebaa99478d7841b4170a8611ff668094a9
6
+ metadata.gz: 95b737124852e8d1863658b10b8ab589753f8f5b4d636269c4c3c403df130189fc4b65f7fb3409c70ca11845fbe8bdbd338330476a3f561bf7da9176613a055f
7
+ data.tar.gz: 966891d7739c6f1bbd63674d345f7a52e678a9791c56075c677fbb3013f575839fa1e399ca13bf08f1a2fe284abf431c2dd29d1a057c1e423356aac0e01a95de
data/README.md CHANGED
@@ -1,10 +1,20 @@
1
1
  # Singed
2
2
 
3
- Singed makes it easy to get a flamegraph anywhere in your code base:
3
+ Singed makes it easy to get a flamegraph anywhere in your code base. It wraps profiling your code with [stackprof](https://github.com/tmm1/stackprof) or [rbspy](https://github.com/rbspy/rbspy), and then launching [speedscope](https://github.com/jlfwong/speedscope) to view it.
4
+
5
+ ## Installation
6
+
7
+ Add to `Gemfile`:
8
+
9
+ ```ruby
10
+ gem "singed"
11
+ ```
12
+
13
+ Then run `bundle install`
4
14
 
5
15
  ## Usage
6
16
 
7
- To profile your code, and launch [speedscope](https://github.com/jlfwong/speedscope) for viewing it:
17
+ Simplest is calling with a block:
8
18
 
9
19
  ```ruby
10
20
  flamegraph {
@@ -64,7 +74,7 @@ class EmployeesController < ApplicationController
64
74
  end
65
75
  ```
66
76
 
67
- This won't catch the entire request though, just once it's been routed to controller and a response has been served.
77
+ This won't catch the entire request though, just once it's been routed to controller and a response has been served (ie no middleware).
68
78
 
69
79
  ### Rack/Rails requests
70
80
 
@@ -84,7 +94,7 @@ There is a `singed` command line you can use that will record a flamegraph from
84
94
 
85
95
  ```shell
86
96
  $ bundle binstub singed # if you want to be able to call it like bin/singed
87
- $ bundle exec singed -- bin/rails
97
+ $ bundle exec singed -- bin/rails runner 'Model.all.to_a'
88
98
  ```
89
99
 
90
100
  The flamegraph is opened afterwards.
@@ -98,5 +108,5 @@ The `open` is expected to be available.
98
108
 
99
109
  ## Alternatives
100
110
 
101
- - using [rbspy](https://rbspy.github.io/) directory
111
+ - using [rbspy](https://rbspy.github.io/) directly
102
112
  - using [stackprof](https://github.com/tmm1/stackprof) (a dependency of singed) directly
@@ -53,7 +53,7 @@ module Singed
53
53
  end
54
54
 
55
55
  def self.generate_filename(label: nil, time: Time.now) # rubocop:disable Rails/TimeZone
56
- formatted_time = time.to_formatted_s(:number)
56
+ formatted_time = time.strftime('%Y%m%d%H%M%S')
57
57
  basename_parts = ['speedscope', label, formatted_time].compact
58
58
 
59
59
  file = Singed.output_directory.join("#{basename_parts.join('-')}.json")
data/singed.gemspec CHANGED
@@ -3,7 +3,7 @@
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'singed'
5
5
 
6
- spec.version = '0.1.0'
6
+ spec.version = '0.1.1'
7
7
  spec.authors = ['Josh Nichols']
8
8
  spec.email = ['josh.nichols@gusto.com']
9
9
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: singed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Nichols
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-20 00:00:00.000000000 Z
11
+ date: 2023-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize