ganymed 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,13 +9,12 @@ collect do
9
9
  x.to_i / 100
10
10
  end
11
11
 
12
- Metriks.derive("os.cpu.user").mark(cpu[0])
13
- Metriks.derive("os.cpu.nice").mark(cpu[1])
14
- Metriks.derive("os.cpu.system").mark(cpu[2])
15
- Metriks.derive("os.cpu.idle").mark(cpu[3])
16
- Metriks.derive("os.cpu.iowait").mark(cpu[4])
17
- Metriks.derive("os.cpu.irq").mark(cpu[5])
18
- Metriks.derive("os.cpu.softirq").mark(cpu[6])
12
+ Metriks.derive("os.cpu:user").mark(cpu[0])
13
+ Metriks.derive("os.cpu:nice").mark(cpu[1])
14
+ Metriks.derive("os.cpu:system").mark(cpu[2])
15
+ Metriks.derive("os.cpu:iowait").mark(cpu[4])
16
+ Metriks.derive("os.cpu:irq").mark(cpu[5])
17
+ Metriks.derive("os.cpu:softirq").mark(cpu[6])
19
18
  end
20
19
  end
21
20
  end
@@ -16,10 +16,10 @@ collect do
16
16
  next if config.exclude.map {|e| Regexp.new(e).match(name)}.any?
17
17
 
18
18
  block_pc = 1.0 - (st.blocks_free.to_f / st.blocks.to_f)
19
- Metriks.histogram("os.disk.#{name}.blocks").update(block_pc)
19
+ Metriks.histogram("os.disk:#{name}.blocks").update(block_pc)
20
20
 
21
21
  files_pc = 1.0 - (st.files_free.to_f / st.files.to_f)
22
- Metriks.histogram("os.disk.#{name}.files").update(files_pc)
22
+ Metriks.histogram("os.disk:#{name}.files").update(files_pc)
23
23
  end
24
24
  end
25
25
  end
@@ -11,8 +11,9 @@ collect do
11
11
  ios = Struct::IOStat.new(*line.strip.split(/\s+/))
12
12
  next if config.skip_numbered.tap{} and ios.dev =~ /\d+$/
13
13
  next if config.exclude.map {|e| Regexp.new(e).match(ios.dev)}.any?
14
- Metriks.derive("os.iostat.#{ios.dev}.rsect").mark(ios.rsect.to_i)
15
- Metriks.derive("os.iostat.#{ios.dev}.wsect").mark(ios.wsect.to_i)
14
+ sector_size = File.read("/sys/block/#{ios.dev}/queue/physical_block_size").chomp.to_i rescue 512
15
+ Metriks.derive("os.iostat:#{ios.dev}.rbytes").mark(ios.rsect.to_i * sector_size)
16
+ Metriks.derive("os.iostat:#{ios.dev}.wbytes").mark(ios.wsect.to_i * sector_size)
16
17
  end
17
18
  end
18
19
  end
@@ -14,28 +14,28 @@ collect do
14
14
  when "MemTotal"
15
15
  apps = value
16
16
  when "MemFree"
17
- Metriks.histogram("os.mem.unused").update(value)
17
+ Metriks.histogram("os.mem:unused").update(value)
18
18
  apps -= value
19
19
  when "Buffers"
20
- Metriks.histogram("os.mem.buffers").update(value)
20
+ Metriks.histogram("os.mem:buffers").update(value)
21
21
  apps -= value
22
22
  when "Cached"
23
- Metriks.histogram("os.mem.cache").update(value)
23
+ Metriks.histogram("os.mem:cache").update(value)
24
24
  apps -= value
25
25
  when "SwapCached"
26
- Metriks.histogram("os.mem.swap_cache").update(value)
26
+ Metriks.histogram("os.mem:swap_cache").update(value)
27
27
  apps -= value
28
28
  when "Slab"
29
- Metriks.histogram("os.mem.slab_cache").update(value)
29
+ Metriks.histogram("os.mem:slab_cache").update(value)
30
30
  apps -= value
31
31
  when "PageTables"
32
- Metriks.histogram("os.mem.page_tables").update(value)
32
+ Metriks.histogram("os.mem:page_tables").update(value)
33
33
  apps -= value
34
34
  when "Mapped"
35
- Metriks.histogram("os.mem.mapped").update(value)
35
+ Metriks.histogram("os.mem:mapped").update(value)
36
36
  end
37
37
  end
38
38
 
39
- Metriks.histogram("os.mem.apps").update(apps)
39
+ Metriks.histogram("os.mem:apps").update(apps)
40
40
  end
41
41
  end
@@ -15,12 +15,12 @@ collect do
15
15
 
16
16
  next if config.exclude.map {|e| Regexp.new(e).match(ns.dev)}.any?
17
17
 
18
- Metriks.derive("os.net.#{ns.dev}.rbytes").mark(ns.rbytes.to_i)
19
- Metriks.derive("os.net.#{ns.dev}.wbytes").mark(ns.wbytes.to_i)
20
- Metriks.derive("os.net.#{ns.dev}.rpackets").mark(ns.rpackets.to_i)
21
- Metriks.derive("os.net.#{ns.dev}.wpackets").mark(ns.wpackets.to_i)
22
- Metriks.derive("os.net.#{ns.dev}.rerrs").mark(ns.rerrs.to_i)
23
- Metriks.derive("os.net.#{ns.dev}.werrs").mark(ns.werrs.to_i)
18
+ Metriks.derive("os.net:#{ns.dev}.rbytes").mark(ns.rbytes.to_i)
19
+ Metriks.derive("os.net:#{ns.dev}.wbytes").mark(ns.wbytes.to_i)
20
+ Metriks.derive("os.net:#{ns.dev}.rpackets").mark(ns.rpackets.to_i)
21
+ Metriks.derive("os.net:#{ns.dev}.wpackets").mark(ns.wpackets.to_i)
22
+ Metriks.derive("os.net:#{ns.dev}.rerrs").mark(ns.rerrs.to_i)
23
+ Metriks.derive("os.net:#{ns.dev}.werrs").mark(ns.werrs.to_i)
24
24
  end
25
25
  end
26
26
  end
@@ -5,13 +5,13 @@ collect do
5
5
  key, value = line.chomp.split
6
6
  case key
7
7
  when "ctxt"
8
- Metriks.derive("os.procs.switch").mark(value.to_i)
8
+ Metriks.derive("os.sched.switch").mark(value.to_i)
9
9
  when "processes"
10
- Metriks.derive("os.procs.forks").mark(value.to_i)
10
+ Metriks.derive("os.forks").mark(value.to_i)
11
11
  when "procs_running"
12
- Metriks.histogram("os.procs.running").update(value.to_i)
12
+ Metriks.histogram("os.procs:running").update(value.to_i)
13
13
  when "procs_blocked"
14
- Metriks.histogram("os.procs.blocked").update(value.to_i)
14
+ Metriks.histogram("os.procs:blocked").update(value.to_i)
15
15
  end
16
16
  end
17
17
  end
@@ -1,4 +1,4 @@
1
1
  module Ganymed
2
2
  # @private
3
- VERSION = '0.4.2'
3
+ VERSION = '0.4.3'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ganymed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-20 00:00:00.000000000 Z
12
+ date: 2012-10-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -222,7 +222,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
222
222
  version: '0'
223
223
  segments:
224
224
  - 0
225
- hash: -4422318891659599055
225
+ hash: 841601178190202909
226
226
  required_rubygems_version: !ruby/object:Gem::Requirement
227
227
  none: false
228
228
  requirements:
@@ -231,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
231
231
  version: '0'
232
232
  segments:
233
233
  - 0
234
- hash: -4422318891659599055
234
+ hash: 841601178190202909
235
235
  requirements: []
236
236
  rubyforge_project:
237
237
  rubygems_version: 1.8.24