Files
Klaus PostandGitHub 7549deaaa6 Update disk metrics (#435)
* Add time-segmented IO stats.
* Allow per pool disks.
* Add metric flags to eliminate bools.
* Add drive space metrics.
* Add generic time segmentation. Breaks "SegmentedAPIMetrics", but unused except maybe console.
* Rename `DiskMetrics` -> `DiskStatus` - I don't see anything breaking with EOS/ec update.
* Deprecate `DiskMetric.IOStats` - still used internally in EOS for prometheus.

Sending EOS/EC update.

* Add hanging drives

* Revert shorter name for segment header.  Upgrade msgp.
2025-09-04 08:19:11 -07:00

747 lines
16 KiB
Go

// Code generated by github.com/tinylib/msgp DO NOT EDIT.
package log
import (
"github.com/tinylib/msgp/msgp"
)
// DecodeMsg implements msgp.Decodable
func (z *Error) DecodeMsg(dc *msgp.Reader) (err error) {
var field []byte
_ = field
var zb0001 uint32
zb0001, err = dc.ReadMapHeader()
if err != nil {
err = msgp.WrapError(err)
return
}
var zb0001Mask uint8 /* 2 bits */
_ = zb0001Mask
for zb0001 > 0 {
zb0001--
field, err = dc.ReadMapKeyPtr()
if err != nil {
err = msgp.WrapError(err)
return
}
switch msgp.UnsafeString(field) {
case "version":
z.Version, err = dc.ReadString()
if err != nil {
err = msgp.WrapError(err, "Version")
return
}
case "node":
z.Node, err = dc.ReadString()
if err != nil {
err = msgp.WrapError(err, "Node")
return
}
case "time":
z.Time, err = dc.ReadTimeUTC()
if err != nil {
err = msgp.WrapError(err, "Time")
return
}
case "message":
z.Message, err = dc.ReadString()
if err != nil {
err = msgp.WrapError(err, "Message")
return
}
case "apiName":
z.API, err = dc.ReadString()
if err != nil {
err = msgp.WrapError(err, "API")
return
}
case "trace":
if dc.IsNil() {
err = dc.ReadNil()
if err != nil {
err = msgp.WrapError(err, "Trace")
return
}
z.Trace = nil
} else {
if z.Trace == nil {
z.Trace = new(Trace)
}
err = z.Trace.DecodeMsg(dc)
if err != nil {
err = msgp.WrapError(err, "Trace")
return
}
}
zb0001Mask |= 0x1
case "tags":
var zb0002 uint32
zb0002, err = dc.ReadMapHeader()
if err != nil {
err = msgp.WrapError(err, "Tags")
return
}
if z.Tags == nil {
z.Tags = make(map[string]string, zb0002)
} else if len(z.Tags) > 0 {
clear(z.Tags)
}
for zb0002 > 0 {
zb0002--
var za0001 string
za0001, err = dc.ReadString()
if err != nil {
err = msgp.WrapError(err, "Tags")
return
}
var za0002 string
za0002, err = dc.ReadString()
if err != nil {
err = msgp.WrapError(err, "Tags", za0001)
return
}
z.Tags[za0001] = za0002
}
zb0001Mask |= 0x2
default:
err = dc.Skip()
if err != nil {
err = msgp.WrapError(err)
return
}
}
}
// Clear omitted fields.
if zb0001Mask != 0x3 {
if (zb0001Mask & 0x1) == 0 {
z.Trace = nil
}
if (zb0001Mask & 0x2) == 0 {
z.Tags = nil
}
}
return
}
// EncodeMsg implements msgp.Encodable
func (z *Error) EncodeMsg(en *msgp.Writer) (err error) {
// check for omitted fields
zb0001Len := uint32(7)
var zb0001Mask uint8 /* 7 bits */
_ = zb0001Mask
if z.Trace == nil {
zb0001Len--
zb0001Mask |= 0x20
}
if z.Tags == nil {
zb0001Len--
zb0001Mask |= 0x40
}
// variable map header, size zb0001Len
err = en.Append(0x80 | uint8(zb0001Len))
if err != nil {
return
}
// skip if no fields are to be emitted
if zb0001Len != 0 {
// write "version"
err = en.Append(0xa7, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e)
if err != nil {
return
}
err = en.WriteString(z.Version)
if err != nil {
err = msgp.WrapError(err, "Version")
return
}
// write "node"
err = en.Append(0xa4, 0x6e, 0x6f, 0x64, 0x65)
if err != nil {
return
}
err = en.WriteString(z.Node)
if err != nil {
err = msgp.WrapError(err, "Node")
return
}
// write "time"
err = en.Append(0xa4, 0x74, 0x69, 0x6d, 0x65)
if err != nil {
return
}
err = en.WriteTime(z.Time)
if err != nil {
err = msgp.WrapError(err, "Time")
return
}
// write "message"
err = en.Append(0xa7, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65)
if err != nil {
return
}
err = en.WriteString(z.Message)
if err != nil {
err = msgp.WrapError(err, "Message")
return
}
// write "apiName"
err = en.Append(0xa7, 0x61, 0x70, 0x69, 0x4e, 0x61, 0x6d, 0x65)
if err != nil {
return
}
err = en.WriteString(z.API)
if err != nil {
err = msgp.WrapError(err, "API")
return
}
if (zb0001Mask & 0x20) == 0 { // if not omitted
// write "trace"
err = en.Append(0xa5, 0x74, 0x72, 0x61, 0x63, 0x65)
if err != nil {
return
}
if z.Trace == nil {
err = en.WriteNil()
if err != nil {
return
}
} else {
err = z.Trace.EncodeMsg(en)
if err != nil {
err = msgp.WrapError(err, "Trace")
return
}
}
}
if (zb0001Mask & 0x40) == 0 { // if not omitted
// write "tags"
err = en.Append(0xa4, 0x74, 0x61, 0x67, 0x73)
if err != nil {
return
}
err = en.WriteMapHeader(uint32(len(z.Tags)))
if err != nil {
err = msgp.WrapError(err, "Tags")
return
}
for za0001, za0002 := range z.Tags {
err = en.WriteString(za0001)
if err != nil {
err = msgp.WrapError(err, "Tags")
return
}
err = en.WriteString(za0002)
if err != nil {
err = msgp.WrapError(err, "Tags", za0001)
return
}
}
}
}
return
}
// MarshalMsg implements msgp.Marshaler
func (z *Error) MarshalMsg(b []byte) (o []byte, err error) {
o = msgp.Require(b, z.Msgsize())
// check for omitted fields
zb0001Len := uint32(7)
var zb0001Mask uint8 /* 7 bits */
_ = zb0001Mask
if z.Trace == nil {
zb0001Len--
zb0001Mask |= 0x20
}
if z.Tags == nil {
zb0001Len--
zb0001Mask |= 0x40
}
// variable map header, size zb0001Len
o = append(o, 0x80|uint8(zb0001Len))
// skip if no fields are to be emitted
if zb0001Len != 0 {
// string "version"
o = append(o, 0xa7, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e)
o = msgp.AppendString(o, z.Version)
// string "node"
o = append(o, 0xa4, 0x6e, 0x6f, 0x64, 0x65)
o = msgp.AppendString(o, z.Node)
// string "time"
o = append(o, 0xa4, 0x74, 0x69, 0x6d, 0x65)
o = msgp.AppendTime(o, z.Time)
// string "message"
o = append(o, 0xa7, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65)
o = msgp.AppendString(o, z.Message)
// string "apiName"
o = append(o, 0xa7, 0x61, 0x70, 0x69, 0x4e, 0x61, 0x6d, 0x65)
o = msgp.AppendString(o, z.API)
if (zb0001Mask & 0x20) == 0 { // if not omitted
// string "trace"
o = append(o, 0xa5, 0x74, 0x72, 0x61, 0x63, 0x65)
if z.Trace == nil {
o = msgp.AppendNil(o)
} else {
o, err = z.Trace.MarshalMsg(o)
if err != nil {
err = msgp.WrapError(err, "Trace")
return
}
}
}
if (zb0001Mask & 0x40) == 0 { // if not omitted
// string "tags"
o = append(o, 0xa4, 0x74, 0x61, 0x67, 0x73)
o = msgp.AppendMapHeader(o, uint32(len(z.Tags)))
for za0001, za0002 := range z.Tags {
o = msgp.AppendString(o, za0001)
o = msgp.AppendString(o, za0002)
}
}
}
return
}
// UnmarshalMsg implements msgp.Unmarshaler
func (z *Error) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var zb0001 uint32
zb0001, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
err = msgp.WrapError(err)
return
}
var zb0001Mask uint8 /* 2 bits */
_ = zb0001Mask
for zb0001 > 0 {
zb0001--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
err = msgp.WrapError(err)
return
}
switch msgp.UnsafeString(field) {
case "version":
z.Version, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
err = msgp.WrapError(err, "Version")
return
}
case "node":
z.Node, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
err = msgp.WrapError(err, "Node")
return
}
case "time":
z.Time, bts, err = msgp.ReadTimeUTCBytes(bts)
if err != nil {
err = msgp.WrapError(err, "Time")
return
}
case "message":
z.Message, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
err = msgp.WrapError(err, "Message")
return
}
case "apiName":
z.API, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
err = msgp.WrapError(err, "API")
return
}
case "trace":
if msgp.IsNil(bts) {
bts, err = msgp.ReadNilBytes(bts)
if err != nil {
return
}
z.Trace = nil
} else {
if z.Trace == nil {
z.Trace = new(Trace)
}
bts, err = z.Trace.UnmarshalMsg(bts)
if err != nil {
err = msgp.WrapError(err, "Trace")
return
}
}
zb0001Mask |= 0x1
case "tags":
var zb0002 uint32
zb0002, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
err = msgp.WrapError(err, "Tags")
return
}
if z.Tags == nil {
z.Tags = make(map[string]string, zb0002)
} else if len(z.Tags) > 0 {
clear(z.Tags)
}
for zb0002 > 0 {
var za0002 string
zb0002--
var za0001 string
za0001, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
err = msgp.WrapError(err, "Tags")
return
}
za0002, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
err = msgp.WrapError(err, "Tags", za0001)
return
}
z.Tags[za0001] = za0002
}
zb0001Mask |= 0x2
default:
bts, err = msgp.Skip(bts)
if err != nil {
err = msgp.WrapError(err)
return
}
}
}
// Clear omitted fields.
if zb0001Mask != 0x3 {
if (zb0001Mask & 0x1) == 0 {
z.Trace = nil
}
if (zb0001Mask & 0x2) == 0 {
z.Tags = nil
}
}
o = bts
return
}
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (z *Error) Msgsize() (s int) {
s = 1 + 8 + msgp.StringPrefixSize + len(z.Version) + 5 + msgp.StringPrefixSize + len(z.Node) + 5 + msgp.TimeSize + 8 + msgp.StringPrefixSize + len(z.Message) + 8 + msgp.StringPrefixSize + len(z.API) + 6
if z.Trace == nil {
s += msgp.NilSize
} else {
s += z.Trace.Msgsize()
}
s += 5 + msgp.MapHeaderSize
if z.Tags != nil {
for za0001, za0002 := range z.Tags {
_ = za0002
s += msgp.StringPrefixSize + len(za0001) + msgp.StringPrefixSize + len(za0002)
}
}
return
}
// DecodeMsg implements msgp.Decodable
func (z *Trace) DecodeMsg(dc *msgp.Reader) (err error) {
var field []byte
_ = field
var zb0001 uint32
zb0001, err = dc.ReadMapHeader()
if err != nil {
err = msgp.WrapError(err)
return
}
var zb0001Mask uint8 /* 2 bits */
_ = zb0001Mask
for zb0001 > 0 {
zb0001--
field, err = dc.ReadMapKeyPtr()
if err != nil {
err = msgp.WrapError(err)
return
}
switch msgp.UnsafeString(field) {
case "source":
var zb0002 uint32
zb0002, err = dc.ReadArrayHeader()
if err != nil {
err = msgp.WrapError(err, "Source")
return
}
if cap(z.Source) >= int(zb0002) {
z.Source = (z.Source)[:zb0002]
} else {
z.Source = make([]string, zb0002)
}
for za0001 := range z.Source {
z.Source[za0001], err = dc.ReadString()
if err != nil {
err = msgp.WrapError(err, "Source", za0001)
return
}
}
zb0001Mask |= 0x1
case "variables":
var zb0003 uint32
zb0003, err = dc.ReadMapHeader()
if err != nil {
err = msgp.WrapError(err, "Variables")
return
}
if z.Variables == nil {
z.Variables = make(map[string]string, zb0003)
} else if len(z.Variables) > 0 {
clear(z.Variables)
}
for zb0003 > 0 {
zb0003--
var za0002 string
za0002, err = dc.ReadString()
if err != nil {
err = msgp.WrapError(err, "Variables")
return
}
var za0003 string
za0003, err = dc.ReadString()
if err != nil {
err = msgp.WrapError(err, "Variables", za0002)
return
}
z.Variables[za0002] = za0003
}
zb0001Mask |= 0x2
default:
err = dc.Skip()
if err != nil {
err = msgp.WrapError(err)
return
}
}
}
// Clear omitted fields.
if zb0001Mask != 0x3 {
if (zb0001Mask & 0x1) == 0 {
z.Source = nil
}
if (zb0001Mask & 0x2) == 0 {
z.Variables = nil
}
}
return
}
// EncodeMsg implements msgp.Encodable
func (z *Trace) EncodeMsg(en *msgp.Writer) (err error) {
// check for omitted fields
zb0001Len := uint32(2)
var zb0001Mask uint8 /* 2 bits */
_ = zb0001Mask
if z.Source == nil {
zb0001Len--
zb0001Mask |= 0x1
}
if z.Variables == nil {
zb0001Len--
zb0001Mask |= 0x2
}
// variable map header, size zb0001Len
err = en.Append(0x80 | uint8(zb0001Len))
if err != nil {
return
}
// skip if no fields are to be emitted
if zb0001Len != 0 {
if (zb0001Mask & 0x1) == 0 { // if not omitted
// write "source"
err = en.Append(0xa6, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65)
if err != nil {
return
}
err = en.WriteArrayHeader(uint32(len(z.Source)))
if err != nil {
err = msgp.WrapError(err, "Source")
return
}
for za0001 := range z.Source {
err = en.WriteString(z.Source[za0001])
if err != nil {
err = msgp.WrapError(err, "Source", za0001)
return
}
}
}
if (zb0001Mask & 0x2) == 0 { // if not omitted
// write "variables"
err = en.Append(0xa9, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73)
if err != nil {
return
}
err = en.WriteMapHeader(uint32(len(z.Variables)))
if err != nil {
err = msgp.WrapError(err, "Variables")
return
}
for za0002, za0003 := range z.Variables {
err = en.WriteString(za0002)
if err != nil {
err = msgp.WrapError(err, "Variables")
return
}
err = en.WriteString(za0003)
if err != nil {
err = msgp.WrapError(err, "Variables", za0002)
return
}
}
}
}
return
}
// MarshalMsg implements msgp.Marshaler
func (z *Trace) MarshalMsg(b []byte) (o []byte, err error) {
o = msgp.Require(b, z.Msgsize())
// check for omitted fields
zb0001Len := uint32(2)
var zb0001Mask uint8 /* 2 bits */
_ = zb0001Mask
if z.Source == nil {
zb0001Len--
zb0001Mask |= 0x1
}
if z.Variables == nil {
zb0001Len--
zb0001Mask |= 0x2
}
// variable map header, size zb0001Len
o = append(o, 0x80|uint8(zb0001Len))
// skip if no fields are to be emitted
if zb0001Len != 0 {
if (zb0001Mask & 0x1) == 0 { // if not omitted
// string "source"
o = append(o, 0xa6, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65)
o = msgp.AppendArrayHeader(o, uint32(len(z.Source)))
for za0001 := range z.Source {
o = msgp.AppendString(o, z.Source[za0001])
}
}
if (zb0001Mask & 0x2) == 0 { // if not omitted
// string "variables"
o = append(o, 0xa9, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73)
o = msgp.AppendMapHeader(o, uint32(len(z.Variables)))
for za0002, za0003 := range z.Variables {
o = msgp.AppendString(o, za0002)
o = msgp.AppendString(o, za0003)
}
}
}
return
}
// UnmarshalMsg implements msgp.Unmarshaler
func (z *Trace) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var zb0001 uint32
zb0001, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
err = msgp.WrapError(err)
return
}
var zb0001Mask uint8 /* 2 bits */
_ = zb0001Mask
for zb0001 > 0 {
zb0001--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
err = msgp.WrapError(err)
return
}
switch msgp.UnsafeString(field) {
case "source":
var zb0002 uint32
zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
if err != nil {
err = msgp.WrapError(err, "Source")
return
}
if cap(z.Source) >= int(zb0002) {
z.Source = (z.Source)[:zb0002]
} else {
z.Source = make([]string, zb0002)
}
for za0001 := range z.Source {
z.Source[za0001], bts, err = msgp.ReadStringBytes(bts)
if err != nil {
err = msgp.WrapError(err, "Source", za0001)
return
}
}
zb0001Mask |= 0x1
case "variables":
var zb0003 uint32
zb0003, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
err = msgp.WrapError(err, "Variables")
return
}
if z.Variables == nil {
z.Variables = make(map[string]string, zb0003)
} else if len(z.Variables) > 0 {
clear(z.Variables)
}
for zb0003 > 0 {
var za0003 string
zb0003--
var za0002 string
za0002, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
err = msgp.WrapError(err, "Variables")
return
}
za0003, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
err = msgp.WrapError(err, "Variables", za0002)
return
}
z.Variables[za0002] = za0003
}
zb0001Mask |= 0x2
default:
bts, err = msgp.Skip(bts)
if err != nil {
err = msgp.WrapError(err)
return
}
}
}
// Clear omitted fields.
if zb0001Mask != 0x3 {
if (zb0001Mask & 0x1) == 0 {
z.Source = nil
}
if (zb0001Mask & 0x2) == 0 {
z.Variables = nil
}
}
o = bts
return
}
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (z *Trace) Msgsize() (s int) {
s = 1 + 7 + msgp.ArrayHeaderSize
for za0001 := range z.Source {
s += msgp.StringPrefixSize + len(z.Source[za0001])
}
s += 10 + msgp.MapHeaderSize
if z.Variables != nil {
for za0002, za0003 := range z.Variables {
_ = za0003
s += msgp.StringPrefixSize + len(za0002) + msgp.StringPrefixSize + len(za0003)
}
}
return
}