profilizer 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/gempush.yml +40 -0
- data/.github/workflows/rubocop.yml +22 -0
- data/.github/workflows/ruby.yml +20 -0
- data/.gitignore +2 -0
- data/README.md +8 -7
- data/lib/profilizer.rb +1 -1
- data/lib/profilizer/version.rb +1 -1
- data/profilizer.gemspec +0 -3
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 354fa8a4552906d853ea248c1c2609182f42e5c0750da9f11501cc7dd69a42db
|
4
|
+
data.tar.gz: dab51934bc6f00d1b4be972463380a70cc077825e11559319b1238bf71b65485
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95ad5334e76bfb66ce1bec3ddb015372e8f965f777163f00d44ec6e2bb96960ffa2ecb7ee2b9a29570feea60484fef39a2aa520529e87d0765ab94469a3f65ff
|
7
|
+
data.tar.gz: 7b1ce0f6b5b3d36a5c9f05e6895035fbe0b52d9d22e617b40443a3b70d8e69a33e8671ee62c20cb765e6ca15089b2aaff5dbce82c35aad29bb314a87efbd38a2
|
@@ -0,0 +1,40 @@
|
|
1
|
+
name: Ruby Gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ release ]
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
build:
|
9
|
+
name: Build + Publish
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v2
|
14
|
+
- name: Set up Ruby 2.6
|
15
|
+
uses: actions/setup-ruby@v1
|
16
|
+
with:
|
17
|
+
version: 2.6.x
|
18
|
+
|
19
|
+
- name: Publish to GPR
|
20
|
+
run: |
|
21
|
+
mkdir -p $HOME/.gem
|
22
|
+
touch $HOME/.gem/credentials
|
23
|
+
chmod 0600 $HOME/.gem/credentials
|
24
|
+
printf -- "---\n:github: Bearer ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
25
|
+
gem build *.gemspec
|
26
|
+
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
|
27
|
+
env:
|
28
|
+
GEM_HOST_API_KEY: ${{secrets.GPR_AUTH_TOKEN}}
|
29
|
+
OWNER: dkremez
|
30
|
+
|
31
|
+
- name: Publish to RubyGems
|
32
|
+
run: |
|
33
|
+
mkdir -p $HOME/.gem
|
34
|
+
touch $HOME/.gem/credentials
|
35
|
+
chmod 0600 $HOME/.gem/credentials
|
36
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
37
|
+
gem build *.gemspec
|
38
|
+
gem push *.gem
|
39
|
+
env:
|
40
|
+
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# .github/workflows/rubocop.yml
|
2
|
+
|
3
|
+
name: Rubocop
|
4
|
+
|
5
|
+
on: [push]
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
build:
|
9
|
+
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v2
|
14
|
+
- name: Set up Ruby 2.6
|
15
|
+
uses: actions/setup-ruby@v1
|
16
|
+
with:
|
17
|
+
ruby-version: 2.6.x
|
18
|
+
- name: Build and lint with Rubocop
|
19
|
+
run: |
|
20
|
+
gem install bundler
|
21
|
+
bundle install --jobs 4 --retry 3
|
22
|
+
bundle exec rubocop
|
@@ -0,0 +1,20 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on: [push]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
|
10
|
+
steps:
|
11
|
+
- uses: actions/checkout@v2
|
12
|
+
- name: Set up Ruby 2.6
|
13
|
+
uses: actions/setup-ruby@v1
|
14
|
+
with:
|
15
|
+
ruby-version: 2.6.x
|
16
|
+
- name: Build and test with Rake
|
17
|
+
run: |
|
18
|
+
gem install bundler
|
19
|
+
bundle install --jobs 4 --retry 3
|
20
|
+
bundle exec rake
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
![Ruby](https://github.com/dkremez/profilizer/workflows/Ruby/badge.svg?branch=master)
|
2
|
+
![Rubocop](https://github.com/dkremez/profilizer/workflows/Rubocop/badge.svg?branch=master)
|
3
|
+
|
1
4
|
# Profilizer
|
2
5
|
|
3
6
|
Profilizer is a Ruby gem for easy profile of methods. It helps you to track how fast you methods are, how much memory the consume and how much objects were allocated.
|
@@ -8,14 +11,12 @@ The normal hand on profiling in Ruby doesn't require any gems and looks like thi
|
|
8
11
|
def profile
|
9
12
|
start = Time.now
|
10
13
|
yield if block_given?
|
11
|
-
|
12
|
-
puts "Duration: #{
|
14
|
+
finish = Time.now
|
15
|
+
puts "Duration: #{finish - start}"
|
13
16
|
end
|
14
17
|
```
|
15
18
|
|
16
|
-
However, it is not handy in case you want more options
|
17
|
-
|
18
|
-
Here is what is gem propose instead:
|
19
|
+
However, it is not handy in case you want more options. What if you can do the following?
|
19
20
|
|
20
21
|
```ruby
|
21
22
|
class A
|
@@ -84,8 +85,8 @@ Memory usage: 2.05 MB
|
|
84
85
|
|
85
86
|
### Configuration
|
86
87
|
|
87
|
-
What if you only want to profile time
|
88
|
-
Here is how you could config
|
88
|
+
What if you only want to profile time, used memory, or objects allocations only.
|
89
|
+
Here is how you could config it:
|
89
90
|
|
90
91
|
```ruby
|
91
92
|
class A
|
data/lib/profilizer.rb
CHANGED
data/lib/profilizer/version.rb
CHANGED
data/profilizer.gemspec
CHANGED
@@ -19,9 +19,6 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.homepage = 'https://github.com/dkremez/profilizer'
|
20
20
|
spec.license = 'MIT'
|
21
21
|
spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
|
22
|
-
|
23
|
-
spec.metadata['allowed_push_host'] = "https://rubygems.org"
|
24
|
-
|
25
22
|
spec.metadata['homepage_uri'] = spec.homepage
|
26
23
|
spec.metadata['source_code_uri'] = spec.homepage
|
27
24
|
spec.metadata['changelog_uri'] = spec.homepage
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: profilizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dzmitry Kremez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby2_keywords
|
@@ -36,6 +36,9 @@ executables: []
|
|
36
36
|
extensions: []
|
37
37
|
extra_rdoc_files: []
|
38
38
|
files:
|
39
|
+
- ".github/workflows/gempush.yml"
|
40
|
+
- ".github/workflows/rubocop.yml"
|
41
|
+
- ".github/workflows/ruby.yml"
|
39
42
|
- ".gitignore"
|
40
43
|
- ".rspec"
|
41
44
|
- ".rubocop.yml"
|
@@ -54,7 +57,6 @@ homepage: https://github.com/dkremez/profilizer
|
|
54
57
|
licenses:
|
55
58
|
- MIT
|
56
59
|
metadata:
|
57
|
-
allowed_push_host: https://rubygems.org
|
58
60
|
homepage_uri: https://github.com/dkremez/profilizer
|
59
61
|
source_code_uri: https://github.com/dkremez/profilizer
|
60
62
|
changelog_uri: https://github.com/dkremez/profilizer
|