rack-jsonz 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rack/jsonz.rb +2 -2
- data/lib/rack/jsonz/cpu.rb +10 -2
- data/lib/rack/jsonz/metric.rb +9 -0
- data/lib/rack/jsonz/version.rb +1 -1
- data/rack-jsonz.gemspec +2 -0
- metadata +30 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de3ab72fc2689917da6343629d54265f695291ae
|
4
|
+
data.tar.gz: 3dbde2b53434c1802c743237ed47f451b68ba08c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f378936941ab2e9b46b4dbdc3ffc11213e2c9b16599c134b1159919451240843f01f1710d6a27dca9bdad7e95d402efdd99aaf52c7d780d88e66789f48ed3be
|
7
|
+
data.tar.gz: 7c297a48bf67c10ebe538fb712209bace3e0d473ead8f021d5f7286e7cfd2dda8e42bc6bf2aad155376feeb52327dd02ef04179bf7f92d90c63d208cf7de9d50
|
data/lib/rack/jsonz.rb
CHANGED
data/lib/rack/jsonz/cpu.rb
CHANGED
@@ -1,13 +1,21 @@
|
|
1
|
+
require 'rack/jsonz/metric'
|
2
|
+
|
1
3
|
require 'system'
|
4
|
+
require 'usagewatch_ext'
|
2
5
|
|
3
6
|
module Rack
|
4
7
|
class Jsonz
|
5
|
-
class CPU
|
8
|
+
class CPU < Metric
|
6
9
|
def metrics
|
7
10
|
return {
|
8
|
-
:count => System::CPU.count
|
11
|
+
:count => System::CPU.count.to_f,
|
12
|
+
:load => Usagewatch.uw_load.to_f,
|
9
13
|
}
|
10
14
|
end
|
15
|
+
|
16
|
+
def metric_group
|
17
|
+
"cpu"
|
18
|
+
end
|
11
19
|
end
|
12
20
|
end
|
13
21
|
end
|
data/lib/rack/jsonz/version.rb
CHANGED
data/rack-jsonz.gemspec
CHANGED
@@ -21,6 +21,8 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_dependency "oj"
|
22
22
|
spec.add_dependency "rack"
|
23
23
|
spec.add_dependency "system"
|
24
|
+
spec.add_dependency "usagewatch"
|
25
|
+
spec.add_dependency "usagewatch_ext"
|
24
26
|
|
25
27
|
spec.add_development_dependency "bundler", "~> 1.5"
|
26
28
|
spec.add_development_dependency "rake"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-jsonz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nat Welch
|
@@ -52,6 +52,34 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: usagewatch
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: usagewatch_ext
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
55
83
|
- !ruby/object:Gem::Dependency
|
56
84
|
name: bundler
|
57
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,6 +122,7 @@ files:
|
|
94
122
|
- Rakefile
|
95
123
|
- lib/rack/jsonz.rb
|
96
124
|
- lib/rack/jsonz/cpu.rb
|
125
|
+
- lib/rack/jsonz/metric.rb
|
97
126
|
- lib/rack/jsonz/version.rb
|
98
127
|
- rack-jsonz.gemspec
|
99
128
|
homepage: http://github.com/icco/rack-jsonz
|