Keep the metric list fast on a month of data

Open
#235 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
rust

Research direction

Start with the context in #207 and PR #234, then locate the metric name listing and the k-way merge over per-day-file Series ids. Measure the whole-range list call and how long it holds the files lock with 31 days of data; if it exceeds 2 seconds, investigate the candidate index and the ADR needed for that schema change. Done means the same call is under 2 seconds and does not delay retention or the day-file switch.

Written by the indexing model from the issue text.

Description

chore priority:low

As a homelab operator,
I want the metric list with Series counts to stay fast on a month of data,
so that opening the Metrics page never holds up cleanup or the midnight switch to a new day file.

Acceptance criteria

  • Given 31 days of data at the memory-proof size, when I list metric names over the whole range, then I record how long it takes and how long it holds the day-file lock.
  • Given that measurement is over 2 seconds, when the fix lands, then the same call is under 2 seconds.

Success signal: no retention drop or day-file switch waits behind a names read on the VM.
Out of scope: sorting by Series on the server.
Open questions: none.

Technical notes

From #207 (PR #234). The count is a k-way merge over per-day-file sorted Series ids, holding the files lock up to the 10 s statement deadline. Candidate fix: an index on series(name, kind, monotonic, unit, id), which is a schema change and needs its own ADR.

Dominant language
Rust
Stars
0
Forks
0
Avg merge
40m
Merged PRs (30d)
91

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jdrouet/tinyobserve

All issues in jdrouet/tinyobserve

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.