mnemonic 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/Gemfile.lock +6 -1
- data/examples/gc_stat.rb +1 -0
- data/examples/instances.rb +1 -0
- data/examples/logger.rb +1 -0
- data/examples/rss.rb +4 -1
- data/examples/to_csv.rb +2 -0
- data/examples/to_json.rb +2 -0
- data/lib/mnemonic.rb +16 -6
- data/lib/mnemonic/metric.rb +11 -14
- data/lib/mnemonic/metric/time_seconds.rb +1 -1
- data/lib/mnemonic/version.rb +1 -1
- data/mnemonic.gemspec +1 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05c96cf2563c4bb6470e8456bf26f8551561c371
|
4
|
+
data.tar.gz: eb4dbd185ffe57ee89820105ec63534ad99658e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60f9dd6f2e9c16cdfd07864fe431a730ce186794c7e9dbcf4569a993ffa435d299000ac4787f87b6a2f556236751b3dd0b75db770cc3c8433351e7009294b276
|
7
|
+
data.tar.gz: d4e2835169d602649d36d4f73635c86d10a50ba539e08b2f4c42b46ef6e02847773015423fa441e81b54b9d62dd23fa5e7793d42f430e52a6e87e63e42e7aeb0
|
data/Gemfile.lock
CHANGED
@@ -6,6 +6,7 @@ PATH
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
+
byebug (9.0.6)
|
9
10
|
coderay (1.1.0)
|
10
11
|
diff-lcs (1.2.5)
|
11
12
|
method_source (0.8.2)
|
@@ -13,6 +14,9 @@ GEM
|
|
13
14
|
coderay (~> 1.1.0)
|
14
15
|
method_source (~> 0.8.1)
|
15
16
|
slop (~> 3.4)
|
17
|
+
pry-byebug (3.4.0)
|
18
|
+
byebug (~> 9.0)
|
19
|
+
pry (~> 0.10)
|
16
20
|
rake (10.4.2)
|
17
21
|
rspec (3.4.0)
|
18
22
|
rspec-core (~> 3.4.0)
|
@@ -36,8 +40,9 @@ DEPENDENCIES
|
|
36
40
|
bundler (~> 1.10)
|
37
41
|
mnemonic!
|
38
42
|
pry
|
43
|
+
pry-byebug
|
39
44
|
rake (~> 10.0)
|
40
45
|
rspec
|
41
46
|
|
42
47
|
BUNDLED WITH
|
43
|
-
1.
|
48
|
+
1.12.2
|
data/examples/gc_stat.rb
CHANGED
data/examples/instances.rb
CHANGED
data/examples/logger.rb
CHANGED
data/examples/rss.rb
CHANGED
@@ -1,12 +1,15 @@
|
|
1
|
+
require 'mnemonic'
|
2
|
+
|
1
3
|
mnemonic = Mnemonic.new do |config|
|
2
4
|
config.rss
|
5
|
+
config.gc_stat :minor_gc_count, :major_gc_count
|
3
6
|
end
|
4
7
|
|
5
8
|
mnemonic.attach_pretty(STDOUT)
|
6
9
|
|
7
10
|
# 5 major GCs!
|
8
11
|
10.times do |i|
|
9
|
-
'!' *
|
12
|
+
'!' * 100_000_000
|
10
13
|
mnemonic.trigger!
|
11
14
|
end
|
12
15
|
|
data/examples/to_csv.rb
CHANGED
data/examples/to_json.rb
CHANGED
data/lib/mnemonic.rb
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
require 'objspace'
|
2
2
|
require 'monitor.rb'
|
3
3
|
require 'set'
|
4
|
+
require 'mnemonic/version'
|
5
|
+
require 'mnemonic/config'
|
6
|
+
require 'mnemonic/metric'
|
7
|
+
require 'mnemonic/sink'
|
8
|
+
require 'mnemonic/util'
|
4
9
|
|
5
10
|
class Mnemonic
|
6
|
-
require 'mnemonic/version'
|
7
|
-
require 'mnemonic/config'
|
8
|
-
require 'mnemonic/metric'
|
9
|
-
require 'mnemonic/sink'
|
10
|
-
require 'mnemonic/util'
|
11
11
|
|
12
12
|
include MonitorMixin
|
13
13
|
|
14
|
-
attr_reader :root_metrics, :metrics, :metric_names
|
14
|
+
attr_reader :root_metrics, :metrics, :metric_names, :enabled
|
15
15
|
|
16
16
|
def initialize
|
17
17
|
super
|
@@ -29,15 +29,25 @@ class Mnemonic
|
|
29
29
|
@root_metrics.each(&:start!)
|
30
30
|
@metric_names = @metrics.map(&:name)
|
31
31
|
@sinks = Set.new
|
32
|
+
@enabled = true
|
32
33
|
end
|
33
34
|
|
34
35
|
def trigger!(extra = nil)
|
36
|
+
return unless enabled
|
35
37
|
synchronize do
|
36
38
|
@root_metrics.each(&:refresh!)
|
37
39
|
@sinks.each { |s| s.drop!(extra) }
|
38
40
|
end
|
39
41
|
end
|
40
42
|
|
43
|
+
def disable!
|
44
|
+
@enabled = false
|
45
|
+
end
|
46
|
+
|
47
|
+
def enable!
|
48
|
+
@enabled = true
|
49
|
+
end
|
50
|
+
|
41
51
|
def attach_csv(*args)
|
42
52
|
attach(Sink::CSV, *args)
|
43
53
|
end
|
data/lib/mnemonic/metric.rb
CHANGED
@@ -1,14 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
require 'mnemonic/metric/instances_size'
|
13
|
-
end
|
14
|
-
end
|
1
|
+
require 'mnemonic/metric/base'
|
2
|
+
require 'mnemonic/metric/hash_metric'
|
3
|
+
require 'mnemonic/metric/rss'
|
4
|
+
require 'mnemonic/metric/time'
|
5
|
+
require 'mnemonic/metric/time_seconds'
|
6
|
+
require 'mnemonic/metric/time_milliseconds'
|
7
|
+
require 'mnemonic/metric/gc_stat'
|
8
|
+
require 'mnemonic/metric/objects_count'
|
9
|
+
require 'mnemonic/metric/objects_size'
|
10
|
+
require 'mnemonic/metric/instances_count'
|
11
|
+
require 'mnemonic/metric/instances_size'
|
data/lib/mnemonic/version.rb
CHANGED
data/mnemonic.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mnemonic
|
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
|
- Vladimir Kochnev
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-11-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -67,6 +67,20 @@ dependencies:
|
|
67
67
|
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: pry-byebug
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
70
84
|
description: The best tool to find leakage
|
71
85
|
email:
|
72
86
|
- hashtable@yandex.ru
|
@@ -134,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
148
|
version: '0'
|
135
149
|
requirements: []
|
136
150
|
rubyforge_project:
|
137
|
-
rubygems_version: 2.
|
151
|
+
rubygems_version: 2.5.1
|
138
152
|
signing_key:
|
139
153
|
specification_version: 4
|
140
154
|
summary: The best tool to find leakage
|