diff --git a/cmd/metrics-v2.go b/cmd/metrics-v2.go index 0e4ef78ec..d7043a135 100644 --- a/cmd/metrics-v2.go +++ b/cmd/metrics-v2.go @@ -319,7 +319,6 @@ type MetricDescription struct { Name MetricName `json:"MetricName"` Help string `json:"Help"` Type MetricTypeV2 `json:"Type"` - Buckets []float64 `json:"Buckets,omitempty"` } // MetricV2 captures the details for a metric @@ -1544,8 +1543,7 @@ func getS3TTFBDistributionMD() MetricDescription { Subsystem: ttfbSubsystem, Name: ttfbDistribution, Help: "Distribution of time to first byte across API calls", - Type: histogramMetric, - Buckets: []float64{0.01, 0.05, 0.1, 0.5, 1.0, 2.0, 5.0}, + Type: gaugeMetric, } } @@ -1555,8 +1553,7 @@ func getBucketTTFBDistributionMD() MetricDescription { Subsystem: ttfbSubsystem, Name: ttfbDistribution, Help: "Distribution of time to first byte across API calls per bucket", - Type: histogramMetric, - Buckets: []float64{0.01, 0.05, 0.1, 0.5, 1.0, 2.0, 5.0}, + Type: gaugeMetric, } } diff --git a/cmd/metrics-v2_gen.go b/cmd/metrics-v2_gen.go index 59a7ff84c..81f9fd9bb 100644 --- a/cmd/metrics-v2_gen.go +++ b/cmd/metrics-v2_gen.go @@ -9,9 +9,9 @@ import ( // MarshalMsg implements msgp.Marshaler func (z *MetricDescription) MarshalMsg(b []byte) (o []byte, err error) { o = msgp.Require(b, z.Msgsize()) - // map header, size 6 + // map header, size 5 // string "Namespace" - o = append(o, 0x86, 0xa9, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65) + o = append(o, 0x85, 0xa9, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65) o = msgp.AppendString(o, string(z.Namespace)) // string "Subsystem" o = append(o, 0xa9, 0x53, 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d) @@ -25,12 +25,6 @@ func (z *MetricDescription) MarshalMsg(b []byte) (o []byte, err error) { // string "Type" o = append(o, 0xa4, 0x54, 0x79, 0x70, 0x65) o = msgp.AppendString(o, string(z.Type)) - // string "Buckets" - o = append(o, 0xa7, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73) - o = msgp.AppendArrayHeader(o, uint32(len(z.Buckets))) - for za0001 := range z.Buckets { - o = msgp.AppendFloat64(o, z.Buckets[za0001]) - } return } @@ -98,25 +92,6 @@ func (z *MetricDescription) UnmarshalMsg(bts []byte) (o []byte, err error) { } z.Type = MetricTypeV2(zb0005) } - case "Buckets": - var zb0006 uint32 - zb0006, bts, err = msgp.ReadArrayHeaderBytes(bts) - if err != nil { - err = msgp.WrapError(err, "Buckets") - return - } - if cap(z.Buckets) >= int(zb0006) { - z.Buckets = (z.Buckets)[:zb0006] - } else { - z.Buckets = make([]float64, zb0006) - } - for za0001 := range z.Buckets { - z.Buckets[za0001], bts, err = msgp.ReadFloat64Bytes(bts) - if err != nil { - err = msgp.WrapError(err, "Buckets", za0001) - return - } - } default: bts, err = msgp.Skip(bts) if err != nil { @@ -131,7 +106,7 @@ func (z *MetricDescription) UnmarshalMsg(bts []byte) (o []byte, err error) { // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message func (z *MetricDescription) Msgsize() (s int) { - s = 1 + 10 + msgp.StringPrefixSize + len(string(z.Namespace)) + 10 + msgp.StringPrefixSize + len(string(z.Subsystem)) + 5 + msgp.StringPrefixSize + len(string(z.Name)) + 5 + msgp.StringPrefixSize + len(z.Help) + 5 + msgp.StringPrefixSize + len(string(z.Type)) + 8 + msgp.ArrayHeaderSize + (len(z.Buckets) * (msgp.Float64Size)) + s = 1 + 10 + msgp.StringPrefixSize + len(string(z.Namespace)) + 10 + msgp.StringPrefixSize + len(string(z.Subsystem)) + 5 + msgp.StringPrefixSize + len(string(z.Name)) + 5 + msgp.StringPrefixSize + len(z.Help) + 5 + msgp.StringPrefixSize + len(string(z.Type)) return }