

def add_metric(self, metric_name, aggregate=None):
    ' Add a metric-aggregate pair to the benchmark, where metric is a number to measure from curl, and aggregate is an aggregation function\n            (See METRICS and AGGREGATES)\n            If aggregate is not defined (False,empty, or None), then the raw number is reported\n            Returns self, for fluent-syle construction of config '
    clean_metric = metric_name.lower().strip()
    if (clean_metric.lower() not in METRICS):
        raise Exception((('Metric named: ' + metric_name) + ' is not a valid benchmark metric.'))
    self.metrics.add(clean_metric)
    if (not aggregate):
        self.raw_metrics.add(self)
    elif (aggregate.lower().strip() in AGGREGATES):
        clean_aggregate = aggregate.lower().strip()
        current_aggregates = self.aggregated_metrics.get(clean_metric, list())
        current_aggregates.append(clean_aggregate)
        self.aggregated_metrics[clean_metric] = current_aggregates
    else:
        raise Exception((('Aggregate function ' + aggregate) + ' is not a legal aggregate function name'))
    return self

dataset/ETHPy150Open svanoort/pyresttest/pyresttest/benchmarks.py Benchmark.add_metric/VarMisuse@82/243 `clean_metric`->`self`