hadoop-metrics2 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/hadoop_metrics2/api.rb +11 -1
- data/lib/hadoop_metrics2/resource_manager.rb +13 -0
- data/lib/hadoop_metrics2/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NWQ0MTA1MDM1NTdhMzkxNTcyZmY1MGU0ZTUyYzY2MzAxZDI1Y2I3YQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MmZkMzAwMjgwZWM2NzQ3YmIzMmY0YWI2YjcyOTAwMzE5NTc3ZWIwYg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MGE0Nzk2YzI5N2IyOWQzMzY3ODgyOTMxMzFhM2RkYmViZjIyMzcyNDJjNWVk
|
10
|
+
YzMzN2JkMGNlMTA5MzNhNTM2ZjBkMmU1YjEwZmE1NjhiYWY4ZjcyYmE2Y2M1
|
11
|
+
MzVhOTQ1Mzg0MTVjMTBjYTAxNGI0ZTBmODAyYTM3MGZkMDIxMmY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTBiOTM2ZTI0ZTg0ZTQ4ODBjN2I2Y2I1NTEzM2UxM2NhZTBiM2Y5OTI1YTI4
|
14
|
+
ZTNhNjc4MTcyNzhhNGY2YjNjZDAxNTVhYTMxNjYzZWM3MTc1NGM1N2RkZWNj
|
15
|
+
NWU3MTQyODkwYTY5ZmUwMzQ5OWMzMTU5YzliNjI4ZTBiOWUwMDk=
|
data/lib/hadoop_metrics2/api.rb
CHANGED
@@ -11,6 +11,7 @@ module HadoopMetrics2
|
|
11
11
|
snake_case = opts.has_key?(:snake_case) ? opts[:snake_case] : true
|
12
12
|
@name = opts[:name] || host
|
13
13
|
@metrics_cache = nil
|
14
|
+
@scheduler_cache = nil
|
14
15
|
end
|
15
16
|
|
16
17
|
attr_reader :name
|
@@ -24,7 +25,16 @@ module HadoopMetrics2
|
|
24
25
|
@metrics_cache
|
25
26
|
end
|
26
27
|
|
27
|
-
|
28
|
+
def scheduler(force = true)
|
29
|
+
if !@scheduler_cache.nil? and !force
|
30
|
+
return @scheduler_cache
|
31
|
+
end
|
32
|
+
|
33
|
+
@scheduler_cache = HadoopMetrics2.get_response(URI("http://#{@endpoint}/ws/v1/cluster/scheduler"))
|
34
|
+
@scheduler_cache
|
35
|
+
end
|
36
|
+
|
37
|
+
GCNameMap = {
|
28
38
|
'PS Scavenge' => 'minor', # for backward compatibility
|
29
39
|
'PS MarkSweep' => 'major', # for backward compatibility
|
30
40
|
'ConcurrentMarkSweep' => 'c_mark_sweep',
|
@@ -17,6 +17,19 @@ module HadoopMetrics2
|
|
17
17
|
metrics(get_force(opts))['clusterMetrics']
|
18
18
|
end
|
19
19
|
|
20
|
+
def fairscheduler_active_apps(opts = {})
|
21
|
+
targets = scheduler(get_force(opts))['scheduler']['schedulerInfo']['rootQueue']['childQueues']
|
22
|
+
return fs nil if fs.nil?
|
23
|
+
|
24
|
+
each_apps = {}
|
25
|
+
targets.each { |target|
|
26
|
+
name = target['queueName'].gsub(/root./, '')
|
27
|
+
each_apps[name] ||= 0
|
28
|
+
each_apps[name] += target['numActiveApps']
|
29
|
+
}
|
30
|
+
each_tasks
|
31
|
+
end
|
32
|
+
|
20
33
|
private
|
21
34
|
|
22
35
|
def get_column(opts)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hadoop-metrics2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryu Kobayashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|