Add Object Version count histogram (#16739)

This commit is contained in:
Klaus Post
2023-03-10 08:53:59 -08:00
committed by GitHub
parent 9800760cb3
commit d85da9236e
10 changed files with 363 additions and 37 deletions

View File

@@ -54,12 +54,13 @@ type objectHistogramInterval struct {
const (
// dataUsageBucketLen must be length of ObjectsHistogramIntervals
dataUsageBucketLen = 7
dataUsageBucketLen = 7
dataUsageVersionLen = 7
)
// ObjectsHistogramIntervals is the list of all intervals
// of object sizes to be included in objects histogram.
var ObjectsHistogramIntervals = []objectHistogramInterval{
var ObjectsHistogramIntervals = [dataUsageBucketLen]objectHistogramInterval{
{"LESS_THAN_1024_B", 0, humanize.KiByte - 1},
{"BETWEEN_1024_B_AND_1_MB", humanize.KiByte, humanize.MiByte - 1},
{"BETWEEN_1_MB_AND_10_MB", humanize.MiByte, humanize.MiByte*10 - 1},
@@ -69,6 +70,18 @@ var ObjectsHistogramIntervals = []objectHistogramInterval{
{"GREATER_THAN_512_MB", humanize.MiByte * 512, math.MaxInt64},
}
// ObjectsVersionCountIntervals is the list of all intervals
// of object version count to be included in objects histogram.
var ObjectsVersionCountIntervals = [dataUsageVersionLen]objectHistogramInterval{
{"UNVERSIONED", 0, 0},
{"SINGLE_VERSION", 1, 1},
{"BETWEEN_2_AND_10", 2, 9},
{"BETWEEN_10_AND_100", 10, 99},
{"BETWEEN_100_AND_1000", 100, 999},
{"BETWEEN_1000_AND_10000", 1000, 9999},
{"GREATER_THAN_10000", 10000, math.MaxInt64},
}
// BucketInfo - represents bucket metadata.
type BucketInfo struct {
// Name of the bucket.