コード例 #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)
コード例 #2
0
ファイル: prometheus.py プロジェクト: opsani/servox
    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)
コード例 #3
0
ファイル: vegeta.py プロジェクト: opsani/servox
 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=[])
コード例 #4
0
 async def describe(
     self, control: servo.types.Control = servo.types.Control()
 ) -> servo.Description:
     return servo.Description(metrics=self.metrics())