Skip to content

Commit

Permalink
Merge pull request #37638 from Dr15Jones/fuzzTimeForStallGraph
Browse files Browse the repository at this point in the history
Use a time window when comparing results for stall graph
  • Loading branch information
cmsbuild committed Apr 21, 2022
2 parents 5b56ea4 + 08803d7 commit 9d77220
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions FWCore/Concurrency/scripts/edmStreamStallGrapher.py
Expand Up @@ -67,6 +67,8 @@ def printHelp():
kSourceFindEvent = "sourceFindEvent"
kSourceDelayedRead ="sourceDelayedRead"

kTimeFuzz = 1000 # in microseconds

#----------------------------------------------
def processingStepsFromStallMonitorOutput(f,moduleNames, esModuleNames):
for rawl in f:
Expand Down Expand Up @@ -474,7 +476,7 @@ def reduceSortedPoints(ps):
reducedPoints = []
tmp = Point(ps[0].x, ps[0].y)
for p in ps[1:]:
if tmp.x == p.x:
if abs(tmp.x -p.x)<kTimeFuzz:
tmp.y += p.y
else:
reducedPoints.append(tmp)
Expand Down Expand Up @@ -555,7 +557,7 @@ def mergeContiguousBlocks(blocks):

lastStartTime,lastTimeLength,lastHeight = oldBlocks[0]
for start,length,height in oldBlocks[1:]:
if height == lastHeight and lastStartTime+lastTimeLength == start:
if height == lastHeight and abs(lastStartTime+lastTimeLength - start) < kTimeFuzz:
lastTimeLength += length
else:
blocks.append((lastStartTime,lastTimeLength,lastHeight))
Expand Down

0 comments on commit 9d77220

Please sign in to comment.