def aggregate_one_region_operation_metric(aggregateMetric, deltaMetric):
  if OPERATION_NUM_OPS in deltaMetric:
    aggregateMetric[OPERATION_NUM_OPS] += deltaMetric[OPERATION_NUM_OPS]
    aggregateMetric[OPERATION_TOTAL_TIME] += (deltaMetric[OPERATION_AVG_TIME]
      * deltaMetric[OPERATION_NUM_OPS])
    if aggregateMetric[OPERATION_MAX_TIME] < deltaMetric[OPERATION_MAX_TIME]:
      aggregateMetric[OPERATION_MAX_TIME] = deltaMetric[OPERATION_MAX_TIME]
    if aggregateMetric[OPERATION_MIN_TIME] > deltaMetric[OPERATION_MIN_TIME]:
      aggregateMetric[OPERATION_MIN_TIME] = deltaMetric[OPERATION_MIN_TIME]
dataset/ETHPy150Open XiaoMi/minos/owl/collector/management/commands/metrics_aggregator.py/aggregate_one_region_operation_metric/original