Skip to content

Add time-series transforms (rate / downsample / resample)#306

Merged
JE-Chen merged 2 commits into
devfrom
feat/timeseries-batch
Jun 21, 2026
Merged

Add time-series transforms (rate / downsample / resample)#306
JE-Chen merged 2 commits into
devfrom
feat/timeseries-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 21, 2026

Copy link
Copy Markdown
Member

What

observability counters/gauges store only the current value (no counter→rate anywhere) and cost_telemetry only buckets by day.

  • ts_rate(series, *, window_s=None) / ts_increase / ts_irate — Prometheus-style, reset-aware, over (timestamp, value) pairs.
  • ts_delta / ts_idelta — gauge first-to-last / last-two differences.
  • ts_downsample(series, bucket_s, agg) — tumbling buckets (avg/sum/min/max/first/last/count).
  • ts_resample(series, bucket_s, *, fill) — fixed grid (last/linear/None).

No wall clock — windows use the series' own timestamps, so everything is deterministic.

Layers

  • Headless core: utils/timeseries/ (pure stdlib bisect, zero PySide6).
  • Facade: 7 ts_* symbols + __all__.
  • Executor: AC_ts_rate, AC_ts_downsample.
  • MCP: ac_ts_rate, ac_ts_downsample (read-only).
  • Script Builder: both under Data.
  • Tests: test/unit_test/headless/test_timeseries_batch.py (11 tests, incl. counter reset + interpolation).
  • Docs: v98_features_doc.rst (EN + Zh) + toctrees + 3 README What's-new sections.

Verification

  • pytest test/unit_test/headless/test_timeseries_batch.py → 11 passed.
  • ruff check je_auto_control/ clean; pylint 10.00/10; bandit clean; radon CC clean.
  • Package stays Qt-free.

observability counters store only the current value (nothing turns a
counter into a per-second rate) and cost_telemetry only buckets by day.
Add Prometheus-style reset-aware ts_rate / ts_irate / ts_increase /
ts_delta / ts_idelta plus ts_downsample (tumbling buckets) and ts_resample
(grid, last/linear/none fill) over (timestamp, value) series. No wall
clock — windows use the series' own timestamps. Wired through facade,
executor (AC_ts_rate / AC_ts_downsample), MCP, and the Script Builder with
a headless test batch and EN/Zh docs.
@codacy-production

codacy-production Bot commented Jun 21, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 62 complexity · 0 duplication

Metric Results
Complexity 62
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit 438decc into dev Jun 21, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/timeseries-batch branch June 21, 2026 22:53
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant