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 CHANGED
@@ -1 +1 @@
1
- 0.2.12
1
+ 0.2.13
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ require 'rubygems'
3
+ require 'graphiterb/script'
4
+ Configliere.use :commandline, :config_file
5
+ Settings.resolve!
6
+ Graphiterb::Monitors::System.new('system', :iters => 5, :time => 5).run! if $0 == __FILE__
@@ -11,4 +11,4 @@ class ToyMonitor < Graphiterb::Monitors::PeriodicMonitor
11
11
  end
12
12
  end
13
13
 
14
- ToyMonitor.new('toy').run! if $0 == __FILE__
14
+ ToyMonitor.new('toy', :iters => 5, :time => 5).run! if $0 == __FILE__
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{graphiterb}
8
- s.version = "0.2.12"
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-28}
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:HOSTNAME'.
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, hostname].flatten.compact.map(&:to_s).join('.')
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', hostname), dir.num_files(&recent) ]
31
- metrics << [scope(dir.name, 'size', hostname), dir.size(&recent) ]
32
- metrics << [scope(dir.name, 'lines', hostname), dir.line_counts(&recent) ]
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(hostname, disk_name, 'available'), spacefree.to_i]
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(hostname, disk_name, 'available'), percent_free]
60
+ metrics << [scope(graphite_identifier, disk_name, 'available'), percent_free]
61
61
  end
62
62
 
63
63
  lines = top
64
64
 
65
- metrics << [scope(hostname, 'cpu', 'avg_usage'), cpu(lines)]
65
+ metrics << [scope(graphite_identifier, 'cpu', 'avg_usage'), cpu(lines)]
66
66
 
67
67
  proc_total, proc_running = processes(lines)
68
- metrics << [scope(hostname, 'processes', 'total'), proc_total ]
69
- metrics << [scope(hostname, 'processes', 'running'), proc_running ]
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(hostname, 'memory', 'used'), mem_used ]
75
- metrics << [scope(hostname, 'memory', 'free'), mem_free ]
76
- metrics << [scope(hostname, 'swap', 'used'), swap_used ]
77
- metrics << [scope(hostname, 'swap', 'free'), swap_free ]
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: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 12
10
- version: 0.2.12
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-28 00:00:00 -05:00
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