mnemonic 0.1.0 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile.lock +28 -25
- 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/metric/time_seconds.rb +1 -1
- data/lib/mnemonic/metric.rb +11 -14
- data/lib/mnemonic/version.rb +1 -1
- data/lib/mnemonic.rb +22 -8
- data/mnemonic.gemspec +3 -2
- metadata +24 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8d185148f6edff635b10edfbc6ba38f77fcecb5a54f5096311c0db1d52cbb682
|
4
|
+
data.tar.gz: 9bf069d892ba9f7de2de9c4a6aac500d3f3c90ba398c4ff5e413f7de530e886c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a7ffb0ea3f4b1ca65cd30d620dbdc15c020d08a7840182bc735400bb365e3ee091301968b9109ec4ed18db144b952526a70545b1f6b7dcfde88d24fd740cb6b
|
7
|
+
data.tar.gz: 2a28bd3fbf53efc35d1a5abd11d1241e01ef1feaa4c991eeded8b39b19aee42f7254ba4eaea54a53572c51490a4a0d09f65c69133c17a4d4197e6b13664da213
|
data/Gemfile.lock
CHANGED
@@ -1,43 +1,46 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
mnemonic (0.1.
|
4
|
+
mnemonic (0.1.2)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
rspec-
|
23
|
-
|
9
|
+
byebug (11.1.3)
|
10
|
+
coderay (1.1.3)
|
11
|
+
diff-lcs (1.5.0)
|
12
|
+
method_source (1.0.0)
|
13
|
+
pry (0.13.1)
|
14
|
+
coderay (~> 1.1)
|
15
|
+
method_source (~> 1.0)
|
16
|
+
pry-byebug (3.9.0)
|
17
|
+
byebug (~> 11.0)
|
18
|
+
pry (~> 0.13.0)
|
19
|
+
rake (13.0.6)
|
20
|
+
rspec (3.11.0)
|
21
|
+
rspec-core (~> 3.11.0)
|
22
|
+
rspec-expectations (~> 3.11.0)
|
23
|
+
rspec-mocks (~> 3.11.0)
|
24
|
+
rspec-core (3.11.0)
|
25
|
+
rspec-support (~> 3.11.0)
|
26
|
+
rspec-expectations (3.11.0)
|
24
27
|
diff-lcs (>= 1.2.0, < 2.0)
|
25
|
-
rspec-support (~> 3.
|
26
|
-
rspec-mocks (3.
|
28
|
+
rspec-support (~> 3.11.0)
|
29
|
+
rspec-mocks (3.11.1)
|
27
30
|
diff-lcs (>= 1.2.0, < 2.0)
|
28
|
-
rspec-support (~> 3.
|
29
|
-
rspec-support (3.
|
30
|
-
slop (3.6.0)
|
31
|
+
rspec-support (~> 3.11.0)
|
32
|
+
rspec-support (3.11.0)
|
31
33
|
|
32
34
|
PLATFORMS
|
33
|
-
|
35
|
+
x86_64-linux
|
34
36
|
|
35
37
|
DEPENDENCIES
|
36
|
-
bundler (~>
|
38
|
+
bundler (~> 2.3)
|
37
39
|
mnemonic!
|
38
40
|
pry
|
39
|
-
|
41
|
+
pry-byebug
|
42
|
+
rake (~> 13.0)
|
40
43
|
rspec
|
41
44
|
|
42
45
|
BUNDLED WITH
|
43
|
-
|
46
|
+
2.3.15
|
data/examples/gc_stat.rb
CHANGED
data/examples/instances.rb
CHANGED
data/examples/logger.rb
CHANGED
data/examples/rss.rb
CHANGED
data/examples/to_csv.rb
CHANGED
data/examples/to_json.rb
CHANGED
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/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
|
@@ -19,8 +19,12 @@ class Mnemonic
|
|
19
19
|
yield config
|
20
20
|
|
21
21
|
@root_metrics = config.metrics.map do |metric|
|
22
|
-
|
23
|
-
|
22
|
+
begin
|
23
|
+
metric.klass.new(*metric.args)
|
24
|
+
rescue => e
|
25
|
+
puts e
|
26
|
+
end
|
27
|
+
end.compact
|
24
28
|
|
25
29
|
@metrics = @root_metrics.flat_map do |metric|
|
26
30
|
metric.to_enum(:each_submetric).to_a
|
@@ -29,15 +33,25 @@ class Mnemonic
|
|
29
33
|
@root_metrics.each(&:start!)
|
30
34
|
@metric_names = @metrics.map(&:name)
|
31
35
|
@sinks = Set.new
|
36
|
+
@enabled = true
|
32
37
|
end
|
33
38
|
|
34
39
|
def trigger!(extra = nil)
|
40
|
+
return unless enabled
|
35
41
|
synchronize do
|
36
42
|
@root_metrics.each(&:refresh!)
|
37
43
|
@sinks.each { |s| s.drop!(extra) }
|
38
44
|
end
|
39
45
|
end
|
40
46
|
|
47
|
+
def disable!
|
48
|
+
@enabled = false
|
49
|
+
end
|
50
|
+
|
51
|
+
def enable!
|
52
|
+
@enabled = true
|
53
|
+
end
|
54
|
+
|
41
55
|
def attach_csv(*args)
|
42
56
|
attach(Sink::CSV, *args)
|
43
57
|
end
|
data/mnemonic.gemspec
CHANGED
@@ -16,8 +16,9 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
17
|
spec.require_paths = ["lib"]
|
18
18
|
|
19
|
-
spec.add_development_dependency "bundler", "~>
|
20
|
-
spec.add_development_dependency "rake", "~>
|
19
|
+
spec.add_development_dependency "bundler", "~> 2.3"
|
20
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
21
21
|
spec.add_development_dependency "rspec"
|
22
22
|
spec.add_development_dependency "pry"
|
23
|
+
spec.add_development_dependency "pry-byebug"
|
23
24
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Kochnev
|
8
8
|
- Alexey Gaziev
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-06-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -17,28 +17,28 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '2.3'
|
21
21
|
type: :development
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '2.3'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rake
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '
|
34
|
+
version: '13.0'
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '
|
41
|
+
version: '13.0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rspec
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -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
|
@@ -118,7 +132,7 @@ files:
|
|
118
132
|
homepage: https://github.com/gazay/mnemonic
|
119
133
|
licenses: []
|
120
134
|
metadata: {}
|
121
|
-
post_install_message:
|
135
|
+
post_install_message:
|
122
136
|
rdoc_options: []
|
123
137
|
require_paths:
|
124
138
|
- lib
|
@@ -133,9 +147,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
147
|
- !ruby/object:Gem::Version
|
134
148
|
version: '0'
|
135
149
|
requirements: []
|
136
|
-
|
137
|
-
|
138
|
-
signing_key:
|
150
|
+
rubygems_version: 3.2.32
|
151
|
+
signing_key:
|
139
152
|
specification_version: 4
|
140
153
|
summary: The best tool to find leakage
|
141
154
|
test_files: []
|