graphiterb 0.2.12 → 0.2.13
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.
- data/VERSION +1 -1
- data/examples/system.rb +6 -0
- data/examples/toy.rb +1 -1
- data/graphiterb.gemspec +4 -2
- data/lib/graphiterb/accumulator.rb +2 -2
- data/lib/graphiterb/monitors/directory_tree.rb +3 -3
- data/lib/graphiterb/monitors/disk_space.rb +1 -1
- data/lib/graphiterb/monitors/system.rb +8 -8
- metadata +6 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.13
|
data/examples/system.rb
ADDED
data/examples/toy.rb
CHANGED
data/graphiterb.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{graphiterb}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.13"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Philip (flip) Kromer (@mrflip)"]
|
12
|
-
s.date = %q{2010-09-
|
12
|
+
s.date = %q{2010-09-29}
|
13
13
|
s.description = %q{Uses http://github.com/mrflip/configliere and http://graphite.wikidot.com}
|
14
14
|
s.email = %q{info@infochimps.org}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -24,6 +24,7 @@ Gem::Specification.new do |s|
|
|
24
24
|
"README.textile",
|
25
25
|
"Rakefile",
|
26
26
|
"VERSION",
|
27
|
+
"examples/system.rb",
|
27
28
|
"examples/toy.rb",
|
28
29
|
"graphiterb.gemspec",
|
29
30
|
"lib/graphiterb.rb",
|
@@ -50,6 +51,7 @@ Gem::Specification.new do |s|
|
|
50
51
|
s.test_files = [
|
51
52
|
"spec/graphiterb_spec.rb",
|
52
53
|
"spec/spec_helper.rb",
|
54
|
+
"examples/system.rb",
|
53
55
|
"examples/toy.rb"
|
54
56
|
]
|
55
57
|
|
@@ -11,7 +11,7 @@ module Graphiterb
|
|
11
11
|
#
|
12
12
|
# By default incrementing 'my_value' which actually increment a
|
13
13
|
# counter stored at the key
|
14
|
-
# 'graphiterb_accumulator:my_value:
|
14
|
+
# 'graphiterb_accumulator:my_value:GRAPHITE_IDENTIFIER'.
|
15
15
|
#
|
16
16
|
# See Graphiterb::Monitors::AccumulationsConsumer for the periodic
|
17
17
|
# monitor that will consume the accumulated counts.
|
@@ -87,7 +87,7 @@ module Graphiterb
|
|
87
87
|
# @param [Array<String>, String] args
|
88
88
|
# @return [String]
|
89
89
|
def scope *args
|
90
|
-
[main_scope, args,
|
90
|
+
[main_scope, args, graphite_identifier].flatten.compact.map(&:to_s).join('.')
|
91
91
|
end
|
92
92
|
|
93
93
|
end
|
@@ -27,9 +27,9 @@ module Graphiterb
|
|
27
27
|
def get_metrics metrics, since
|
28
28
|
recent = Directory.recency_filter
|
29
29
|
dirs.each do |dir|
|
30
|
-
metrics << [scope(dir.name, 'num_files',
|
31
|
-
metrics << [scope(dir.name, 'size',
|
32
|
-
metrics << [scope(dir.name, 'lines',
|
30
|
+
metrics << [scope(dir.name, 'num_files', graphite_identifier), dir.num_files(&recent) ]
|
31
|
+
metrics << [scope(dir.name, 'size', graphite_identifier), dir.size(&recent) ]
|
32
|
+
metrics << [scope(dir.name, 'lines', graphite_identifier), dir.line_counts(&recent) ]
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
@@ -21,7 +21,7 @@ module Graphiterb
|
|
21
21
|
# "/dev/sdb1", "39373712", "20488716", "16884908", "55%", "/"
|
22
22
|
df.each do |handle, size, spaceused, spacefree, percentfree, location|
|
23
23
|
disk_name = handle.gsub(/^\//, '').split('/')
|
24
|
-
metrics << [scope(
|
24
|
+
metrics << [scope(graphite_identifier, disk_name, 'available'), spacefree.to_i]
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
@@ -57,24 +57,24 @@ module Graphiterb
|
|
57
57
|
df.each do |handle, size, spaceused, spacefree, percentused, location|
|
58
58
|
disk_name = handle.gsub(/^\//, '').split('/')
|
59
59
|
percent_free = (100.0 * spacefree.to_f / (spaceused.to_f + spacefree.to_f)) rescue 0.0
|
60
|
-
metrics << [scope(
|
60
|
+
metrics << [scope(graphite_identifier, disk_name, 'available'), percent_free]
|
61
61
|
end
|
62
62
|
|
63
63
|
lines = top
|
64
64
|
|
65
|
-
metrics << [scope(
|
65
|
+
metrics << [scope(graphite_identifier, 'cpu', 'avg_usage'), cpu(lines)]
|
66
66
|
|
67
67
|
proc_total, proc_running = processes(lines)
|
68
|
-
metrics << [scope(
|
69
|
-
metrics << [scope(
|
68
|
+
metrics << [scope(graphite_identifier, 'processes', 'total'), proc_total ]
|
69
|
+
metrics << [scope(graphite_identifier, 'processes', 'running'), proc_running ]
|
70
70
|
|
71
71
|
mem_used, mem_free = memory(lines)
|
72
72
|
swap_used, swap_free = swap(lines)
|
73
73
|
|
74
|
-
metrics << [scope(
|
75
|
-
metrics << [scope(
|
76
|
-
metrics << [scope(
|
77
|
-
metrics << [scope(
|
74
|
+
metrics << [scope(graphite_identifier, 'memory', 'used'), mem_used ]
|
75
|
+
metrics << [scope(graphite_identifier, 'memory', 'free'), mem_free ]
|
76
|
+
metrics << [scope(graphite_identifier, 'swap', 'used'), swap_used ]
|
77
|
+
metrics << [scope(graphite_identifier, 'swap', 'free'), swap_free ]
|
78
78
|
end
|
79
79
|
|
80
80
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphiterb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 13
|
10
|
+
version: 0.2.13
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Philip (flip) Kromer (@mrflip)
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-09-
|
18
|
+
date: 2010-09-29 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -79,6 +79,7 @@ files:
|
|
79
79
|
- README.textile
|
80
80
|
- Rakefile
|
81
81
|
- VERSION
|
82
|
+
- examples/system.rb
|
82
83
|
- examples/toy.rb
|
83
84
|
- graphiterb.gemspec
|
84
85
|
- lib/graphiterb.rb
|
@@ -133,4 +134,5 @@ summary: Fast Ubiquitous Dashboard Logs with Graphite (http://graphite.wikidot.c
|
|
133
134
|
test_files:
|
134
135
|
- spec/graphiterb_spec.rb
|
135
136
|
- spec/spec_helper.rb
|
137
|
+
- examples/system.rb
|
136
138
|
- examples/toy.rb
|