当前位置: 首页>>代码示例>>Python>>正文


Python ReportsClient.generateDelayedPlot方法代码示例

本文整理汇总了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
开发者ID:DIRACGrid,项目名称:WebAppDIRAC,代码行数:10,代码来源:AccountingHandler.py

示例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']})
开发者ID:besdiracgrid,项目名称:BESDIRAC,代码行数:21,代码来源:TransferAccountingHandler.py

示例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' ] )
开发者ID:DIRACGrid,项目名称:DIRACWeb,代码行数:44,代码来源:siteMap.py


注:本文中的DIRAC.AccountingSystem.Client.ReportsClient.ReportsClient.generateDelayedPlot方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。