Skip to content

Commit 776cd36

Browse files
authored
Merge pull request #5945 from rupozzi/pilotfix
[integration] Hackaton fix: pilotsubmission discrepancies between Accounting and Monitoring
2 parents 336f598 + 3ecbe5a commit 776cd36

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

src/DIRAC/AccountingSystem/private/Plotters/PilotSubmissionPlotter.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,7 @@ def _reportSubmission(self, reportRequest):
3434
return retVal
3535
dataDict, granularity = retVal["Value"]
3636
self.stripDataField(dataDict, 0)
37-
dataDict, _ = self._divideByFactor(dataDict, granularity)
38-
dataDict = self._fillWithZero(granularity, reportRequest["startTime"], reportRequest["endTime"], dataDict)
39-
baseDataDict, graphDataDict, _, unit = self._findSuitableRateUnit(
40-
dataDict, self._getAccumulationMaxValue(dataDict), "jobs"
41-
)
42-
return S_OK({"data": baseDataDict, "graphDataDict": graphDataDict, "granularity": granularity, "unit": unit})
37+
return S_OK({"data": dataDict, "granularity": granularity})
4338

4439
def _plotSubmission(self, reportRequest, plotInfo, filename):
4540
"""
@@ -55,9 +50,15 @@ def _plotSubmission(self, reportRequest, plotInfo, filename):
5550
"starttime": reportRequest["startTime"],
5651
"endtime": reportRequest["endTime"],
5752
"span": plotInfo["granularity"],
58-
"ylabel": plotInfo["unit"],
53+
"ylabel": "Submissions",
5954
}
60-
return self._generateTimedStackedBarPlot(filename, plotInfo["graphDataDict"], metadata)
55+
plotInfo["data"] = self._fillWithZero(
56+
granularity=plotInfo["granularity"],
57+
startEpoch=reportRequest["startTime"],
58+
endEpoch=reportRequest["endTime"],
59+
dataDict=plotInfo["data"],
60+
)
61+
return self._generateTimedStackedBarPlot(filename, plotInfo["data"], metadata)
6162

6263
_reportSubmissionEfficiencyName = "Submission efficiency"
6364

src/DIRAC/MonitoringSystem/Client/Types/PilotSubmissionMonitoring.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ def __init__(self):
3636
}
3737
)
3838

39-
self.dataToKeep = 86400 * 30
39+
self.dataToKeep = 86400 * 30 * 14
4040

4141
self.checkType()

src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,18 +1414,18 @@ def sendPilotSubmissionMonitoring(self, siteName, ceName, queueName, numTotal, n
14141414
"SiteDirector": siteDirName,
14151415
"Site": siteName,
14161416
"CE": ceName,
1417-
"Queue": queueName,
1417+
"Queue": ceName + ":" + queueName,
14181418
"Status": status,
14191419
"NumTotal": numTotal,
14201420
"NumSucceded": numSucceeded,
14211421
"timestamp": int(toEpoch(dateTime())),
14221422
}
14231423
pilotMonitoringReporter.addRecord(pilotMonitoringData)
1424-
result = pilotMonitoringReporter.commit()
14251424

14261425
self.log.verbose("Committing pilot submission to monitoring")
1426+
result = pilotMonitoringReporter.commit()
14271427
if not result["OK"]:
1428-
self.log.error("Couldn't commit pilot submission to monitoring", result["Message"])
1428+
self.log.error("Could not commit pilot submission to monitoring", result["Message"])
14291429
return S_ERROR()
14301430
self.log.verbose("Done committing to monitoring")
14311431
return S_OK()

0 commit comments

Comments
 (0)