本文整理汇总了Python中DIRAC.AccountingSystem.Client.ReportsClient.ReportsClient.generateDelayedPlot方法的典型用法代码示例。如果您正苦于以下问题:Python ReportsClient.generateDelayedPlot方法的具体用法?Python ReportsClient.generateDelayedPlot怎么用?Python ReportsClient.generateDelayedPlot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIRAC.AccountingSystem.Client.ReportsClient.ReportsClient
的用法示例。
在下文中一共展示了ReportsClient.generateDelayedPlot方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __queryForPlot
# 需要导入模块: from DIRAC.AccountingSystem.Client.ReportsClient import ReportsClient [as 别名]
# 或者: from DIRAC.AccountingSystem.Client.ReportsClient.ReportsClient import generateDelayedPlot [as 别名]
def __queryForPlot(self):
retVal = self.__parseFormParams()
if not retVal['OK']:
return retVal
params = retVal['Value']
repClient = ReportsClient(rpcClient=RPCClient("Accounting/ReportGenerator"))
retVal = repClient.generateDelayedPlot(*params)
return retVal
示例2: web_generatePlot
# 需要导入模块: from DIRAC.AccountingSystem.Client.ReportsClient import ReportsClient [as 别名]
# 或者: from DIRAC.AccountingSystem.Client.ReportsClient.ReportsClient import generateDelayedPlot [as 别名]
def web_generatePlot(self):
callback = {}
retVal = self.__parseFormParams()
if not retVal[ 'OK' ]:
callback = {"success":"false", "error":retVal[ 'Message' ]}
self.finish( callback )
params = retVal[ 'Value' ]
repClient = ReportsClient( rpcClient = RPCClient( "Accounting/ReportGenerator" ) )
retVal = repClient.generateDelayedPlot( *params )
if not retVal[ 'OK' ]:
callback = {"success":"false", "error":retVal[ 'Message' ]}
self.finish( callback )
rawData = retVal[ 'Value' ]
'''groupKeys = rawData[ 'data' ].keys()'''
self.log.always("11111111111111111111111111111111111111111111111111111111111")
self.log.always(retVal[ 'Value' ][ 'plot' ])
self.log.always("22222222222222222222222222222222222222222222222222222222222")
self.finish({'success' : 'true', 'result' : rawData['plot']})
示例3: generateAccountingPlot
# 需要导入模块: from DIRAC.AccountingSystem.Client.ReportsClient import ReportsClient [as 别名]
# 或者: from DIRAC.AccountingSystem.Client.ReportsClient.ReportsClient import generateDelayedPlot [as 别名]
def generateAccountingPlot( self ):
try:
site = str( request.params[ 'site' ] )
plotName = str( request.params[ 'plotName' ] )
plotTime = str( request.params[ 'plotTime' ] )
height = int( request.params[ 'height' ] )
width = int( request.params[ 'width' ] )
except:
S_ERROR( "Oops, Invalid parameters!" )
extraParams = { 'height' : height, 'width' : width }
if plotName == 'CPU Used':
typeName = "Job"
reportName = "CPUUsed"
grouping = "FinalMajorStatus"
condDict = { 'Site' : [ site ] }
extraParams[ 'plotTitle' ] = "CPU used for site %s" % site
elif plotName == "Running jobs":
typeName = "WMSHistory"
reportName = "NumberOfJobs"
grouping = "JobGroup"
condDict = { 'Site' : [ site ], 'Status' : [ 'Running' ] }
extraParams[ 'plotTitle' ] = "Jobs running for site %s" % site
else:
return S_ERROR( "Oops, invalid plot name!" )
if plotTime == "Last day":
extraParams[ 'lastSeconds' ] = 86400
elif plotTime == "Last week":
extraParams[ 'lastSeconds' ] = 604800
elif plotTime == "Last month":
extraParams[ 'lastSeconds' ] = 2592000
else:
return S_ERROR( "Oops, invalid time!" )
end = datetime.datetime.utcnow()
start = end - datetime.timedelta( seconds = extraParams[ 'lastSeconds' ] )
repClient = ReportsClient( rpcClient = getRPCClient( "Accounting/ReportGenerator" ) )
result = repClient.generateDelayedPlot( typeName, reportName, start, end, condDict, grouping, extraParams )
if not result[ 'OK' ]:
return S_ERROR( result[ 'Message' ] )
return S_OK( result[ 'Value' ][ 'plot' ] )