package com.cameleer.server.core.storage;

import com.cameleer.server.core.storage.model.MetricTimeSeries;

import java.time.Instant;
import java.util.List;
import java.util.Map;

public interface MetricsQueryStore {

    Map<String, List<MetricTimeSeries.Bucket>> queryTimeSeries(
            String instanceId, List<String> metricNames,
            Instant from, Instant to, int buckets);

    /** Counter mode: returns per-bucket deltas (max - previous max, floored at 0). */
    default Map<String, List<MetricTimeSeries.Bucket>> queryTimeSeriesDelta(
            String instanceId, List<String> metricNames,
            Instant from, Instant to, int buckets) {
        return queryTimeSeries(instanceId, metricNames, from, to, buckets);
    }
}
