presto-metrics 0.3.10 → 0.3.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/presto/metrics/client.rb +4 -2
- data/lib/presto/metrics/query.rb +11 -4
- data/lib/presto/metrics/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9617d545ab8d02a5d52eba1a50a2623f20ae4e55
|
4
|
+
data.tar.gz: 7e5af26f44fd021a19b69e18cc3a8d3f1dad90c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc12934048e4a46f4c2f29611cbae251462b2db930e99993c454fd9edceb8ec111152ffcb73dc7cbfc508d1d15c7813eb2702780a95730e151c69a8385b142d8
|
7
|
+
data.tar.gz: 1cdcf563633f9a6883f11f21dd97809face44c54adf6058ea052dc41a47ea5296e91a6962bfacd6a3f5e43fd3630c6ff37cbcfd537e6b6f74d985b69dd87d4de
|
@@ -30,9 +30,11 @@ module Presto
|
|
30
30
|
'task_manager' => 'com.facebook.presto.execution:name=TaskManager',
|
31
31
|
'memory_pool_general' => 'com.facebook.presto.memory:type=MemoryPool,name=general',
|
32
32
|
'memory_pool_reserved' => 'com.facebook.presto.memory:type=MemoryPool,name=reserved',
|
33
|
+
'memory_pool_system' => 'com.facebook.presto.memory:type=MemoryPool,name=system',
|
33
34
|
'cluster_memory_manager' => 'com.facebook.presto.memory:name=ClusterMemoryManager',
|
34
35
|
'cluster_memory_pool_general' => 'com.facebook.presto.memory:type=ClusterMemoryPool,name=general',
|
35
36
|
'cluster_memory_pool_reserved' => 'com.facebook.presto.memory:type=ClusterMemoryPool,name=reserved',
|
37
|
+
'cluster_memory_pool_system' => 'com.facebook.presto.memory:type=ClusterMemoryPool,name=system',
|
36
38
|
}
|
37
39
|
|
38
40
|
def path(path)
|
@@ -215,13 +217,13 @@ module Presto
|
|
215
217
|
end
|
216
218
|
|
217
219
|
def memory_pool_metrics(target_attr=[])
|
218
|
-
['general', 'reserved'].each_with_object({}) {|type, hash|
|
220
|
+
['general', 'reserved', 'system'].each_with_object({}) {|type, hash|
|
219
221
|
hash[type] = get_metrics("com.facebook.presto.memory:type=MemoryPool,name=#{type}", target_attr)
|
220
222
|
}
|
221
223
|
end
|
222
224
|
|
223
225
|
def cluster_memory_pool_metrics(target_attr=[])
|
224
|
-
['general', 'reserved'].each_with_object({}) {|type, hash|
|
226
|
+
['general', 'reserved', 'system'].each_with_object({}) {|type, hash|
|
225
227
|
hash[type] = get_metrics("com.facebook.presto.memory:type=ClusterMemoryPool,name=#{type}", target_attr)
|
226
228
|
}
|
227
229
|
end
|
data/lib/presto/metrics/query.rb
CHANGED
@@ -67,7 +67,11 @@ module Presto
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def find(queryId)
|
70
|
-
|
70
|
+
begin
|
71
|
+
JSON.parse(@client.get_query_json(queryId, "{}"))
|
72
|
+
rescue
|
73
|
+
{}
|
74
|
+
end
|
71
75
|
end
|
72
76
|
|
73
77
|
def task_list(queryId)
|
@@ -93,7 +97,11 @@ module Presto
|
|
93
97
|
end
|
94
98
|
|
95
99
|
def query_list(path="")
|
96
|
-
|
100
|
+
begin
|
101
|
+
JSON.parse(@client.get_query_json(path))
|
102
|
+
rescue
|
103
|
+
[]
|
104
|
+
end
|
97
105
|
end
|
98
106
|
|
99
107
|
def running_list
|
@@ -118,8 +126,7 @@ module Presto
|
|
118
126
|
def query_progress
|
119
127
|
running_queries = query_list.map { |q| QueryInfo.decode(q) }.select { |q| q.state == :running }
|
120
128
|
query_info = running_queries.map { |q|
|
121
|
-
|
122
|
-
QueryInfo.decode(queryInfo)
|
129
|
+
QueryInfo.decode(find(q.query_id))
|
123
130
|
}
|
124
131
|
|
125
132
|
result = {}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: presto-metrics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taro L. Saito
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|