Пример #1
0
"""
Reports breakdown of file(s) number/size in different staging states across Storage Elements.
Currently used Cache per SE is also reported. (active pins)
"""

__RCSID__ = "6f34186 (2013-06-13 15:12:35 +0200) Daniela <*****@*****.**>"
import DIRAC
from DIRAC.Core.Base import Script
from DIRAC import gConfig, gLogger, exit as DIRACExit, S_OK, version

Script.parseCommandLine(ignoreErrors=False)
from DIRAC.StorageManagementSystem.Client.StorageManagerClient import StorageManagerClient

client = StorageManagerClient()

res = client.getCacheReplicasSummary()
if not res["OK"]:
    print res["Message"]
    DIRACExit(2)
stagerInfo = res["Value"]
outStr = "\n"
outStr = "%s %s" % (outStr, "Status".ljust(20))
outStr = "%s %s" % (outStr, "SE".ljust(20))
outStr = "%s %s" % (outStr, "NumberOfFiles".ljust(20))
outStr = "%s %s" % (outStr, "Size(GB)".ljust(20))
outStr = "%s\n--------------------------------------------------------------------------\n" % outStr
if stagerInfo:
    for sid in stagerInfo:
        outStr = "%s %s" % (outStr, stagerInfo[sid]["Status"].ljust(20))
        outStr = "%s %s" % (outStr, stagerInfo[sid]["SE"].ljust(20))
        outStr = "%s %s" % (outStr, str(stagerInfo[sid]["NumFiles"]).ljust(20))
Пример #2
0
   --------------------- current status of the SE Caches from the DB-----------
   GRIDKA-RDST    :      6 replicas with a size of 29.141 GB.

"""

__RCSID__ = "$Id$"
from DIRAC.Core.Base import Script
from DIRAC import gConfig, gLogger, exit as DIRACExit, S_OK, version

Script.setUsageMessage(__doc__)
Script.parseCommandLine(ignoreErrors=False)
from DIRAC.StorageManagementSystem.Client.StorageManagerClient import StorageManagerClient
client = StorageManagerClient()

res = client.getCacheReplicasSummary()
if not res['OK']:
    gLogger.fatal(res['Message'])
    DIRACExit(2)
stagerInfo = res['Value']
outStr = "\n"
outStr += "  %s" % ("Status".ljust(20))
outStr += "  %s" % ("SE".ljust(20))
outStr += "  %s" % ("NumberOfFiles".ljust(20))
outStr += "  %s" % ("Size(GB)".ljust(20))
outStr += " \n--------------------------------------------------------------------------\n"
if stagerInfo:
    for info in stagerInfo.itervalues():
        outStr += "  %s" % (info['Status'].ljust(20))
        outStr += "  %s" % (info['SE'].ljust(20))
        outStr += "  %s" % (str(info['NumFiles']).ljust(20))