def compute()

in opmon/statistic.py [0:0]


    def compute(self, metric: Metric) -> str:
        """
        Return the statistic computation as SQL.

        The SQL needs to return ARRAY<STRUCT<
            metric STRING,
            statistic STRING,
            point FLOAT64,
            lower FLOAT64,
            upper FLOAT64,
            parameter STRING
        >>
        """
        if metric.type == "scalar":
            return self._scalar_compute(metric)
        elif metric.type == "histogram":
            return self._histogram_compute(metric)
        else:
            raise StatisticNotImplementedForTypeException(
                f"Statistic {self.name()} not implemented for type {metric.type} ({metric.name})"
            )