graphiterb 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +35 -0
- data/VERSION +1 -1
- data/bin/api_call_monitor.rb +55 -0
- data/bin/file_monitor.rb +113 -0
- data/bin/{example-client.rb → loadavg_graphite_sender.rb} +9 -4
- data/bin/run_servers.sh +2 -0
- data/bin/storage_monitor.rb +23 -0
- data/bin/toy.rb +26 -0
- data/graphiterb.gemspec +18 -11
- data/lib/graphiterb/graphite_logger.rb +42 -0
- data/lib/graphiterb/graphite_script.rb +9 -0
- data/lib/graphiterb/graphite_sender.rb +10 -8
- data/lib/graphiterb/graphite_system_logger.rb +5 -0
- data/lib/graphiterb.rb +6 -2
- metadata +32 -10
- data/README.rdoc +0 -17
data/README.textile
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
= graphiterb
|
2
|
+
|
3
|
+
Fast, Ubiquitous dashboard logging with Graphite.
|
4
|
+
|
5
|
+
<pre>
|
6
|
+
# in initialize, perhaps
|
7
|
+
self.sender = Graphiterb::GraphiteSender
|
8
|
+
|
9
|
+
# ... somewhere else ...
|
10
|
+
sender.send( ['webserver.pages', pages_this_hour], ['webserver.errors', errors_this_hour] )
|
11
|
+
</pre>
|
12
|
+
|
13
|
+
... and also see the examples, like bin/loadavg_graphite_sender.rb
|
14
|
+
|
15
|
+
Uses:
|
16
|
+
* "Graphite":http://graphite.wikidot.com
|
17
|
+
|
18
|
+
Depends on:
|
19
|
+
* "Configliere":http://github.com/mrflip/configliere
|
20
|
+
|
21
|
+
h2. Other
|
22
|
+
|
23
|
+
h3. Note on Patches/Pull Requests
|
24
|
+
|
25
|
+
* Fork the project.
|
26
|
+
* Make your feature addition or bug fix.
|
27
|
+
* Add tests for it. This is important so I don't break it in a
|
28
|
+
future version unintentionally.
|
29
|
+
* Commit, do not mess with rakefile, version, or history.
|
30
|
+
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
31
|
+
* Send me a pull request. Bonus points for topic branches.
|
32
|
+
|
33
|
+
h3. Copyright
|
34
|
+
|
35
|
+
Copyright (c) 2010 Infochimps (@infochimps). See LICENSE for details.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0
|
1
|
+
0.1.0
|
@@ -0,0 +1,55 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
$: << File.dirname(__FILE__)+'/../lib/'
|
3
|
+
require 'graphite'
|
4
|
+
require 'graphite/graphite_script'
|
5
|
+
|
6
|
+
WC_EXEC = '/usr/bin/wc'
|
7
|
+
|
8
|
+
class ApiCallMonitor < Graphiterb::GraphiteLogger
|
9
|
+
API_CALLS_TO_MONITOR = %w(trstrank wordbag influence conversation)
|
10
|
+
ERROR_CODES_TO_MONITOR = %w(4.. 5..)
|
11
|
+
|
12
|
+
def initialize *args
|
13
|
+
super *args
|
14
|
+
@current_total = Hash.new
|
15
|
+
@prev_total = Hash.new
|
16
|
+
end
|
17
|
+
|
18
|
+
def calls api
|
19
|
+
total_calls = `cat /var/www/apeyeye/shared/log/apeyeye-access.log | grep 'GET /soc/net/tw/#{api}' | #{WC_EXEC} -l`
|
20
|
+
@current_total[api] = total_calls
|
21
|
+
end
|
22
|
+
|
23
|
+
def errors error_code
|
24
|
+
log_cat = `cat /var/www/apeyeye/shared/log/apeyeye-access.log | grep 'GET /soc/net/tw/.*HTTP/1\.[0-1]..#{error_code}' | #{WC_EXEC} -l`
|
25
|
+
@current_total[error_code] = log_cat
|
26
|
+
end
|
27
|
+
|
28
|
+
def rate item
|
29
|
+
@prev_total[item] ||= @current_total[item]
|
30
|
+
rate = @current_total[item].to_i - @prev_total[item].to_i
|
31
|
+
@prev_total[item] = @current_total[item]
|
32
|
+
[0, rate].max
|
33
|
+
end
|
34
|
+
|
35
|
+
def hostname
|
36
|
+
@hostname ||= `hostname`.chomp.gsub(".","_")
|
37
|
+
end
|
38
|
+
|
39
|
+
def get_metrics metrics, iter, since
|
40
|
+
API_CALLS_TO_MONITOR.each do |api|
|
41
|
+
calls(api)
|
42
|
+
metrics << [scope_name(hostname, api, 'accesses'), rate(api)]
|
43
|
+
end
|
44
|
+
ERROR_CODES_TO_MONITOR.each do |code|
|
45
|
+
errors(code)
|
46
|
+
metrics << [scope_name(hostname, code.gsub('.','x'), 'errors'), rate(code)]
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
|
52
|
+
warn "Update delay is #{Settings.update_delay} seconds. You probably want something larger: some of these checks are data-intensive" if Settings.update_delay < 60
|
53
|
+
Settings.die "Update delay is #{Settings.update_delay} seconds. You need to radio in at least as often as /usr/local/share/graphite/conf/storage-schemas says -- this is typically 5 minutes." if Settings.update_delay >= 300
|
54
|
+
|
55
|
+
ApiCallMonitor.new('apeyeye', :iters => nil, :time => Settings.update_delay).run!
|
data/bin/file_monitor.rb
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
$: << File.dirname(__FILE__)+'/../lib/'
|
3
|
+
require 'graphite'
|
4
|
+
Settings.define :work_dir, :description => "Base directory where scrapers store files. (Ex: /data/ripd/com.tw)", :required => true
|
5
|
+
require 'graphite/graphite_script'
|
6
|
+
|
7
|
+
#
|
8
|
+
# Usage:
|
9
|
+
#
|
10
|
+
# nohup ~/ics/backend/graphiterb/bin/file_monitor.rb --work_dir=/data/ripd/com.tw --carbon_server=whatever --update_delay=120 > /data/log/file_monitor.log 2>&1 &
|
11
|
+
#
|
12
|
+
|
13
|
+
WC_EXEC = '/usr/bin/wc'
|
14
|
+
|
15
|
+
class FilePool
|
16
|
+
# Path to sample for files
|
17
|
+
attr_accessor :path
|
18
|
+
# wildcard sequence for files under the current directory
|
19
|
+
attr_accessor :filter_re
|
20
|
+
# A recent file was modified within this window
|
21
|
+
attr_accessor :recent_window
|
22
|
+
# Only consider the last this-many files
|
23
|
+
MAX_FILES = 30
|
24
|
+
|
25
|
+
def initialize path, filter_re=/.*/, options={}
|
26
|
+
self.path = path
|
27
|
+
self.filter_re = filter_re
|
28
|
+
end
|
29
|
+
|
30
|
+
# Name for this pool, suitable for inclusion in a metrics handle
|
31
|
+
def name
|
32
|
+
path.gsub(/\./,'_').gsub(%r{/}, '.').gsub(%r{(^\.|\.$)},'')
|
33
|
+
end
|
34
|
+
|
35
|
+
#
|
36
|
+
# Lists all files in the pool
|
37
|
+
# @param filter_block files only keeps filenames that pass this filter
|
38
|
+
#
|
39
|
+
def files &filter_block
|
40
|
+
Dir[File.join(path, '**/*')].
|
41
|
+
reject{|f| File.directory?(f) }.
|
42
|
+
select{|f| f =~ filter_re }.
|
43
|
+
sort.reverse[0..MAX_FILES].
|
44
|
+
select(&filter_block)
|
45
|
+
end
|
46
|
+
|
47
|
+
def num_files &filter_block
|
48
|
+
files(&filter_block).count
|
49
|
+
end
|
50
|
+
|
51
|
+
def sizes &filter_block
|
52
|
+
files(&filter_block).map{|f| File.size(f) rescue nil }.compact
|
53
|
+
end
|
54
|
+
def size &filter_block
|
55
|
+
sizes(&filter_block).sum
|
56
|
+
end
|
57
|
+
def avg_size &filter_block
|
58
|
+
sizes(&filter_block).sum.to_f / num_files(&filter_block).to_f
|
59
|
+
end
|
60
|
+
|
61
|
+
def lines_in_result_of command, *args
|
62
|
+
begin
|
63
|
+
escaped_args = args.map{|f| "'#{f}'" }
|
64
|
+
result = `#{command} #{escaped_args.join(" ")}`.chomp
|
65
|
+
result.split(/[\r\n]+/)
|
66
|
+
rescue StandardError => e ; warn(e.backtrace, e) ; return nil ; end
|
67
|
+
end
|
68
|
+
|
69
|
+
def line_counts &filter_block
|
70
|
+
files = files(&filter_block) ; return 0 if files.blank?
|
71
|
+
result = lines_in_result_of(WC_EXEC, '-l', *files) or return 0
|
72
|
+
counts = result.map{|wc| wc =~ /^\s*(\d+)\s+/ and $1 }.compact
|
73
|
+
counts.map(&:to_i).sum
|
74
|
+
end
|
75
|
+
|
76
|
+
def self.recent? file
|
77
|
+
(Time.now - File.mtime(file)) < 1.hour
|
78
|
+
end
|
79
|
+
def self.recency_filter
|
80
|
+
Proc.new{|file| recent?(file) }
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
class FileMonitor < Graphiterb::GraphiteSystemLogger
|
85
|
+
attr_accessor :path
|
86
|
+
attr_accessor :pools
|
87
|
+
|
88
|
+
def initialize *args
|
89
|
+
super *args
|
90
|
+
self.path = Settings.work_dir
|
91
|
+
self.pools = {}
|
92
|
+
populate_pools!
|
93
|
+
end
|
94
|
+
|
95
|
+
def populate_pools!
|
96
|
+
Dir[File.join(path, '*')].select{|d| File.directory?(d) }.each do |dir|
|
97
|
+
self.pools[dir] ||= FilePool.new(dir, %r{20\d*/.*\.(?:tsv|json|xml)})
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
def get_metrics metrics, iter, since
|
102
|
+
recent = FilePool.recency_filter
|
103
|
+
pools.each do |pool_path, pool|
|
104
|
+
metrics << [scope_name(pool.name, hostname, 'active_files'), pool.num_files(&recent) ]
|
105
|
+
metrics << [scope_name(pool.name, hostname, 'active_file_size'), pool.size(&recent) ]
|
106
|
+
metrics << [scope_name(pool.name, hostname, 'line_counts'), pool.line_counts(&recent) ]
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
warn "Update delay is #{Settings.update_delay} seconds. You probably want something larger: some of the metrics are expensive." if Settings.update_delay < 60
|
112
|
+
warn "Update delay is #{Settings.update_delay} seconds. You probably want something smaller: need to report in faster than the value in the graphite/conf/storage-schemas." if Settings.update_delay >= 300
|
113
|
+
FileMonitor.new('scraper', :iters => nil, :time => Settings.update_delay).run!
|
@@ -8,14 +8,19 @@ Settings.read 'graphite.yaml'
|
|
8
8
|
Settings.resolve!
|
9
9
|
Log = Logger.new($stderr) unless defined?(Log)
|
10
10
|
|
11
|
-
class LoadavgGraphiteSender <
|
11
|
+
class LoadavgGraphiteSender < Graphiterb::GraphiteSender
|
12
|
+
def hostname
|
13
|
+
@hostname ||= `hostname`.chomp
|
14
|
+
end
|
15
|
+
|
12
16
|
def loadavgs
|
13
|
-
File.open('/proc/loadavg').read.strip.split[0..2]
|
17
|
+
# File.open('/proc/loadavg').read.strip.split[0..2]
|
18
|
+
`uptime`.chomp.gsub(/.*:\s+/, '').split(/[,\s]+/)
|
14
19
|
end
|
15
20
|
|
16
|
-
def loadavgs_metrics
|
21
|
+
def loadavgs_metrics
|
17
22
|
%w[1min 5min 15min].zip(loadavgs).map do |duration, avg|
|
18
|
-
["
|
23
|
+
["system.#{hostname}.loadavg_#{duration}", avg]
|
19
24
|
end
|
20
25
|
end
|
21
26
|
|
data/bin/run_servers.sh
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
$: << File.dirname(__FILE__)+'/../lib/'
|
3
|
+
require 'rubygems'
|
4
|
+
require 'graphiterb/graphite_script'
|
5
|
+
|
6
|
+
class AvailSpaceMonitor < Graphiterb::GraphiteLogger
|
7
|
+
def diskfree
|
8
|
+
`/bin/df`.chomp.split("\n").
|
9
|
+
grep(%r{^/dev/}).
|
10
|
+
map{|line| line.split(/\s+/) } rescue []
|
11
|
+
end
|
12
|
+
|
13
|
+
def get_metrics metrics, iter, since
|
14
|
+
diskfree.each do |handle, size, spaceused, spacefree, percentfree, location|
|
15
|
+
metrics << ["system.#{hostname}#{handle.gsub(/\//,'.')}.available", spacefree.to_i]
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
warn "Update delay is #{Settings.update_delay} seconds. You probably want something larger: some of the metrics are expensive." if Settings.update_delay < 30
|
21
|
+
warn "Update delay is #{Settings.update_delay} seconds. You probably want something smaller: need to report in faster than the value in the graphite/conf/storage-schemas." if Settings.update_delay >= 60
|
22
|
+
|
23
|
+
AvailSpaceMonitor.new('system').run!
|
data/bin/toy.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'rubygems'
|
3
|
+
$: << File.dirname(__FILE__)+'/../lib'
|
4
|
+
require 'graphiterb'
|
5
|
+
Configliere.use :commandline, :config_file
|
6
|
+
|
7
|
+
Settings.read 'graphite.yaml'
|
8
|
+
Settings.resolve!
|
9
|
+
Log = Logger.new($stderr) unless defined?(Log)
|
10
|
+
|
11
|
+
monitor = Graphiterb::GraphiteLogger.new(:iters => nil, :time => 5)
|
12
|
+
|
13
|
+
handle = 'simple_toy'
|
14
|
+
|
15
|
+
loop do
|
16
|
+
monitor.periodically do |metrics, iter, since|
|
17
|
+
metrics << ["scraper.toy.#{handle}.iter", iter]
|
18
|
+
metrics << ["scraper.toy.#{handle}.iter", iter]
|
19
|
+
metrics << ["scraper.toy.#{handle}.iter", iter]
|
20
|
+
metrics << ["scraper.toy.#{handle}.iter", iter]
|
21
|
+
end
|
22
|
+
delay = 2
|
23
|
+
sleep delay
|
24
|
+
print delay.to_s+"\t"
|
25
|
+
end
|
26
|
+
|
data/graphiterb.gemspec
CHANGED
@@ -5,31 +5,38 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{graphiterb}
|
8
|
-
s.version = "0.0
|
8
|
+
s.version = "0.1.0"
|
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-
|
13
|
-
s.default_executable = %q{example-client.rb}
|
12
|
+
s.date = %q{2010-07-19}
|
14
13
|
s.description = %q{Uses http://github.com/mrflip/configliere and http://graphite.wikidot.com}
|
15
14
|
s.email = %q{info@infochimps.org}
|
16
|
-
s.executables = ["
|
15
|
+
s.executables = ["run_servers.sh", "storage_monitor.rb", "api_call_monitor.rb", "loadavg_graphite_sender.rb", "toy.rb", "file_monitor.rb"]
|
17
16
|
s.extra_rdoc_files = [
|
18
17
|
"LICENSE",
|
19
|
-
"README.
|
18
|
+
"README.textile"
|
20
19
|
]
|
21
20
|
s.files = [
|
22
21
|
".document",
|
23
22
|
".gitignore",
|
24
23
|
"CHANGELOG",
|
25
24
|
"LICENSE",
|
26
|
-
"README.
|
25
|
+
"README.textile",
|
27
26
|
"Rakefile",
|
28
27
|
"VERSION",
|
29
|
-
"bin/
|
28
|
+
"bin/api_call_monitor.rb",
|
29
|
+
"bin/file_monitor.rb",
|
30
|
+
"bin/loadavg_graphite_sender.rb",
|
31
|
+
"bin/run_servers.sh",
|
32
|
+
"bin/storage_monitor.rb",
|
33
|
+
"bin/toy.rb",
|
30
34
|
"graphiterb.gemspec",
|
31
35
|
"lib/graphiterb.rb",
|
36
|
+
"lib/graphiterb/graphite_logger.rb",
|
37
|
+
"lib/graphiterb/graphite_script.rb",
|
32
38
|
"lib/graphiterb/graphite_sender.rb",
|
39
|
+
"lib/graphiterb/graphite_system_logger.rb",
|
33
40
|
"spec/graphiterb_spec.rb",
|
34
41
|
"spec/spec.opts",
|
35
42
|
"spec/spec_helper.rb"
|
@@ -37,18 +44,18 @@ Gem::Specification.new do |s|
|
|
37
44
|
s.homepage = %q{http://github.com/mrflip/graphiterb}
|
38
45
|
s.rdoc_options = ["--charset=UTF-8"]
|
39
46
|
s.require_paths = ["lib"]
|
40
|
-
s.rubygems_version = %q{1.3.
|
47
|
+
s.rubygems_version = %q{1.3.7}
|
41
48
|
s.summary = %q{Fast Ubiquitous Dashboard Logs with Graphite (http://graphite.wikidot.com)}
|
42
49
|
s.test_files = [
|
43
|
-
"spec/
|
44
|
-
"spec/
|
50
|
+
"spec/graphiterb_spec.rb",
|
51
|
+
"spec/spec_helper.rb"
|
45
52
|
]
|
46
53
|
|
47
54
|
if s.respond_to? :specification_version then
|
48
55
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
49
56
|
s.specification_version = 3
|
50
57
|
|
51
|
-
if Gem::Version.new(Gem::
|
58
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
52
59
|
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
|
53
60
|
s.add_development_dependency(%q<yard>, [">= 0"])
|
54
61
|
else
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'monkeyshines/monitor'
|
2
|
+
|
3
|
+
module Graphiterb
|
4
|
+
class GraphiteLogger < Monkeyshines::Monitor::PeriodicMonitor
|
5
|
+
# Connection to graphite server
|
6
|
+
attr_reader :sender
|
7
|
+
# the leading segment for sent metrics -- eg 'scrapers' or 'api_calls'
|
8
|
+
attr_reader :main_scope
|
9
|
+
|
10
|
+
def initialize main_scope, *args
|
11
|
+
super *args
|
12
|
+
self.time_interval ||= Settings.update_delay
|
13
|
+
@sender = GraphiteSender.new
|
14
|
+
@main_scope = main_scope
|
15
|
+
end
|
16
|
+
|
17
|
+
def periodically &block
|
18
|
+
super do |iter, since|
|
19
|
+
metrics = []
|
20
|
+
block.call(metrics, iter, since)
|
21
|
+
sender.send *metrics
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def hostname
|
26
|
+
@host ||= `hostname`.chomp.gsub(".","_")
|
27
|
+
end
|
28
|
+
|
29
|
+
def scope_name *scope
|
30
|
+
[main_scope, scope].flatten.reject(&:blank?).join('.')
|
31
|
+
end
|
32
|
+
|
33
|
+
def run!
|
34
|
+
loop do
|
35
|
+
periodically do |metrics, iter, since|
|
36
|
+
get_metrics metrics, iter, since
|
37
|
+
end
|
38
|
+
sleep 1
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module Graphiterb
|
2
2
|
#
|
3
3
|
# @example:
|
4
4
|
# # in initialize, perhaps
|
@@ -8,28 +8,30 @@ module GraphiteRb
|
|
8
8
|
# sender.send( ['webserver.pages', pages_this_hour], ['webserver.errors', errors_this_hour] )
|
9
9
|
#
|
10
10
|
class GraphiteSender
|
11
|
-
attr_accessor :socket
|
12
|
-
|
13
11
|
def initialize
|
14
12
|
open!
|
15
13
|
end
|
16
14
|
|
17
15
|
def open!
|
18
16
|
begin
|
19
|
-
warn "Connecting to server #{Settings.carbon_server} port #{Settings.carbon_port}"
|
20
|
-
|
17
|
+
Log.warn "Connecting to server #{Settings.carbon_server} port #{Settings.carbon_port}"
|
18
|
+
@socket = TCPSocket.new(Settings.carbon_server, Settings.carbon_port)
|
21
19
|
rescue StandardError => e
|
22
20
|
Log.warn "Couldn't connect to server #{Settings.carbon_server} port #{Settings.carbon_port}: #{e.class} #{e}"
|
23
|
-
raise e
|
24
21
|
end
|
25
22
|
end
|
26
23
|
|
24
|
+
def socket
|
25
|
+
@socket ||= open!
|
26
|
+
end
|
27
|
+
|
27
28
|
def safely &block
|
28
29
|
begin
|
29
30
|
block.call
|
30
31
|
rescue StandardError => e
|
31
32
|
Log.warn "Sleeping #{Settings.on_error_delay}: #{e.class} #{e}"
|
32
33
|
sleep Settings.on_error_delay
|
34
|
+
@socket = nil
|
33
35
|
return nil
|
34
36
|
end
|
35
37
|
end
|
@@ -40,10 +42,10 @@ module GraphiteRb
|
|
40
42
|
|
41
43
|
def send *metrics
|
42
44
|
now = timestamp
|
43
|
-
message = metrics.map{|metric, val| [metric, val, now].join(" ") }.join("\n")
|
45
|
+
message = metrics.map{|metric, val, ts| [metric, val, (ts||now)].join(" ") }.join("\n")
|
44
46
|
safely do
|
45
47
|
socket.puts(message)
|
46
|
-
Log.
|
48
|
+
Log.info message.gsub(/\n+/, "\t")
|
47
49
|
end
|
48
50
|
end
|
49
51
|
end
|
data/lib/graphiterb.rb
CHANGED
@@ -5,7 +5,11 @@ require 'configliere'
|
|
5
5
|
Configliere.use :define
|
6
6
|
Settings.define :carbon_server, :default => 'localhost', :description => "Host address for carbon database server", :required => true
|
7
7
|
Settings.define :carbon_port, :default => '2003', :description => "Port for carbon database server", :required => true
|
8
|
-
Settings.define :update_delay, :default =>
|
9
|
-
Settings.define :on_error_delay, :default =>
|
8
|
+
Settings.define :update_delay, :default => 30, :description => "How long to wait between updates. Must be faster than the value in the graphite/conf/storage-schemas", :required => true, :type => Integer
|
9
|
+
Settings.define :on_error_delay, :default => 0.1, :description => "How long to wait on connect errors", :required => true, :type => Float
|
10
10
|
|
11
11
|
require 'graphiterb/graphite_sender'
|
12
|
+
module Graphiterb
|
13
|
+
autoload :GraphiteLogger, 'graphiterb/graphite_logger'
|
14
|
+
autoload :GraphiteSystemLogger, 'graphiterb/graphite_system_logger'
|
15
|
+
end
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphiterb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
|
-
- 0
|
8
8
|
- 1
|
9
|
-
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Philip (flip) Kromer (@mrflip)
|
@@ -14,16 +15,18 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-
|
18
|
-
default_executable:
|
18
|
+
date: 2010-07-19 00:00:00 +00:00
|
19
|
+
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: rspec
|
22
23
|
prerelease: false
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
24
26
|
requirements:
|
25
27
|
- - ">="
|
26
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 13
|
27
30
|
segments:
|
28
31
|
- 1
|
29
32
|
- 2
|
@@ -35,9 +38,11 @@ dependencies:
|
|
35
38
|
name: yard
|
36
39
|
prerelease: false
|
37
40
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
38
42
|
requirements:
|
39
43
|
- - ">="
|
40
44
|
- !ruby/object:Gem::Version
|
45
|
+
hash: 3
|
41
46
|
segments:
|
42
47
|
- 0
|
43
48
|
version: "0"
|
@@ -46,24 +51,37 @@ dependencies:
|
|
46
51
|
description: Uses http://github.com/mrflip/configliere and http://graphite.wikidot.com
|
47
52
|
email: info@infochimps.org
|
48
53
|
executables:
|
49
|
-
-
|
54
|
+
- run_servers.sh
|
55
|
+
- storage_monitor.rb
|
56
|
+
- api_call_monitor.rb
|
57
|
+
- loadavg_graphite_sender.rb
|
58
|
+
- toy.rb
|
59
|
+
- file_monitor.rb
|
50
60
|
extensions: []
|
51
61
|
|
52
62
|
extra_rdoc_files:
|
53
63
|
- LICENSE
|
54
|
-
- README.
|
64
|
+
- README.textile
|
55
65
|
files:
|
56
66
|
- .document
|
57
67
|
- .gitignore
|
58
68
|
- CHANGELOG
|
59
69
|
- LICENSE
|
60
|
-
- README.
|
70
|
+
- README.textile
|
61
71
|
- Rakefile
|
62
72
|
- VERSION
|
63
|
-
- bin/
|
73
|
+
- bin/api_call_monitor.rb
|
74
|
+
- bin/file_monitor.rb
|
75
|
+
- bin/loadavg_graphite_sender.rb
|
76
|
+
- bin/run_servers.sh
|
77
|
+
- bin/storage_monitor.rb
|
78
|
+
- bin/toy.rb
|
64
79
|
- graphiterb.gemspec
|
65
80
|
- lib/graphiterb.rb
|
81
|
+
- lib/graphiterb/graphite_logger.rb
|
82
|
+
- lib/graphiterb/graphite_script.rb
|
66
83
|
- lib/graphiterb/graphite_sender.rb
|
84
|
+
- lib/graphiterb/graphite_system_logger.rb
|
67
85
|
- spec/graphiterb_spec.rb
|
68
86
|
- spec/spec.opts
|
69
87
|
- spec/spec_helper.rb
|
@@ -77,26 +95,30 @@ rdoc_options:
|
|
77
95
|
require_paths:
|
78
96
|
- lib
|
79
97
|
required_ruby_version: !ruby/object:Gem::Requirement
|
98
|
+
none: false
|
80
99
|
requirements:
|
81
100
|
- - ">="
|
82
101
|
- !ruby/object:Gem::Version
|
102
|
+
hash: 3
|
83
103
|
segments:
|
84
104
|
- 0
|
85
105
|
version: "0"
|
86
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
|
+
none: false
|
87
108
|
requirements:
|
88
109
|
- - ">="
|
89
110
|
- !ruby/object:Gem::Version
|
111
|
+
hash: 3
|
90
112
|
segments:
|
91
113
|
- 0
|
92
114
|
version: "0"
|
93
115
|
requirements: []
|
94
116
|
|
95
117
|
rubyforge_project:
|
96
|
-
rubygems_version: 1.3.
|
118
|
+
rubygems_version: 1.3.7
|
97
119
|
signing_key:
|
98
120
|
specification_version: 3
|
99
121
|
summary: Fast Ubiquitous Dashboard Logs with Graphite (http://graphite.wikidot.com)
|
100
122
|
test_files:
|
101
|
-
- spec/spec_helper.rb
|
102
123
|
- spec/graphiterb_spec.rb
|
124
|
+
- spec/spec_helper.rb
|
data/README.rdoc
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
= graphiterb
|
2
|
-
|
3
|
-
Description goes here.
|
4
|
-
|
5
|
-
== Note on Patches/Pull Requests
|
6
|
-
|
7
|
-
* Fork the project.
|
8
|
-
* Make your feature addition or bug fix.
|
9
|
-
* Add tests for it. This is important so I don't break it in a
|
10
|
-
future version unintentionally.
|
11
|
-
* Commit, do not mess with rakefile, version, or history.
|
12
|
-
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
13
|
-
* Send me a pull request. Bonus points for topic branches.
|
14
|
-
|
15
|
-
== Copyright
|
16
|
-
|
17
|
-
Copyright (c) 2010 Philip (flip) Kromer (@mrflip). See LICENSE for details.
|