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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 76738b2193dac8ff0c1b85ab37c8d3773e7c1540
4
- data.tar.gz: 024bef2488910dca9483240bc6fca29fe9d24c8d
3
+ metadata.gz: 9617d545ab8d02a5d52eba1a50a2623f20ae4e55
4
+ data.tar.gz: 7e5af26f44fd021a19b69e18cc3a8d3f1dad90c7
5
5
  SHA512:
6
- metadata.gz: 24cd82ee453475715789b9469458514d380b6f6027c9db7e912a60b18e0cb24b63df74da2700e85db2abfe08f73229bc10627ff35a2dd00913ec1d76e15fbaaf
7
- data.tar.gz: 1deb4275a340a4162bf0a9111b6723acb1cfe949c179631b34f79bde31d8fa3df63863f88bd70d2524f73f6d879685636935738676f48454de0a5a3ed627dd31
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
@@ -67,7 +67,11 @@ module Presto
67
67
  end
68
68
 
69
69
  def find(queryId)
70
- JSON.parse(@client.get_query_json(queryId, "{}"))
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
- JSON.parse(@client.get_query_json(path))
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
- queryInfo = find(q.query_id)
122
- QueryInfo.decode(queryInfo)
129
+ QueryInfo.decode(find(q.query_id))
123
130
  }
124
131
 
125
132
  result = {}
@@ -1,5 +1,5 @@
1
1
  module Presto
2
2
  module Metrics
3
- VERSION = '0.3.10'
3
+ VERSION = '0.3.11'
4
4
  end
5
5
  end
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.10
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: 2015-07-31 00:00:00.000000000 Z
11
+ date: 2016-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler