DBUtils

It is a helper module used to create a certain plot…

class DIRAC.MonitoringSystem.private.DBUtils.DBUtils(db, setup)

Bases: object

class DBUtils

It implements few methods used to create the plots.

param: list __units it is elasticsearch specific unites param: list __unitvalues the units in second param: list __esunits used to determine the buckets size

__init__(db, setup)

c’tor

Parameters:
  • self – self reference

  • db – the database module

  • setup (str) – DIRAC setup

getKeyValues(typeName, condDict)

Get all valid key values in a type

stripDataField(dataDict, fieldId)

Strip <fieldId> data and sum the rest as it was data from one key

Parameters:
  • dataDict (dict) –

    dictionary of the form:

    { 'key' : { <timeEpoch1>: [1, 2, 3],
                <timeEpoch2>: [3, 4, 5].. } }
    

    The dataDict is modified in this function and the return structure is:

    dataDict : { 'key' : { <timeEpoch1>: 1,
                           <timeEpoch2>: 3.. } }
    

  • fieldId (int) –

Returns:

list of dictionaries

[ { <timeEpoch1>: 2, <timeEpoch2>: 4... }
  { <timeEpoch1>: 3, <timeEpoch2>): 5... } ]

Return type:

list