timeasure 0.1.0 → 0.1.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 +4 -4
- data/README.md +7 -4
- data/lib/timeasure/class_methods.rb +2 -2
- data/lib/timeasure/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98176f0d699b3c9ca5cd0e101021edafe375e77d
|
4
|
+
data.tar.gz: 7be9aa110d461fd15ebe5b449e307c5159df778d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '03826e4210bf05d86005e3245f35c90e02aa75e4771195b850a3ba9744535404d799474e56e7db7312bb48ae89ef70a2c455bc661a9c48e3156fa2932dc8ec55'
|
7
|
+
data.tar.gz: 50bdd345a80bfc306eb3138f46c7a3f20493d8193d53ee73d0c538da92da86ffeca7eff5a3dc8d52e0890e8cfc014cd998e8f0efe3792947ad9829bb43c43762
|
data/README.md
CHANGED
@@ -1,8 +1,11 @@
|
|
1
|
+
[](https://badge.fury.io/rb/timeasure)
|
2
|
+
[](https://codeclimate.com/github/Riskified/timeasure/maintainability)
|
3
|
+
|
1
4
|
# Timeasure
|
2
5
|
|
3
6
|
**What Is It?**
|
4
7
|
|
5
|
-
Timeasure is a transparent method-level wrapper for profiling purposes
|
8
|
+
Timeasure is a transparent method-level wrapper for profiling purposes. See a live example [right here!](https://timeasure-demo.herokuapp.com/)
|
6
9
|
|
7
10
|
Timeasure is a Ruby gem that allows measuring the runtime of methods in production environments
|
8
11
|
without having to alter the code of the methods themselves.
|
@@ -23,7 +26,7 @@ The imagined usage of measured methods timing is to aggregate it along a certain
|
|
23
26
|
BI service such as [NewRelic Insights](https://newrelic.com/insights) or [Keen.io](https://keen.io/);
|
24
27
|
however, different usages might prove helpful as well, such as writing the data to a database or a file.
|
25
28
|
|
26
|
-
**
|
29
|
+
**General Notes**
|
27
30
|
|
28
31
|
Timeasure uses minimal intervention in the Ruby Object Model for tracked modules and classes.
|
29
32
|
It integrates well within Rails and non-Rails apps.
|
@@ -32,6 +35,8 @@ Timeasure is inspired by [Metaprogramming Ruby 2](https://pragprog.com/book/ppme
|
|
32
35
|
by [Paolo Perrotta](https://twitter.com/nusco)
|
33
36
|
and by [this](https://hashrocket.com/blog/posts/module-prepend-a-super-story) blog post by Hashrocket.
|
34
37
|
|
38
|
+
Timeasure is developed and maintained by [Eliav Lavi](http://www.eliavlavi.com) & [Riskified](https://www.riskified.com/).
|
39
|
+
|
35
40
|
## Requirements
|
36
41
|
|
37
42
|
Ruby 2.0 or a later version is mandatory. (Timeasure uses `Module#prepend` introduced in Ruby 2.0.)
|
@@ -109,7 +114,6 @@ in which case the segment will be concatenated to the string as well. See [Segme
|
|
109
114
|
|
110
115
|
|
111
116
|
## Advanced Usage
|
112
|
-
|
113
117
|
#### Segmented Method Tracking
|
114
118
|
Timeasure was designed to separate regular code from its time measurement declaration.
|
115
119
|
This is achieved by Timeasure's class macros `tracked_class_methods` and `tracked_instance_methods`.
|
@@ -169,7 +173,6 @@ Unlike Segments, Timeasure only carries the Metadata onwards.
|
|
169
173
|
It is up to the user to make use of this data, probably after calling `Timeasure::Profiling::Manager.export`.
|
170
174
|
|
171
175
|
## Notes
|
172
|
-
|
173
176
|
#### Compatibility with RSpec
|
174
177
|
|
175
178
|
If you run your test suite with Timeasure installed and modules, classes and methods tracked and all works fine - hurray!
|
@@ -1,15 +1,15 @@
|
|
1
1
|
module Timeasure
|
2
2
|
module ClassMethods
|
3
3
|
def tracked_instance_methods(*method_names)
|
4
|
+
instance_interceptor = const_get("#{timeasure_name}InstanceInterceptor")
|
4
5
|
method_names.each do |method_name|
|
5
|
-
instance_interceptor = const_get("#{timeasure_name}InstanceInterceptor")
|
6
6
|
add_method_to_interceptor(instance_interceptor, method_name)
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
10
10
|
def tracked_class_methods(*method_names)
|
11
|
+
class_interceptor = const_get("#{timeasure_name}ClassInterceptor")
|
11
12
|
method_names.each do |method_name|
|
12
|
-
class_interceptor = const_get("#{timeasure_name}ClassInterceptor")
|
13
13
|
add_method_to_interceptor(class_interceptor, method_name)
|
14
14
|
end
|
15
15
|
end
|
data/lib/timeasure/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timeasure
|
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
|
- Eliav Lavi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|