Commit Graph

2 Commits

Author SHA1 Message Date
windpacer
3506a67c28 feat(report): P1b 연속집계 history_1min — 1초 버퍼 60초 롤업(장기 무손실)
온라인 히스토리안 2계층: history_1s(최근 14일, 고해상) + history_1min(장기, 60초).

- history_1min 연속집계(timescaledb.continuous): time_bucket('1 min') + last(value)/last(controller_id).
  refresh 정책(start 3h, end 10min, 5분마다) → 집계 lag ≪ 보존윈도(14일)이라 1초 raw evict 전 materialize.
- Hc900FastHistoryService.EnsureSchemaAsync에 cagg 생성+정책 멱등 추가. SQL 파일 동기화.

검증: 2계층 값 일치(1s last == 1min cagg), 정책 활성, 무손실 불변식 충족.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 07:13:12 +09:00
windpacer
7f67f0e54d feat(report): P1a 1초 링버퍼 히스토리안 (history_1s)
온라인 히스토리안 1계층 — 디스크 상한 고정 1초 버퍼.

- history_1s Timescale 하이퍼테이블(1h 청크) + 압축(6h) + 보존 14일(청크DROP, 디스크 상한 고정).
- Hc900FastHistoryService: 매 1초 realtime_table 큐레이션 태그 → history_1s append.
  기동 시 스키마/정책 멱등 생성. Hc900HistoryService(60s) 패턴.
- ReportColumnMap.HistorianTags(): 메트릭/마스크가 읽는 태그를 기존 config에서 유도(~105개,
  중복정의 없음) — 유량 .PV/.QV, 진공, 민감단 TC, 하부루프 .PV/.SP/.OP.
- Report:Historian config(Enabled/IntervalSeconds/RetentionDays).

검증: 라이브 초당 ~38행 append, 샘플 간격 ~1.004s, 보존/압축 정책 활성.
주의(데모): realtime 폴링이 areas 61/62/81만 커버 → 1s 버퍼도 해당 컬럼만(배포 시 전 컨트롤러).
1s 버퍼 주 가치는 .PV/.OP 동특성; .QV 적산은 60s로도 정확.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 04:56:15 +09:00