Skip to content

Commit 0936849

Browse files
committed
fix: Fixing plotter for pilotsubm accounting
1 parent e65ccbb commit 0936849

File tree

3 files changed

+10
-21
lines changed

3 files changed

+10
-21
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/MonitoringReporter.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -165,18 +165,6 @@ def commit(self):
165165
self.__documentLock.release()
166166
return S_OK(recordSent)
167167

168-
def delayedCommit(self):
169-
"""
170-
If needed start a timer that will run the commit later
171-
allowing to send more registers at once (reduces overheads).
172-
"""
173-
174-
if not self.__commitTimer.is_alive():
175-
self.__commitTimer = threading.Timer(5, self.commit)
176-
self.__commitTimer.start()
177-
178-
return S_OK()
179-
180168
def __getProducer(self):
181169
"""
182170
This method is used to get the default MQ producer or create it if needed.

src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,7 @@ def sendPilotSubmissionMonitoring(self, siteName, ceName, queueName, numTotal, n
14231423
pilotMonitoringReporter.addRecord(pilotMonitoringData)
14241424

14251425
self.log.verbose("Committing pilot submission to monitoring")
1426-
result = pilotMonitoringReporter.delayedCommit()
1426+
result = pilotMonitoringReporter.commit()
14271427
if not result["OK"]:
14281428
self.log.error("Could not commit pilot submission to monitoring", result["Message"])
14291429
return S_ERROR()

0 commit comments

Comments
 (0)