This repository was archived by the owner on Jan 20, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,19 +24,19 @@ var (
2424 MemNodeCount metric.Float64Gauge
2525 }{
2626 RestartLatency : must (meter .Float64Histogram (
27- "restart_latency_seconds " ,
27+ "restart_latency " ,
2828 metric .WithDescription ("Time taken to restart the memiavl database" ),
2929 metric .WithUnit ("s" ),
3030 )),
3131 SnapshotCreationLatency : must (meter .Float64Histogram (
32- "snapshot_creation_latency_seconds " ,
32+ "snapshot_creation_latency " ,
3333 metric .WithDescription ("Time taken to create memiavl snapshot" ),
3434 metric .WithUnit ("s" ),
3535 )),
3636 CommitLatency : must (meter .Float64Histogram (
37- "commit_latency_seconds " ,
37+ "commit_latency " ,
3838 metric .WithDescription ("Time taken to commit" ),
39- metric .WithUnit ("s " ),
39+ metric .WithUnit ("ms " ),
4040 )),
4141 MemNodeTotalSize : must (meter .Float64Gauge (
4242 "mem_node_total_size" ,
Original file line number Diff line number Diff line change @@ -457,7 +457,10 @@ func (db *DB) pruneSnapshots() {
457457func (db * DB ) Commit () (int64 , error ) {
458458 db .mtx .Lock ()
459459 defer db .mtx .Unlock ()
460-
460+ startTime := time .Now ()
461+ defer func () {
462+ metrics .SeiDBMetrics .CommitLatency .Record (context .Background (), time .Since (startTime ).Seconds ())
463+ }()
461464 if db .readOnly {
462465 return 0 , errReadOnly
463466 }
You can’t perform that action at this time.
0 commit comments