@@ -288,7 +288,7 @@ class AccuracyCheckerMode(Mode):
288
288
def __init__ (self , cfg ):
289
289
super ().__init__ (cfg )
290
290
self .thresholdPattern = ":\s([0-9]*[.][0-9]*)%.*abs error"
291
- self .breakThroughput = 0
291
+ self .curMetric = None
292
292
self .createCash ()
293
293
294
294
def prepareRun (self , list , cfg ):
@@ -317,29 +317,21 @@ def prepareRun(self, list, cfg):
317
317
self .sampleThroughput = float (foundThroughput )
318
318
return list
319
319
320
- def checkCfg (self , cfg ):
321
- super ().checkCfg (cfg )
322
- if not ("threshold" in cfg ["runConfig" ]):
323
- raise CfgError ("Threshold is not configured" )
324
- else :
325
- self .threshold = cfg ["runConfig" ]["threshold" ]
326
- self .threshold = float (self .threshold .strip ('%' ))
327
-
328
-
329
320
def compareCommits (self , lCommit : str , rCommit : str , cfg : map ):
330
- leftThroughput = self .getPseudoMetric (lCommit , cfg )
331
- rightThroughput = self .getPseudoMetric (rCommit , cfg )
332
- isLeftGood = leftThroughput >= float (self .threshold )
333
- isRightGood = rightThroughput >= float (self .threshold )
334
- if not isRightGood :
335
- self .breakThroughput = rightThroughput
321
+ leftMetric = self .getPseudoMetric (lCommit , cfg )
322
+ rightMetric = self .getPseudoMetric (rCommit , cfg )
323
+ isDiff = leftMetric != rightMetric
324
+ if isDiff :
325
+ self .curMetric = rightMetric
336
326
curCommit = rCommit .replace ('"' , "" )
337
327
commitLogger = getCommitLogger (cfg , curCommit )
338
- commitLogger .info ("Current accuracy is {}%" .format (rightThroughput ))
328
+ commitLogger .info ("Current accuracy is {}%" .format (rightMetric ))
339
329
commitLogger .info (
340
- "Commit is {status}" .format (status = ("bad" if isRightGood else "good" ))
330
+ "Commit {status} from {c}" .format (
331
+ status = ("differs" if isDiff else "doesn't differ" ),
332
+ c = lCommit )
341
333
)
342
- return isLeftGood != isRightGood
334
+ return isDiff
343
335
344
336
def getPseudoMetric (self , commit , cfg ):
345
337
commit = commit .replace ('"' , "" )
@@ -372,12 +364,12 @@ def getPseudoMetric(self, commit, cfg):
372
364
return curThroughput
373
365
374
366
def setOutputInfo (self , pathCommit ):
375
- pathCommit .breakThroughput = self .breakThroughput
367
+ pathCommit .metric = self .curMetric
376
368
377
369
def getCommitInfo (self , commit ):
378
- return "{ci}, throughput = {d}" .format (
370
+ return "{ci}, metric = {d}" .format (
379
371
ci = super ().getCommitInfo (commit ),
380
- d = commit .breakThroughput )
372
+ d = commit .metric )
381
373
382
374
383
375
class CompareBlobsMode (Mode ):
0 commit comments