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 +4 -4
- data/README.md +15 -5
- data/lib/singed/flamegraph.rb +1 -1
- data/singed.gemspec +1 -1
- 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: 6cc0d66eb51327ad33ea4c7ebb3a912dfed9d0dcf3c136c50b88352df68231bd
|
4
|
+
data.tar.gz: b02a7c770155ace82da51f37024d89a25836f7f4fffbc77983a067789f172aad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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/)
|
111
|
+
- using [rbspy](https://rbspy.github.io/) directly
|
102
112
|
- using [stackprof](https://github.com/tmm1/stackprof) (a dependency of singed) directly
|
data/lib/singed/flamegraph.rb
CHANGED
@@ -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.
|
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
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.
|
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-
|
11
|
+
date: 2023-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|