Пример #1
0
    def __init__(self, host: str, port, metric_name: str):
        """
        :param str host:             host of the OpenTSDB server
        :param int port:            port of the OpenTSDB server

        :param str metric_name:         mectric name to store


        :param report_model:        XXXModel object. Allow to read specific
                                    report with a specific format in a database
        :type report_model:         powerapi.ReportModel

        """
        BaseDB.__init__(self)
        self.host = host
        self.port = port
        self.metric_name = metric_name

        self.client = None
Пример #2
0
    def __init__(self, uri: str, port, db_name: str):
        """
        :param str url:             URL of the InfluxDB server
        :param int port:            port of the InfluxDB server

        :param str db_name:         database name in the influxdb
                                    (ex: "powerapi")

        :param report_model:        XXXModel object. Allow to read specific
                                    report with a specific format in a database
        :type report_model:         powerapi.ReportModel

        """
        BaseDB.__init__(self)
        self.uri = uri
        self.port = port
        self.db_name = db_name

        self.client = None
Пример #3
0
    def __init__(self, port: int, address: str, metric_name: str, metric_description: str, report_model: ReportModel, aggregation_periode: int):
        """
        :param address:             address that expose the metric
        :param port:
        :param metric_name:
        :param metric_description:  short sentence that describe the metric
        :param report_model:        model describing the receved report
        :param aggregation_periode: number of second for the value must be aggregated before compute statistics on them
        """
        BaseDB.__init__(self)
        self.address = address
        self.port = port
        self.metric_name = metric_name
        self.metric_description = metric_description
        self.report_model = report_model

        self.mean_metric = None
        self.std_metric = None

        self.buffer = StatBuffer(aggregation_periode)
Пример #4
0
 def __init__(self, *args, **kwargs):
     BaseDB.__init__(self, Report)
Пример #5
0
 def __init__(self, content=[], pipe=None, *args, **kwargs):
     BaseDB.__init__(self, Report)
     self._content = content
Пример #6
0
def mocked_database():
    """
    Return a BaseDB mocked object
    """
    return BaseDB(Mock(), Mock())
Пример #7
0
 def __init__(self, content=[], *args, **kwargs):
     BaseDB.__init__(self)
     self._content = content
     self.q = Queue()
     self.exceptions = [FakeDBError]
Пример #8
0
 def __init__(self, content=[], *args, **kwargs):
     BaseDB.__init__(self)
     self._content = content
     self.q = Queue()