-
Notifications
You must be signed in to change notification settings - Fork 178
Add a tsdbutil command to analyse churn etc. #478
Conversation
I've added a bit more to this, and tidied it up. |
97aa757
to
082cf18
Compare
e4c5938
to
bb56f83
Compare
All done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nits
@@ -383,3 +409,129 @@ func getFormatedTime(timestamp int64, humanReadable *bool) string { | |||
} | |||
return strconv.FormatInt(timestamp, 10) | |||
} | |||
|
|||
func analyzeBlock(b *tsdb.Block, limit int) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have single line comment at the beginning of each subsection of the code about what it is trying to calculate (in addition to Printf
at the ends)? (makes the code easier to follow)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that'd help much tbh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brian-brazil The code doesn't account for deleted data in the tombstone file, isn't this important?
bb56f83
to
0e4ef4f
Compare
I think that's everything addresses. |
@brian-brazil The code doesn't account for deleted data in the tombstone file, isn't this important? |
maybe also add an entry in the changelog file so that this is also included in the Prometheus changelog and the other maintainers/users know about it and start using it. |
Not really, as long as the data is in the index it's going to slow things down and use up RAM. |
This reports the cardinality of each label, the total number of label pairs, and how much series worth of time is "uncovered" by series data. Which is basically how much churn there is. Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
0e4ef4f
to
dbeb4a0
Compare
LGTM |
This reports the cardinality of each label, the total number of label pairs, and how much series worth of time is "uncovered" by series data. Which is basically how much churn there is. Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
This reports the cardinality of each label,
the total number of label pairs,
and how much series worth of time is "uncovered"
by series data. Which is basically how much churn there is.
Still needs UI work, but the core is there.