You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add metrics tracking time to restore a database from disk (#3285)
# Description of Changes
Inspired by a question @Shubham8287 asked me: how long does it take to
replay real production databases, e.g. a BitCraft region module? I did
not have a good answer, and didn't know how I could get an answer.
Add 5 new metrics:
- `replay_total_time_seconds(db: Identity)`, total time to read and
restore snapshot and replay commitlog.
- `replay_snapshot_read_time_seconds(db: Identity)`, time to read
snapshot from disk.
- `replay_snapshot_restore_time_seconds(db: Identity)`, time to restore
snapshot once it's already in memory.
- `replay_commitlog_time_seconds(db: Identity)`, time to replay
commitlog once snapshot is restored.
- `replay_commitlog_num_commits(db: Identity)`, number of commits
visited during commitlog replay, i.e. the length of the suffix after the
most recent usable snapshot.
All of these are `Gauge`s (or `IntGauge` for the `num_commits` metric),
as we expect observations to be very infrequent
(approx. once per label value per SpacetimeDB process).
# API and ABI breaking changes
N/a
# Expected complexity level and risk
1
# Testing
I remain unsure how to test metrics. This won't break anything, though,
so I'm not worried.
0 commit comments