25
25
import socket
26
26
import time
27
27
from collections import namedtuple , defaultdict
28
- import inspect
29
28
from itertools import chain
30
- from typing import NamedTuple , Optional , Tuple
29
+ from typing import NamedTuple , Tuple
31
30
32
31
from .PerfmonRESTclient import perfHTTPrequestHelper , createRequestDataObj , getAuthHandler
33
32
@@ -236,7 +235,7 @@ def _add_calculated_row_data(self, calc, row):
236
235
for step in prg :
237
236
if step in Calculator .OPS :
238
237
calc .op (step )
239
- elif step .isnumeric (): # is_number(step):
238
+ elif step .isnumeric (): # is_number(step):
240
239
calc .push (float (step ))
241
240
else :
242
241
idx = self .index_cache .get ((step , parent , myid ), - 1 )
@@ -257,9 +256,9 @@ def __getitem__(self, index):
257
256
258
257
def _populate_index_cache (self ):
259
258
for ci in self .columnInfos :
260
- key = (ci .keys [0 ].metric , ci .parents , ci .identifiers )
261
- if key in self .index_cache :
262
- SysmonLogger .getLogger (__name__ ).error ("hash collision in _populate_index_cache" )
259
+ key = (ci .keys [0 ].metric , ci .parents , ci .identifiers )
260
+ # if key in self.index_cache:
261
+ # SysmonLogger.getLogger(__name__).error("hash collision in _populate_index_cache")
263
262
self .index_cache [key ] = ci .column
264
263
265
264
def drop_base_metrics (self ):
@@ -383,7 +382,7 @@ def div(a, b): # defined anew because of py 2/3 difference
383
382
384
383
class Calculator (object ):
385
384
'''simple UPN calculator'''
386
- OPS = {"+" : operator .add , "-" : operator .sub , '*' : operator .mul , '/' : div , ">=" : operator .ge , ">" : operator .gt , "<=" : operator .le , "<" : operator .lt , "==" : operator .eq }
385
+ OPS = {"+" : operator .add , "-" : operator .sub , '*' : operator .mul , '/' : div , ">=" : operator .ge , ">" : operator .gt , "<=" : operator .le , "<" : operator .lt , "==" : operator .eq }
387
386
388
387
def __init__ (self ):
389
388
self .stack = []
0 commit comments