city-watch 0.5.5 → 0.5.6

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.
@@ -0,0 +1,17 @@
1
+ class Uptime
2
+
3
+ include Watchman
4
+
5
+ def self.data
6
+ out = {}
7
+ out[:uptime], out[:idle] = File.read('/proc/uptime').strip.split.map {|t| Float(t) }
8
+ base = out.dup
9
+ [[:minutes,Proc.new{|t| t / 60 }],[:hours,Proc.new{|t| t / (60*60) }],[:days,Proc.new{|t| t / (60*60*24) }]].each do |(id,func)|
10
+ base.each do |k,v|
11
+ out["#{k.to_s}_#{id.to_s}".to_sym] = func.call(v).round(2)
12
+ end
13
+ end
14
+ out.merge({:summary => [:uptime_days]})
15
+ end
16
+
17
+ end
@@ -38,3 +38,4 @@ require 'city_watch/watchmen/unicorns'
38
38
  require 'city_watch/watchmen/nginx'
39
39
  require 'city_watch/watchmen/cpu_usage'
40
40
  require 'city_watch/watchmen/disk_usage'
41
+ require 'city_watch/watchmen/uptime'
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module CityWatch
2
- VERSION = "0.5.5"
2
+ VERSION = "0.5.6"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: city-watch
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.5.5
5
+ version: 0.5.6
6
6
  platform: ruby
7
7
  authors:
8
8
  - John Bragg
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2013-02-11 00:00:00 Z
13
+ date: 2013-02-12 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: redis
@@ -148,6 +148,7 @@ files:
148
148
  - lib/city_watch/watchmen/server_load.rb
149
149
  - lib/city_watch/watchmen/sysinfo.rb
150
150
  - lib/city_watch/watchmen/unicorns.rb
151
+ - lib/city_watch/watchmen/uptime.rb
151
152
  - lib/version.rb
152
153
  - static/javascripts/city_watch.js
153
154
  - static/javascripts/highlight.pack.js