Ejemplo n.º 1
0
def _random_description() -> servo.Description:
    components = COMPONENTS.copy()
    metrics = METRICS.copy()

    for component in components:
        for setting in component.settings:
            setting.value = _random_value_for_setting(setting)

    return servo.Description(metrics=metrics, components=components)
Ejemplo n.º 2
0
    def describe(
        self, control: servo.Control = servo.Control()) -> servo.Description:
        """Describes the current state of Metrics measured by querying Prometheus.

        Returns:
            Description: An object describing the current state of metrics
                queried from Prometheus.
        """
        return servo.Description(metrics=self.config.metrics)
Ejemplo n.º 3
0
 def describe(
     self, control: servo.Control = servo.Control()) -> servo.Description:
     """
     Describes the metrics and components exported by the connector.
     """
     return servo.Description(metrics=METRICS, components=[])
Ejemplo n.º 4
0
 async def describe(
     self, control: servo.types.Control = servo.types.Control()
 ) -> servo.Description:
     return servo.Description(metrics=self.metrics())