timify 0.0.2 → 0.0.3
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 -15
- data/lib/timify.rb +1 -1
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc706519775851a3f8ee237c66006942016ad281
|
4
|
+
data.tar.gz: 6e7fbdf017468acb3471060eee5ce0e545dcacd8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1889029c68f3717957c9ad62fcd144fc34444431fa77716f698ff5c5c26bd9aeb0256210573a059c5b8393951b2dacb6e41e760d80857d9717fc80f5da1d2116
|
7
|
+
data.tar.gz: 1c234170d621da60ad1b71b79d2eb3e85a434d72be7fe51c1cb88ea99bde8c11df3e9c5ac8d6a0371a27e28e344466330e44bc5c2fb37523818d69416b82ccaf
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/timify.svg)](https://rubygems.org/gems/timify)
|
4
4
|
|
5
|
-
|
5
|
+
Easily calculates the time running (elapsed time) from one location to another inside your code and reports statistics. It helps you improve your code and find out which part of your code is consuming more time.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -44,7 +44,7 @@ The scopes of the instances can be even global so you can measure the elapsed ti
|
|
44
44
|
|
45
45
|
### add
|
46
46
|
|
47
|
-
Adds a new point to count the time
|
47
|
+
Adds a new point to count the elapsed time. It will count from the last 'add' call or Timify creation in case of the first 'add'.
|
48
48
|
|
49
49
|
You can supply a label that will summarize all the ones with the same label
|
50
50
|
|
@@ -59,7 +59,7 @@ t.add
|
|
59
59
|
#some processes
|
60
60
|
t.add
|
61
61
|
#some processes
|
62
|
-
send_email_alert if t.add > 0.2
|
62
|
+
send_email_alert(t.totals[:message]) if t.add > 0.2
|
63
63
|
#some processes
|
64
64
|
do_log(t.totals[:message]) if t.add > 0.5
|
65
65
|
```
|
@@ -72,29 +72,29 @@ In case json parameter supplied as true, the output will be in json format inste
|
|
72
72
|
|
73
73
|
The output hash contains:
|
74
74
|
|
75
|
-
|
75
|
+
name: (String) name given for this instance'
|
76
76
|
|
77
|
-
|
77
|
+
total_time: (float) total elapsed time from initialization to last 'add' call
|
78
78
|
|
79
|
-
|
79
|
+
started: (Time)
|
80
80
|
|
81
|
-
|
81
|
+
finished: (Time)
|
82
82
|
|
83
|
-
|
83
|
+
message: (String) a printable friendly message giving all information
|
84
84
|
|
85
|
-
|
85
|
+
locations, labels, ranges: (Hash) the resultant hash contains:
|
86
86
|
|
87
|
-
|
87
|
+
secs: (float) number of seconds
|
88
88
|
|
89
|
-
|
89
|
+
percent: (integer) percentage in reference to the total time
|
90
90
|
|
91
|
-
|
91
|
+
count: (integer) number of times
|
92
92
|
|
93
|
-
|
93
|
+
locations: (Hash) All summary data by location where was called
|
94
94
|
|
95
|
-
|
95
|
+
labels: (Hash) All summary data by label given on 'add' method
|
96
96
|
|
97
|
-
|
97
|
+
ranges: (Hash) All summary data by ranges where was called, from last 'add' call to current 'add' call
|
98
98
|
|
99
99
|
|
100
100
|
Example of output:
|
data/lib/timify.rb
CHANGED
@@ -114,7 +114,7 @@ class Timify
|
|
114
114
|
# json: (boolean) in case of true the output will be in json format instead of a hash
|
115
115
|
#
|
116
116
|
# output: (Hash or json string)
|
117
|
-
# name: (String) name given for this instance
|
117
|
+
# name: (String) name given for this instance
|
118
118
|
# total_time: (float) total elapsed time from initialization to last 'add' call
|
119
119
|
# started: (Time)
|
120
120
|
# finished: (Time)
|
metadata
CHANGED
@@ -1,17 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mario Ruiz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
14
|
-
code and reports
|
13
|
+
description: Easily calculates the time running (elapsed time) from one location to
|
14
|
+
another inside your code and reports statistics. It helps you improve your code
|
15
|
+
and find out which part of your code is consuming more time.
|
15
16
|
email: marioruizs@gmail.com
|
16
17
|
executables: []
|
17
18
|
extensions: []
|
@@ -45,5 +46,6 @@ rubyforge_project:
|
|
45
46
|
rubygems_version: 2.6.11
|
46
47
|
signing_key:
|
47
48
|
specification_version: 4
|
48
|
-
summary:
|
49
|
+
summary: Easily calculates the time running (elapsed time) from one location to another
|
50
|
+
inside your code and reports statistics.
|
49
51
|
test_files: []
|