/** Redis 指标计数器 Hash key */
export const METRICS_COUNTERS_KEY = "metrics:counters";

/** 完成耗时样本列表（LPUSH + LTRIM） */
export const METRICS_LATENCY_KEY = "metrics:latency:done";

/** 询价开始时间 key 前缀 */
export const METRICS_QUOTE_START_PREFIX = "metrics:quote_start:";

/** 保留最近 N 条耗时样本用于 P95 */
export const METRICS_LATENCY_MAX_SAMPLES = 1000;

/** quote 开始时间 TTL（秒），覆盖 RPA 最长等待 */
export const METRICS_QUOTE_START_TTL_SECONDS = 120;

export const METRIC_COUNTER = {
  POST_TOTAL: "post_total",
  POST_DONE: "post_done",
  CACHE_HIT_L1: "cache_hit_l1",
  CACHE_HIT_L2: "cache_hit_l2",
  RPA_TRIGGERED: "rpa_triggered",
  RPA_DONE: "rpa_done",
  DONE_TOTAL: "done_total",
  DONE_REALTIME: "done_realtime",
} as const;
