@@ -47,7 +47,8 @@ class Query(object):
47
47
"gpfs_disk_usage_name" , "gpfs_fset_name" , "gpfs_fs_name" ,
48
48
"mountPoint" , "netdev_name" , 'diskdev_name' , "node" , "db_name" ,
49
49
"operation" , "protocol" , "waiters_time_threshold" , "export" ,
50
- "nodegroup" , "account" , "filesystem" , "tct_csap" , "tct_operation" , "cloud_nodeclass" ])
50
+ "nodegroup" , "account" , "filesystem" , "tct_csap" , "tct_operation" , "cloud_nodeclass" ,
51
+ "gpfs_health_component" , "gpfs_health_entity" ])
51
52
52
53
DISK_CAP_METRICS = set (["gpfs_disk_disksize" , "gpfs_disk_free_fullkb" , "gpfs_disk_free_fragkb" ,
53
54
"gpfs_pool_disksize" , "gpfs_pool_free_fragkb" , "gpfs_pool_free_fullkb" ,
@@ -91,6 +92,7 @@ def __init__(self, metrics=None, bucketsize=1, filters=None, groupby=None, inclu
91
92
self .timeRep = ' now' # string time representation
92
93
self .measurements = {}
93
94
self .normalize_rates = True
95
+ self .rawData = False
94
96
self .key = None
95
97
self .sensor = None
96
98
@@ -188,26 +190,34 @@ def addMeasurement(self, meassure):
188
190
def __str__ (self ):
189
191
# dd = '-a' if self.includeDiskData else ''
190
192
# Workaround for RTC Defect 280368: Zimon capacity query does not return all results (seen on CNSA)
191
- if (self .metrics
192
- and any (str (metric ) in self .DISK_CAP_METRICS for metric in self .metrics )
193
- ) or (self .sensor
194
- and self .sensor in ("GPFSDiskCap" , "GPFSPoolCap" , "GPFSInodeCap" )
195
- ):
196
- dd = '-ar'
197
- elif self .includeDiskData :
193
+ dd = ''
194
+ if self .includeDiskData :
198
195
dd = '-a'
196
+ if self .metrics :
197
+ for metric in self .metrics :
198
+ if any (map (metric .__contains__ , self .DISK_CAP_METRICS )):
199
+ dd = '-ar'
200
+ break
201
+ elif (self .sensor and self .sensor in ("GPFSDiskCap" ,
202
+ "GPFSPoolCap" ,
203
+ "GPFSInodeCap" )
204
+ ):
205
+ dd = '-ar'
206
+
207
+ if self .rawData :
208
+ raw = '-z'
199
209
else :
200
- dd = ''
210
+ raw = ''
201
211
202
212
if self .sensor is not None :
203
- queryString = 'get -j {0} group {1} bucket_size {2} {3 }' .format (
204
- dd , self .sensor , self .bucket_size , self .timeRep )
213
+ queryString = 'get -j {0} {1} group {2} bucket_size {3} {4 }' .format (
214
+ dd , raw , self .sensor , self .bucket_size , self .timeRep )
205
215
elif self .key is not None :
206
- queryString = 'get -j {0} {1} bucket_size {2} {3 }' .format (
207
- dd , self .key , self .bucket_size , self .timeRep )
216
+ queryString = 'get -j {0} {1} {2} bucket_size {3} {4 }' .format (
217
+ dd , raw , self .key , self .bucket_size , self .timeRep )
208
218
else :
209
- queryString = 'get -j {0} metrics {1} bucket_size {2} {3 }' .format (
210
- dd , ',' .join (self .metrics ), self .bucket_size , self .timeRep )
219
+ queryString = 'get -j {0} {1} metrics {2} bucket_size {3} {4 }' .format (
220
+ dd , raw , ',' .join (self .metrics ), self .bucket_size , self .timeRep )
211
221
212
222
if self .filters :
213
223
queryString += ' from ' + "," .join (self .filters )
0 commit comments