Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing string values for CacheStatus type #15284

Closed
e-dard opened this issue Sep 26, 2019 · 0 comments · Fixed by #15306
Closed

Missing string values for CacheStatus type #15284

e-dard opened this issue Sep 26, 2019 · 0 comments · Fixed by #15306
Labels
area/storage difficulty/low Resolving this issue should take a day or two.

Comments

@e-dard
Copy link
Contributor

e-dard commented Sep 26, 2019

The metric used to track the reason why the Cache was snapshotted is not stringifying the reason label properly. The values used in the label are defined here:

// CacheStatus describes the current state of the cache, with respect to whether
// it is ready to be snapshotted or not.
type CacheStatus int
// Possible types of Cache status
const (
CacheStatusOkay CacheStatus = iota // Cache is Okay - do not snapshot.
CacheStatusSizeExceeded // The cache is large enough to be snapshotted.
CacheStatusAgeExceeded // The cache is past the age threshold to be snapshotted.
CacheStatusColdNoWrites // The cache has not been written to for long enough that it should be snapshotted.
CacheStatusRetention // The cache was snapshotted before running retention.
CacheStatusFullCompaction // The cache was snapshotted as part of a full compaction.
)

It looks like go generate needs to be run again for the stringer

//go:generate stringer -type=CacheStatus

This is the current situation:

storage_compactions_total{engine_id="x",level="snapshot",node_id="0",reason="CacheStatus(4)",status="ok"} 12
storage_compactions_total{engine_id="x",level="snapshot",node_id="0",reason="CacheStatusAgeExceeded",status="ok"} 64
storage_compactions_total{engine_id="x",level="1",node_id="0",reason="",status="ok"} 12
storage_compactions_total{engine_id="x",level="2",node_id="0",reason="",status="ok"} 3
storage_compactions_total{engine_id="x",level="3",node_id="0",reason="",status="ok"} 1
storage_compactions_total{engine_id="x",level="full",node_id="0",reason="",status="ok"} 1
storage_compactions_total{engine_id="x",level="snapshot",node_id="0",reason="CacheStatus(4)",status="ok"} 12
storage_compactions_total{engine_id="x",level="snapshot",node_id="0",reason="CacheStatusAgeExceeded",status="ok"} 64
storage_compactions_total{engine_id="x",level="1",node_id="0",reason="",status="ok"} 12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/storage difficulty/low Resolving this issue should take a day or two.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant