diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 7dc4ce3..1a15cd2 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go-version: [1.22.x] + go-version: [1.22.x,1.23.x] steps: - name: Set up Go ${{ matrix.go-version }} uses: actions/setup-go@v5 diff --git a/external.go b/external.go new file mode 100644 index 0000000..190edfa --- /dev/null +++ b/external.go @@ -0,0 +1,68 @@ +// +// Copyright (c) 2015-2022 MinIO, Inc. +// +// This file is part of MinIO Object Storage stack +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . +// + +package madmin + +// Provide msgp for external types. +// If updating packages breaks this, update structs below. + +//msgp:clearomitted +//msgp:tag json +//go:generate msgp -unexported + +type cpuTimesStat struct { + CPU string `json:"cpu"` + User float64 `json:"user"` + System float64 `json:"system"` + Idle float64 `json:"idle"` + Nice float64 `json:"nice"` + Iowait float64 `json:"iowait"` + Irq float64 `json:"irq"` + Softirq float64 `json:"softirq"` + Steal float64 `json:"steal"` + Guest float64 `json:"guest"` + GuestNice float64 `json:"guestNice"` +} + +type loadAvgStat struct { + Load1 float64 `json:"load1"` + Load5 float64 `json:"load5"` + Load15 float64 `json:"load15"` +} + +// NetDevLine is single line parsed from /proc/net/dev or /proc/[pid]/net/dev. +type procfsNetDevLine struct { + Name string `json:"name"` // The name of the interface. + RxBytes uint64 `json:"rx_bytes"` // Cumulative count of bytes received. + RxPackets uint64 `json:"rx_packets"` // Cumulative count of packets received. + RxErrors uint64 `json:"rx_errors"` // Cumulative count of receive errors encountered. + RxDropped uint64 `json:"rx_dropped"` // Cumulative count of packets dropped while receiving. + RxFIFO uint64 `json:"rx_fifo"` // Cumulative count of FIFO buffer errors. + RxFrame uint64 `json:"rx_frame"` // Cumulative count of packet framing errors. + RxCompressed uint64 `json:"rx_compressed"` // Cumulative count of compressed packets received by the device driver. + RxMulticast uint64 `json:"rx_multicast"` // Cumulative count of multicast frames received by the device driver. + TxBytes uint64 `json:"tx_bytes"` // Cumulative count of bytes transmitted. + TxPackets uint64 `json:"tx_packets"` // Cumulative count of packets transmitted. + TxErrors uint64 `json:"tx_errors"` // Cumulative count of transmit errors encountered. + TxDropped uint64 `json:"tx_dropped"` // Cumulative count of packets dropped while transmitting. + TxFIFO uint64 `json:"tx_fifo"` // Cumulative count of FIFO buffer errors. + TxCollisions uint64 `json:"tx_collisions"` // Cumulative count of collisions detected on the interface. + TxCarrier uint64 `json:"tx_carrier"` // Cumulative count of carrier losses detected by the device driver. + TxCompressed uint64 `json:"tx_compressed"` // Cumulative count of compressed packets transmitted by the device driver. +} diff --git a/external_gen.go b/external_gen.go new file mode 100644 index 0000000..baf6d54 --- /dev/null +++ b/external_gen.go @@ -0,0 +1,1016 @@ +package madmin + +// Code generated by github.com/tinylib/msgp DO NOT EDIT. + +import ( + "github.com/tinylib/msgp/msgp" +) + +// DecodeMsg implements msgp.Decodable +func (z *cpuTimesStat) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "cpu": + z.CPU, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "CPU") + return + } + case "user": + z.User, err = dc.ReadFloat64() + if err != nil { + err = msgp.WrapError(err, "User") + return + } + case "system": + z.System, err = dc.ReadFloat64() + if err != nil { + err = msgp.WrapError(err, "System") + return + } + case "idle": + z.Idle, err = dc.ReadFloat64() + if err != nil { + err = msgp.WrapError(err, "Idle") + return + } + case "nice": + z.Nice, err = dc.ReadFloat64() + if err != nil { + err = msgp.WrapError(err, "Nice") + return + } + case "iowait": + z.Iowait, err = dc.ReadFloat64() + if err != nil { + err = msgp.WrapError(err, "Iowait") + return + } + case "irq": + z.Irq, err = dc.ReadFloat64() + if err != nil { + err = msgp.WrapError(err, "Irq") + return + } + case "softirq": + z.Softirq, err = dc.ReadFloat64() + if err != nil { + err = msgp.WrapError(err, "Softirq") + return + } + case "steal": + z.Steal, err = dc.ReadFloat64() + if err != nil { + err = msgp.WrapError(err, "Steal") + return + } + case "guest": + z.Guest, err = dc.ReadFloat64() + if err != nil { + err = msgp.WrapError(err, "Guest") + return + } + case "guestNice": + z.GuestNice, err = dc.ReadFloat64() + if err != nil { + err = msgp.WrapError(err, "GuestNice") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *cpuTimesStat) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 11 + // write "cpu" + err = en.Append(0x8b, 0xa3, 0x63, 0x70, 0x75) + if err != nil { + return + } + err = en.WriteString(z.CPU) + if err != nil { + err = msgp.WrapError(err, "CPU") + return + } + // write "user" + err = en.Append(0xa4, 0x75, 0x73, 0x65, 0x72) + if err != nil { + return + } + err = en.WriteFloat64(z.User) + if err != nil { + err = msgp.WrapError(err, "User") + return + } + // write "system" + err = en.Append(0xa6, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d) + if err != nil { + return + } + err = en.WriteFloat64(z.System) + if err != nil { + err = msgp.WrapError(err, "System") + return + } + // write "idle" + err = en.Append(0xa4, 0x69, 0x64, 0x6c, 0x65) + if err != nil { + return + } + err = en.WriteFloat64(z.Idle) + if err != nil { + err = msgp.WrapError(err, "Idle") + return + } + // write "nice" + err = en.Append(0xa4, 0x6e, 0x69, 0x63, 0x65) + if err != nil { + return + } + err = en.WriteFloat64(z.Nice) + if err != nil { + err = msgp.WrapError(err, "Nice") + return + } + // write "iowait" + err = en.Append(0xa6, 0x69, 0x6f, 0x77, 0x61, 0x69, 0x74) + if err != nil { + return + } + err = en.WriteFloat64(z.Iowait) + if err != nil { + err = msgp.WrapError(err, "Iowait") + return + } + // write "irq" + err = en.Append(0xa3, 0x69, 0x72, 0x71) + if err != nil { + return + } + err = en.WriteFloat64(z.Irq) + if err != nil { + err = msgp.WrapError(err, "Irq") + return + } + // write "softirq" + err = en.Append(0xa7, 0x73, 0x6f, 0x66, 0x74, 0x69, 0x72, 0x71) + if err != nil { + return + } + err = en.WriteFloat64(z.Softirq) + if err != nil { + err = msgp.WrapError(err, "Softirq") + return + } + // write "steal" + err = en.Append(0xa5, 0x73, 0x74, 0x65, 0x61, 0x6c) + if err != nil { + return + } + err = en.WriteFloat64(z.Steal) + if err != nil { + err = msgp.WrapError(err, "Steal") + return + } + // write "guest" + err = en.Append(0xa5, 0x67, 0x75, 0x65, 0x73, 0x74) + if err != nil { + return + } + err = en.WriteFloat64(z.Guest) + if err != nil { + err = msgp.WrapError(err, "Guest") + return + } + // write "guestNice" + err = en.Append(0xa9, 0x67, 0x75, 0x65, 0x73, 0x74, 0x4e, 0x69, 0x63, 0x65) + if err != nil { + return + } + err = en.WriteFloat64(z.GuestNice) + if err != nil { + err = msgp.WrapError(err, "GuestNice") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *cpuTimesStat) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 11 + // string "cpu" + o = append(o, 0x8b, 0xa3, 0x63, 0x70, 0x75) + o = msgp.AppendString(o, z.CPU) + // string "user" + o = append(o, 0xa4, 0x75, 0x73, 0x65, 0x72) + o = msgp.AppendFloat64(o, z.User) + // string "system" + o = append(o, 0xa6, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d) + o = msgp.AppendFloat64(o, z.System) + // string "idle" + o = append(o, 0xa4, 0x69, 0x64, 0x6c, 0x65) + o = msgp.AppendFloat64(o, z.Idle) + // string "nice" + o = append(o, 0xa4, 0x6e, 0x69, 0x63, 0x65) + o = msgp.AppendFloat64(o, z.Nice) + // string "iowait" + o = append(o, 0xa6, 0x69, 0x6f, 0x77, 0x61, 0x69, 0x74) + o = msgp.AppendFloat64(o, z.Iowait) + // string "irq" + o = append(o, 0xa3, 0x69, 0x72, 0x71) + o = msgp.AppendFloat64(o, z.Irq) + // string "softirq" + o = append(o, 0xa7, 0x73, 0x6f, 0x66, 0x74, 0x69, 0x72, 0x71) + o = msgp.AppendFloat64(o, z.Softirq) + // string "steal" + o = append(o, 0xa5, 0x73, 0x74, 0x65, 0x61, 0x6c) + o = msgp.AppendFloat64(o, z.Steal) + // string "guest" + o = append(o, 0xa5, 0x67, 0x75, 0x65, 0x73, 0x74) + o = msgp.AppendFloat64(o, z.Guest) + // string "guestNice" + o = append(o, 0xa9, 0x67, 0x75, 0x65, 0x73, 0x74, 0x4e, 0x69, 0x63, 0x65) + o = msgp.AppendFloat64(o, z.GuestNice) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *cpuTimesStat) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "cpu": + z.CPU, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "CPU") + return + } + case "user": + z.User, bts, err = msgp.ReadFloat64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "User") + return + } + case "system": + z.System, bts, err = msgp.ReadFloat64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "System") + return + } + case "idle": + z.Idle, bts, err = msgp.ReadFloat64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Idle") + return + } + case "nice": + z.Nice, bts, err = msgp.ReadFloat64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Nice") + return + } + case "iowait": + z.Iowait, bts, err = msgp.ReadFloat64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Iowait") + return + } + case "irq": + z.Irq, bts, err = msgp.ReadFloat64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Irq") + return + } + case "softirq": + z.Softirq, bts, err = msgp.ReadFloat64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Softirq") + return + } + case "steal": + z.Steal, bts, err = msgp.ReadFloat64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Steal") + return + } + case "guest": + z.Guest, bts, err = msgp.ReadFloat64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Guest") + return + } + case "guestNice": + z.GuestNice, bts, err = msgp.ReadFloat64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "GuestNice") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *cpuTimesStat) Msgsize() (s int) { + s = 1 + 4 + msgp.StringPrefixSize + len(z.CPU) + 5 + msgp.Float64Size + 7 + msgp.Float64Size + 5 + msgp.Float64Size + 5 + msgp.Float64Size + 7 + msgp.Float64Size + 4 + msgp.Float64Size + 8 + msgp.Float64Size + 6 + msgp.Float64Size + 6 + msgp.Float64Size + 10 + msgp.Float64Size + return +} + +// DecodeMsg implements msgp.Decodable +func (z *loadAvgStat) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "load1": + z.Load1, err = dc.ReadFloat64() + if err != nil { + err = msgp.WrapError(err, "Load1") + return + } + case "load5": + z.Load5, err = dc.ReadFloat64() + if err != nil { + err = msgp.WrapError(err, "Load5") + return + } + case "load15": + z.Load15, err = dc.ReadFloat64() + if err != nil { + err = msgp.WrapError(err, "Load15") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z loadAvgStat) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 3 + // write "load1" + err = en.Append(0x83, 0xa5, 0x6c, 0x6f, 0x61, 0x64, 0x31) + if err != nil { + return + } + err = en.WriteFloat64(z.Load1) + if err != nil { + err = msgp.WrapError(err, "Load1") + return + } + // write "load5" + err = en.Append(0xa5, 0x6c, 0x6f, 0x61, 0x64, 0x35) + if err != nil { + return + } + err = en.WriteFloat64(z.Load5) + if err != nil { + err = msgp.WrapError(err, "Load5") + return + } + // write "load15" + err = en.Append(0xa6, 0x6c, 0x6f, 0x61, 0x64, 0x31, 0x35) + if err != nil { + return + } + err = en.WriteFloat64(z.Load15) + if err != nil { + err = msgp.WrapError(err, "Load15") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z loadAvgStat) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 3 + // string "load1" + o = append(o, 0x83, 0xa5, 0x6c, 0x6f, 0x61, 0x64, 0x31) + o = msgp.AppendFloat64(o, z.Load1) + // string "load5" + o = append(o, 0xa5, 0x6c, 0x6f, 0x61, 0x64, 0x35) + o = msgp.AppendFloat64(o, z.Load5) + // string "load15" + o = append(o, 0xa6, 0x6c, 0x6f, 0x61, 0x64, 0x31, 0x35) + o = msgp.AppendFloat64(o, z.Load15) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *loadAvgStat) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "load1": + z.Load1, bts, err = msgp.ReadFloat64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Load1") + return + } + case "load5": + z.Load5, bts, err = msgp.ReadFloat64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Load5") + return + } + case "load15": + z.Load15, bts, err = msgp.ReadFloat64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Load15") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z loadAvgStat) Msgsize() (s int) { + s = 1 + 6 + msgp.Float64Size + 6 + msgp.Float64Size + 7 + msgp.Float64Size + return +} + +// DecodeMsg implements msgp.Decodable +func (z *procfsNetDevLine) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "name": + z.Name, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Name") + return + } + case "rx_bytes": + z.RxBytes, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "RxBytes") + return + } + case "rx_packets": + z.RxPackets, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "RxPackets") + return + } + case "rx_errors": + z.RxErrors, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "RxErrors") + return + } + case "rx_dropped": + z.RxDropped, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "RxDropped") + return + } + case "rx_fifo": + z.RxFIFO, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "RxFIFO") + return + } + case "rx_frame": + z.RxFrame, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "RxFrame") + return + } + case "rx_compressed": + z.RxCompressed, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "RxCompressed") + return + } + case "rx_multicast": + z.RxMulticast, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "RxMulticast") + return + } + case "tx_bytes": + z.TxBytes, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "TxBytes") + return + } + case "tx_packets": + z.TxPackets, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "TxPackets") + return + } + case "tx_errors": + z.TxErrors, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "TxErrors") + return + } + case "tx_dropped": + z.TxDropped, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "TxDropped") + return + } + case "tx_fifo": + z.TxFIFO, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "TxFIFO") + return + } + case "tx_collisions": + z.TxCollisions, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "TxCollisions") + return + } + case "tx_carrier": + z.TxCarrier, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "TxCarrier") + return + } + case "tx_compressed": + z.TxCompressed, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "TxCompressed") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *procfsNetDevLine) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 17 + // write "name" + err = en.Append(0xde, 0x0, 0x11, 0xa4, 0x6e, 0x61, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteString(z.Name) + if err != nil { + err = msgp.WrapError(err, "Name") + return + } + // write "rx_bytes" + err = en.Append(0xa8, 0x72, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.RxBytes) + if err != nil { + err = msgp.WrapError(err, "RxBytes") + return + } + // write "rx_packets" + err = en.Append(0xaa, 0x72, 0x78, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.RxPackets) + if err != nil { + err = msgp.WrapError(err, "RxPackets") + return + } + // write "rx_errors" + err = en.Append(0xa9, 0x72, 0x78, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.RxErrors) + if err != nil { + err = msgp.WrapError(err, "RxErrors") + return + } + // write "rx_dropped" + err = en.Append(0xaa, 0x72, 0x78, 0x5f, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteUint64(z.RxDropped) + if err != nil { + err = msgp.WrapError(err, "RxDropped") + return + } + // write "rx_fifo" + err = en.Append(0xa7, 0x72, 0x78, 0x5f, 0x66, 0x69, 0x66, 0x6f) + if err != nil { + return + } + err = en.WriteUint64(z.RxFIFO) + if err != nil { + err = msgp.WrapError(err, "RxFIFO") + return + } + // write "rx_frame" + err = en.Append(0xa8, 0x72, 0x78, 0x5f, 0x66, 0x72, 0x61, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.RxFrame) + if err != nil { + err = msgp.WrapError(err, "RxFrame") + return + } + // write "rx_compressed" + err = en.Append(0xad, 0x72, 0x78, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteUint64(z.RxCompressed) + if err != nil { + err = msgp.WrapError(err, "RxCompressed") + return + } + // write "rx_multicast" + err = en.Append(0xac, 0x72, 0x78, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x63, 0x61, 0x73, 0x74) + if err != nil { + return + } + err = en.WriteUint64(z.RxMulticast) + if err != nil { + err = msgp.WrapError(err, "RxMulticast") + return + } + // write "tx_bytes" + err = en.Append(0xa8, 0x74, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.TxBytes) + if err != nil { + err = msgp.WrapError(err, "TxBytes") + return + } + // write "tx_packets" + err = en.Append(0xaa, 0x74, 0x78, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.TxPackets) + if err != nil { + err = msgp.WrapError(err, "TxPackets") + return + } + // write "tx_errors" + err = en.Append(0xa9, 0x74, 0x78, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.TxErrors) + if err != nil { + err = msgp.WrapError(err, "TxErrors") + return + } + // write "tx_dropped" + err = en.Append(0xaa, 0x74, 0x78, 0x5f, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteUint64(z.TxDropped) + if err != nil { + err = msgp.WrapError(err, "TxDropped") + return + } + // write "tx_fifo" + err = en.Append(0xa7, 0x74, 0x78, 0x5f, 0x66, 0x69, 0x66, 0x6f) + if err != nil { + return + } + err = en.WriteUint64(z.TxFIFO) + if err != nil { + err = msgp.WrapError(err, "TxFIFO") + return + } + // write "tx_collisions" + err = en.Append(0xad, 0x74, 0x78, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.TxCollisions) + if err != nil { + err = msgp.WrapError(err, "TxCollisions") + return + } + // write "tx_carrier" + err = en.Append(0xaa, 0x74, 0x78, 0x5f, 0x63, 0x61, 0x72, 0x72, 0x69, 0x65, 0x72) + if err != nil { + return + } + err = en.WriteUint64(z.TxCarrier) + if err != nil { + err = msgp.WrapError(err, "TxCarrier") + return + } + // write "tx_compressed" + err = en.Append(0xad, 0x74, 0x78, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteUint64(z.TxCompressed) + if err != nil { + err = msgp.WrapError(err, "TxCompressed") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *procfsNetDevLine) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 17 + // string "name" + o = append(o, 0xde, 0x0, 0x11, 0xa4, 0x6e, 0x61, 0x6d, 0x65) + o = msgp.AppendString(o, z.Name) + // string "rx_bytes" + o = append(o, 0xa8, 0x72, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73) + o = msgp.AppendUint64(o, z.RxBytes) + // string "rx_packets" + o = append(o, 0xaa, 0x72, 0x78, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73) + o = msgp.AppendUint64(o, z.RxPackets) + // string "rx_errors" + o = append(o, 0xa9, 0x72, 0x78, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73) + o = msgp.AppendUint64(o, z.RxErrors) + // string "rx_dropped" + o = append(o, 0xaa, 0x72, 0x78, 0x5f, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64) + o = msgp.AppendUint64(o, z.RxDropped) + // string "rx_fifo" + o = append(o, 0xa7, 0x72, 0x78, 0x5f, 0x66, 0x69, 0x66, 0x6f) + o = msgp.AppendUint64(o, z.RxFIFO) + // string "rx_frame" + o = append(o, 0xa8, 0x72, 0x78, 0x5f, 0x66, 0x72, 0x61, 0x6d, 0x65) + o = msgp.AppendUint64(o, z.RxFrame) + // string "rx_compressed" + o = append(o, 0xad, 0x72, 0x78, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64) + o = msgp.AppendUint64(o, z.RxCompressed) + // string "rx_multicast" + o = append(o, 0xac, 0x72, 0x78, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x63, 0x61, 0x73, 0x74) + o = msgp.AppendUint64(o, z.RxMulticast) + // string "tx_bytes" + o = append(o, 0xa8, 0x74, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73) + o = msgp.AppendUint64(o, z.TxBytes) + // string "tx_packets" + o = append(o, 0xaa, 0x74, 0x78, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73) + o = msgp.AppendUint64(o, z.TxPackets) + // string "tx_errors" + o = append(o, 0xa9, 0x74, 0x78, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73) + o = msgp.AppendUint64(o, z.TxErrors) + // string "tx_dropped" + o = append(o, 0xaa, 0x74, 0x78, 0x5f, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64) + o = msgp.AppendUint64(o, z.TxDropped) + // string "tx_fifo" + o = append(o, 0xa7, 0x74, 0x78, 0x5f, 0x66, 0x69, 0x66, 0x6f) + o = msgp.AppendUint64(o, z.TxFIFO) + // string "tx_collisions" + o = append(o, 0xad, 0x74, 0x78, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73) + o = msgp.AppendUint64(o, z.TxCollisions) + // string "tx_carrier" + o = append(o, 0xaa, 0x74, 0x78, 0x5f, 0x63, 0x61, 0x72, 0x72, 0x69, 0x65, 0x72) + o = msgp.AppendUint64(o, z.TxCarrier) + // string "tx_compressed" + o = append(o, 0xad, 0x74, 0x78, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64) + o = msgp.AppendUint64(o, z.TxCompressed) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *procfsNetDevLine) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "name": + z.Name, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Name") + return + } + case "rx_bytes": + z.RxBytes, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "RxBytes") + return + } + case "rx_packets": + z.RxPackets, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "RxPackets") + return + } + case "rx_errors": + z.RxErrors, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "RxErrors") + return + } + case "rx_dropped": + z.RxDropped, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "RxDropped") + return + } + case "rx_fifo": + z.RxFIFO, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "RxFIFO") + return + } + case "rx_frame": + z.RxFrame, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "RxFrame") + return + } + case "rx_compressed": + z.RxCompressed, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "RxCompressed") + return + } + case "rx_multicast": + z.RxMulticast, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "RxMulticast") + return + } + case "tx_bytes": + z.TxBytes, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "TxBytes") + return + } + case "tx_packets": + z.TxPackets, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "TxPackets") + return + } + case "tx_errors": + z.TxErrors, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "TxErrors") + return + } + case "tx_dropped": + z.TxDropped, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "TxDropped") + return + } + case "tx_fifo": + z.TxFIFO, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "TxFIFO") + return + } + case "tx_collisions": + z.TxCollisions, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "TxCollisions") + return + } + case "tx_carrier": + z.TxCarrier, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "TxCarrier") + return + } + case "tx_compressed": + z.TxCompressed, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "TxCompressed") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *procfsNetDevLine) Msgsize() (s int) { + s = 3 + 5 + msgp.StringPrefixSize + len(z.Name) + 9 + msgp.Uint64Size + 11 + msgp.Uint64Size + 10 + msgp.Uint64Size + 11 + msgp.Uint64Size + 8 + msgp.Uint64Size + 9 + msgp.Uint64Size + 14 + msgp.Uint64Size + 13 + msgp.Uint64Size + 9 + msgp.Uint64Size + 11 + msgp.Uint64Size + 10 + msgp.Uint64Size + 11 + msgp.Uint64Size + 8 + msgp.Uint64Size + 14 + msgp.Uint64Size + 11 + msgp.Uint64Size + 14 + msgp.Uint64Size + return +} diff --git a/external_gen_test.go b/external_gen_test.go new file mode 100644 index 0000000..04c25dc --- /dev/null +++ b/external_gen_test.go @@ -0,0 +1,349 @@ +package madmin + +// Code generated by github.com/tinylib/msgp DO NOT EDIT. + +import ( + "bytes" + "testing" + + "github.com/tinylib/msgp/msgp" +) + +func TestMarshalUnmarshalcpuTimesStat(t *testing.T) { + v := cpuTimesStat{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgcpuTimesStat(b *testing.B) { + v := cpuTimesStat{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgcpuTimesStat(b *testing.B) { + v := cpuTimesStat{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalcpuTimesStat(b *testing.B) { + v := cpuTimesStat{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodecpuTimesStat(t *testing.T) { + v := cpuTimesStat{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodecpuTimesStat Msgsize() is inaccurate") + } + + vn := cpuTimesStat{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodecpuTimesStat(b *testing.B) { + v := cpuTimesStat{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodecpuTimesStat(b *testing.B) { + v := cpuTimesStat{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalloadAvgStat(t *testing.T) { + v := loadAvgStat{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgloadAvgStat(b *testing.B) { + v := loadAvgStat{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgloadAvgStat(b *testing.B) { + v := loadAvgStat{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalloadAvgStat(b *testing.B) { + v := loadAvgStat{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeloadAvgStat(t *testing.T) { + v := loadAvgStat{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeloadAvgStat Msgsize() is inaccurate") + } + + vn := loadAvgStat{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeloadAvgStat(b *testing.B) { + v := loadAvgStat{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeloadAvgStat(b *testing.B) { + v := loadAvgStat{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalprocfsNetDevLine(t *testing.T) { + v := procfsNetDevLine{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgprocfsNetDevLine(b *testing.B) { + v := procfsNetDevLine{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgprocfsNetDevLine(b *testing.B) { + v := procfsNetDevLine{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalprocfsNetDevLine(b *testing.B) { + v := procfsNetDevLine{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeprocfsNetDevLine(t *testing.T) { + v := procfsNetDevLine{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeprocfsNetDevLine Msgsize() is inaccurate") + } + + vn := procfsNetDevLine{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeprocfsNetDevLine(b *testing.B) { + v := procfsNetDevLine{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeprocfsNetDevLine(b *testing.B) { + v := procfsNetDevLine{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} diff --git a/heal-commands.go b/heal-commands.go index f2aeb7d..02b4bcc 100644 --- a/heal-commands.go +++ b/heal-commands.go @@ -30,6 +30,10 @@ import ( "time" ) +//msgp:clearomitted +//msgp:tag json +//go:generate msgp + // HealScanMode represents the type of healing scan type HealScanMode int diff --git a/heal-commands_gen.go b/heal-commands_gen.go new file mode 100644 index 0000000..da9b64a --- /dev/null +++ b/heal-commands_gen.go @@ -0,0 +1,3988 @@ +package madmin + +// Code generated by github.com/tinylib/msgp DO NOT EDIT. + +import ( + "github.com/tinylib/msgp/msgp" +) + +// DecodeMsg implements msgp.Decodable +func (z *BgHealState) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "offline_nodes": + var zb0002 uint32 + zb0002, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "OfflineEndpoints") + return + } + if cap(z.OfflineEndpoints) >= int(zb0002) { + z.OfflineEndpoints = (z.OfflineEndpoints)[:zb0002] + } else { + z.OfflineEndpoints = make([]string, zb0002) + } + for za0001 := range z.OfflineEndpoints { + z.OfflineEndpoints[za0001], err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "OfflineEndpoints", za0001) + return + } + } + case "ScannedItemsCount": + z.ScannedItemsCount, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "ScannedItemsCount") + return + } + case "HealDisks": + var zb0003 uint32 + zb0003, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "HealDisks") + return + } + if cap(z.HealDisks) >= int(zb0003) { + z.HealDisks = (z.HealDisks)[:zb0003] + } else { + z.HealDisks = make([]string, zb0003) + } + for za0002 := range z.HealDisks { + z.HealDisks[za0002], err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "HealDisks", za0002) + return + } + } + case "sets": + var zb0004 uint32 + zb0004, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "Sets") + return + } + if cap(z.Sets) >= int(zb0004) { + z.Sets = (z.Sets)[:zb0004] + } else { + z.Sets = make([]SetStatus, zb0004) + } + for za0003 := range z.Sets { + err = z.Sets[za0003].DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Sets", za0003) + return + } + } + case "mrf": + var zb0005 uint32 + zb0005, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "MRF") + return + } + if z.MRF == nil { + z.MRF = make(map[string]MRFStatus, zb0005) + } else if len(z.MRF) > 0 { + for key := range z.MRF { + delete(z.MRF, key) + } + } + for zb0005 > 0 { + zb0005-- + var za0004 string + var za0005 MRFStatus + za0004, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "MRF") + return + } + var zb0006 uint32 + zb0006, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "MRF", za0004) + return + } + for zb0006 > 0 { + zb0006-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, "MRF", za0004) + return + } + switch msgp.UnsafeString(field) { + case "bytes_healed": + za0005.BytesHealed, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "MRF", za0004, "BytesHealed") + return + } + case "items_healed": + za0005.ItemsHealed, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "MRF", za0004, "ItemsHealed") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, "MRF", za0004) + return + } + } + } + z.MRF[za0004] = za0005 + } + case "sc_parity": + var zb0007 uint32 + zb0007, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "SCParity") + return + } + if z.SCParity == nil { + z.SCParity = make(map[string]int, zb0007) + } else if len(z.SCParity) > 0 { + for key := range z.SCParity { + delete(z.SCParity, key) + } + } + for zb0007 > 0 { + zb0007-- + var za0006 string + var za0007 int + za0006, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "SCParity") + return + } + za0007, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "SCParity", za0006) + return + } + z.SCParity[za0006] = za0007 + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *BgHealState) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 6 + // write "offline_nodes" + err = en.Append(0x86, 0xad, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.OfflineEndpoints))) + if err != nil { + err = msgp.WrapError(err, "OfflineEndpoints") + return + } + for za0001 := range z.OfflineEndpoints { + err = en.WriteString(z.OfflineEndpoints[za0001]) + if err != nil { + err = msgp.WrapError(err, "OfflineEndpoints", za0001) + return + } + } + // write "ScannedItemsCount" + err = en.Append(0xb1, 0x53, 0x63, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteInt64(z.ScannedItemsCount) + if err != nil { + err = msgp.WrapError(err, "ScannedItemsCount") + return + } + // write "HealDisks" + err = en.Append(0xa9, 0x48, 0x65, 0x61, 0x6c, 0x44, 0x69, 0x73, 0x6b, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.HealDisks))) + if err != nil { + err = msgp.WrapError(err, "HealDisks") + return + } + for za0002 := range z.HealDisks { + err = en.WriteString(z.HealDisks[za0002]) + if err != nil { + err = msgp.WrapError(err, "HealDisks", za0002) + return + } + } + // write "sets" + err = en.Append(0xa4, 0x73, 0x65, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Sets))) + if err != nil { + err = msgp.WrapError(err, "Sets") + return + } + for za0003 := range z.Sets { + err = z.Sets[za0003].EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Sets", za0003) + return + } + } + // write "mrf" + err = en.Append(0xa3, 0x6d, 0x72, 0x66) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.MRF))) + if err != nil { + err = msgp.WrapError(err, "MRF") + return + } + for za0004, za0005 := range z.MRF { + err = en.WriteString(za0004) + if err != nil { + err = msgp.WrapError(err, "MRF") + return + } + // map header, size 2 + // write "bytes_healed" + err = en.Append(0x82, 0xac, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x68, 0x65, 0x61, 0x6c, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteUint64(za0005.BytesHealed) + if err != nil { + err = msgp.WrapError(err, "MRF", za0004, "BytesHealed") + return + } + // write "items_healed" + err = en.Append(0xac, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x5f, 0x68, 0x65, 0x61, 0x6c, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteUint64(za0005.ItemsHealed) + if err != nil { + err = msgp.WrapError(err, "MRF", za0004, "ItemsHealed") + return + } + } + // write "sc_parity" + err = en.Append(0xa9, 0x73, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x69, 0x74, 0x79) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.SCParity))) + if err != nil { + err = msgp.WrapError(err, "SCParity") + return + } + for za0006, za0007 := range z.SCParity { + err = en.WriteString(za0006) + if err != nil { + err = msgp.WrapError(err, "SCParity") + return + } + err = en.WriteInt(za0007) + if err != nil { + err = msgp.WrapError(err, "SCParity", za0006) + return + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *BgHealState) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 6 + // string "offline_nodes" + o = append(o, 0x86, 0xad, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.OfflineEndpoints))) + for za0001 := range z.OfflineEndpoints { + o = msgp.AppendString(o, z.OfflineEndpoints[za0001]) + } + // string "ScannedItemsCount" + o = append(o, 0xb1, 0x53, 0x63, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendInt64(o, z.ScannedItemsCount) + // string "HealDisks" + o = append(o, 0xa9, 0x48, 0x65, 0x61, 0x6c, 0x44, 0x69, 0x73, 0x6b, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.HealDisks))) + for za0002 := range z.HealDisks { + o = msgp.AppendString(o, z.HealDisks[za0002]) + } + // string "sets" + o = append(o, 0xa4, 0x73, 0x65, 0x74, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.Sets))) + for za0003 := range z.Sets { + o, err = z.Sets[za0003].MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Sets", za0003) + return + } + } + // string "mrf" + o = append(o, 0xa3, 0x6d, 0x72, 0x66) + o = msgp.AppendMapHeader(o, uint32(len(z.MRF))) + for za0004, za0005 := range z.MRF { + o = msgp.AppendString(o, za0004) + // map header, size 2 + // string "bytes_healed" + o = append(o, 0x82, 0xac, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x68, 0x65, 0x61, 0x6c, 0x65, 0x64) + o = msgp.AppendUint64(o, za0005.BytesHealed) + // string "items_healed" + o = append(o, 0xac, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x5f, 0x68, 0x65, 0x61, 0x6c, 0x65, 0x64) + o = msgp.AppendUint64(o, za0005.ItemsHealed) + } + // string "sc_parity" + o = append(o, 0xa9, 0x73, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x69, 0x74, 0x79) + o = msgp.AppendMapHeader(o, uint32(len(z.SCParity))) + for za0006, za0007 := range z.SCParity { + o = msgp.AppendString(o, za0006) + o = msgp.AppendInt(o, za0007) + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *BgHealState) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "offline_nodes": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "OfflineEndpoints") + return + } + if cap(z.OfflineEndpoints) >= int(zb0002) { + z.OfflineEndpoints = (z.OfflineEndpoints)[:zb0002] + } else { + z.OfflineEndpoints = make([]string, zb0002) + } + for za0001 := range z.OfflineEndpoints { + z.OfflineEndpoints[za0001], bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "OfflineEndpoints", za0001) + return + } + } + case "ScannedItemsCount": + z.ScannedItemsCount, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ScannedItemsCount") + return + } + case "HealDisks": + var zb0003 uint32 + zb0003, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "HealDisks") + return + } + if cap(z.HealDisks) >= int(zb0003) { + z.HealDisks = (z.HealDisks)[:zb0003] + } else { + z.HealDisks = make([]string, zb0003) + } + for za0002 := range z.HealDisks { + z.HealDisks[za0002], bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "HealDisks", za0002) + return + } + } + case "sets": + var zb0004 uint32 + zb0004, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Sets") + return + } + if cap(z.Sets) >= int(zb0004) { + z.Sets = (z.Sets)[:zb0004] + } else { + z.Sets = make([]SetStatus, zb0004) + } + for za0003 := range z.Sets { + bts, err = z.Sets[za0003].UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Sets", za0003) + return + } + } + case "mrf": + var zb0005 uint32 + zb0005, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "MRF") + return + } + if z.MRF == nil { + z.MRF = make(map[string]MRFStatus, zb0005) + } else if len(z.MRF) > 0 { + for key := range z.MRF { + delete(z.MRF, key) + } + } + for zb0005 > 0 { + var za0004 string + var za0005 MRFStatus + zb0005-- + za0004, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "MRF") + return + } + var zb0006 uint32 + zb0006, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "MRF", za0004) + return + } + for zb0006 > 0 { + zb0006-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "MRF", za0004) + return + } + switch msgp.UnsafeString(field) { + case "bytes_healed": + za0005.BytesHealed, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "MRF", za0004, "BytesHealed") + return + } + case "items_healed": + za0005.ItemsHealed, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "MRF", za0004, "ItemsHealed") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "MRF", za0004) + return + } + } + } + z.MRF[za0004] = za0005 + } + case "sc_parity": + var zb0007 uint32 + zb0007, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "SCParity") + return + } + if z.SCParity == nil { + z.SCParity = make(map[string]int, zb0007) + } else if len(z.SCParity) > 0 { + for key := range z.SCParity { + delete(z.SCParity, key) + } + } + for zb0007 > 0 { + var za0006 string + var za0007 int + zb0007-- + za0006, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "SCParity") + return + } + za0007, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "SCParity", za0006) + return + } + z.SCParity[za0006] = za0007 + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *BgHealState) Msgsize() (s int) { + s = 1 + 14 + msgp.ArrayHeaderSize + for za0001 := range z.OfflineEndpoints { + s += msgp.StringPrefixSize + len(z.OfflineEndpoints[za0001]) + } + s += 18 + msgp.Int64Size + 10 + msgp.ArrayHeaderSize + for za0002 := range z.HealDisks { + s += msgp.StringPrefixSize + len(z.HealDisks[za0002]) + } + s += 5 + msgp.ArrayHeaderSize + for za0003 := range z.Sets { + s += z.Sets[za0003].Msgsize() + } + s += 4 + msgp.MapHeaderSize + if z.MRF != nil { + for za0004, za0005 := range z.MRF { + _ = za0005 + s += msgp.StringPrefixSize + len(za0004) + 1 + 13 + msgp.Uint64Size + 13 + msgp.Uint64Size + } + } + s += 10 + msgp.MapHeaderSize + if z.SCParity != nil { + for za0006, za0007 := range z.SCParity { + _ = za0007 + s += msgp.StringPrefixSize + len(za0006) + msgp.IntSize + } + } + return +} + +// DecodeMsg implements msgp.Decodable +func (z *HealDriveInfo) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "uuid": + z.UUID, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "UUID") + return + } + case "endpoint": + z.Endpoint, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Endpoint") + return + } + case "state": + z.State, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "State") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z HealDriveInfo) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 3 + // write "uuid" + err = en.Append(0x83, 0xa4, 0x75, 0x75, 0x69, 0x64) + if err != nil { + return + } + err = en.WriteString(z.UUID) + if err != nil { + err = msgp.WrapError(err, "UUID") + return + } + // write "endpoint" + err = en.Append(0xa8, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteString(z.Endpoint) + if err != nil { + err = msgp.WrapError(err, "Endpoint") + return + } + // write "state" + err = en.Append(0xa5, 0x73, 0x74, 0x61, 0x74, 0x65) + if err != nil { + return + } + err = en.WriteString(z.State) + if err != nil { + err = msgp.WrapError(err, "State") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z HealDriveInfo) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 3 + // string "uuid" + o = append(o, 0x83, 0xa4, 0x75, 0x75, 0x69, 0x64) + o = msgp.AppendString(o, z.UUID) + // string "endpoint" + o = append(o, 0xa8, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74) + o = msgp.AppendString(o, z.Endpoint) + // string "state" + o = append(o, 0xa5, 0x73, 0x74, 0x61, 0x74, 0x65) + o = msgp.AppendString(o, z.State) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *HealDriveInfo) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "uuid": + z.UUID, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "UUID") + return + } + case "endpoint": + z.Endpoint, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Endpoint") + return + } + case "state": + z.State, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "State") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z HealDriveInfo) Msgsize() (s int) { + s = 1 + 5 + msgp.StringPrefixSize + len(z.UUID) + 9 + msgp.StringPrefixSize + len(z.Endpoint) + 6 + msgp.StringPrefixSize + len(z.State) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *HealItemType) DecodeMsg(dc *msgp.Reader) (err error) { + { + var zb0001 string + zb0001, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err) + return + } + (*z) = HealItemType(zb0001) + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z HealItemType) EncodeMsg(en *msgp.Writer) (err error) { + err = en.WriteString(string(z)) + if err != nil { + err = msgp.WrapError(err) + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z HealItemType) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + o = msgp.AppendString(o, string(z)) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *HealItemType) UnmarshalMsg(bts []byte) (o []byte, err error) { + { + var zb0001 string + zb0001, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + (*z) = HealItemType(zb0001) + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z HealItemType) Msgsize() (s int) { + s = msgp.StringPrefixSize + len(string(z)) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *HealOpts) 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 "recursive": + z.Recursive, err = dc.ReadBool() + if err != nil { + err = msgp.WrapError(err, "Recursive") + return + } + case "dryRun": + z.DryRun, err = dc.ReadBool() + if err != nil { + err = msgp.WrapError(err, "DryRun") + return + } + case "remove": + z.Remove, err = dc.ReadBool() + if err != nil { + err = msgp.WrapError(err, "Remove") + return + } + case "recreate": + z.Recreate, err = dc.ReadBool() + if err != nil { + err = msgp.WrapError(err, "Recreate") + return + } + case "scanMode": + { + var zb0002 int + zb0002, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "ScanMode") + return + } + z.ScanMode = HealScanMode(zb0002) + } + case "updateParity": + z.UpdateParity, err = dc.ReadBool() + if err != nil { + err = msgp.WrapError(err, "UpdateParity") + return + } + case "nolock": + z.NoLock, err = dc.ReadBool() + if err != nil { + err = msgp.WrapError(err, "NoLock") + return + } + case "pool": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "Pool") + return + } + z.Pool = nil + } else { + if z.Pool == nil { + z.Pool = new(int) + } + *z.Pool, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "Pool") + return + } + } + zb0001Mask |= 0x1 + case "set": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "Set") + return + } + z.Set = nil + } else { + if z.Set == nil { + z.Set = new(int) + } + *z.Set, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "Set") + return + } + } + 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.Pool = nil + } + if (zb0001Mask & 0x2) == 0 { + z.Set = nil + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *HealOpts) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(9) + var zb0001Mask uint16 /* 9 bits */ + _ = zb0001Mask + if z.Pool == nil { + zb0001Len-- + zb0001Mask |= 0x80 + } + if z.Set == nil { + zb0001Len-- + zb0001Mask |= 0x100 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + // write "recursive" + err = en.Append(0xa9, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65) + if err != nil { + return + } + err = en.WriteBool(z.Recursive) + if err != nil { + err = msgp.WrapError(err, "Recursive") + return + } + // write "dryRun" + err = en.Append(0xa6, 0x64, 0x72, 0x79, 0x52, 0x75, 0x6e) + if err != nil { + return + } + err = en.WriteBool(z.DryRun) + if err != nil { + err = msgp.WrapError(err, "DryRun") + return + } + // write "remove" + err = en.Append(0xa6, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65) + if err != nil { + return + } + err = en.WriteBool(z.Remove) + if err != nil { + err = msgp.WrapError(err, "Remove") + return + } + // write "recreate" + err = en.Append(0xa8, 0x72, 0x65, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65) + if err != nil { + return + } + err = en.WriteBool(z.Recreate) + if err != nil { + err = msgp.WrapError(err, "Recreate") + return + } + // write "scanMode" + err = en.Append(0xa8, 0x73, 0x63, 0x61, 0x6e, 0x4d, 0x6f, 0x64, 0x65) + if err != nil { + return + } + err = en.WriteInt(int(z.ScanMode)) + if err != nil { + err = msgp.WrapError(err, "ScanMode") + return + } + // write "updateParity" + err = en.Append(0xac, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x69, 0x74, 0x79) + if err != nil { + return + } + err = en.WriteBool(z.UpdateParity) + if err != nil { + err = msgp.WrapError(err, "UpdateParity") + return + } + // write "nolock" + err = en.Append(0xa6, 0x6e, 0x6f, 0x6c, 0x6f, 0x63, 0x6b) + if err != nil { + return + } + err = en.WriteBool(z.NoLock) + if err != nil { + err = msgp.WrapError(err, "NoLock") + return + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // write "pool" + err = en.Append(0xa4, 0x70, 0x6f, 0x6f, 0x6c) + if err != nil { + return + } + if z.Pool == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = en.WriteInt(*z.Pool) + if err != nil { + err = msgp.WrapError(err, "Pool") + return + } + } + } + if (zb0001Mask & 0x100) == 0 { // if not omitted + // write "set" + err = en.Append(0xa3, 0x73, 0x65, 0x74) + if err != nil { + return + } + if z.Set == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = en.WriteInt(*z.Set) + if err != nil { + err = msgp.WrapError(err, "Set") + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *HealOpts) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(9) + var zb0001Mask uint16 /* 9 bits */ + _ = zb0001Mask + if z.Pool == nil { + zb0001Len-- + zb0001Mask |= 0x80 + } + if z.Set == nil { + zb0001Len-- + zb0001Mask |= 0x100 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + // string "recursive" + o = append(o, 0xa9, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65) + o = msgp.AppendBool(o, z.Recursive) + // string "dryRun" + o = append(o, 0xa6, 0x64, 0x72, 0x79, 0x52, 0x75, 0x6e) + o = msgp.AppendBool(o, z.DryRun) + // string "remove" + o = append(o, 0xa6, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65) + o = msgp.AppendBool(o, z.Remove) + // string "recreate" + o = append(o, 0xa8, 0x72, 0x65, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65) + o = msgp.AppendBool(o, z.Recreate) + // string "scanMode" + o = append(o, 0xa8, 0x73, 0x63, 0x61, 0x6e, 0x4d, 0x6f, 0x64, 0x65) + o = msgp.AppendInt(o, int(z.ScanMode)) + // string "updateParity" + o = append(o, 0xac, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x69, 0x74, 0x79) + o = msgp.AppendBool(o, z.UpdateParity) + // string "nolock" + o = append(o, 0xa6, 0x6e, 0x6f, 0x6c, 0x6f, 0x63, 0x6b) + o = msgp.AppendBool(o, z.NoLock) + if (zb0001Mask & 0x80) == 0 { // if not omitted + // string "pool" + o = append(o, 0xa4, 0x70, 0x6f, 0x6f, 0x6c) + if z.Pool == nil { + o = msgp.AppendNil(o) + } else { + o = msgp.AppendInt(o, *z.Pool) + } + } + if (zb0001Mask & 0x100) == 0 { // if not omitted + // string "set" + o = append(o, 0xa3, 0x73, 0x65, 0x74) + if z.Set == nil { + o = msgp.AppendNil(o) + } else { + o = msgp.AppendInt(o, *z.Set) + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *HealOpts) 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 "recursive": + z.Recursive, bts, err = msgp.ReadBoolBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Recursive") + return + } + case "dryRun": + z.DryRun, bts, err = msgp.ReadBoolBytes(bts) + if err != nil { + err = msgp.WrapError(err, "DryRun") + return + } + case "remove": + z.Remove, bts, err = msgp.ReadBoolBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Remove") + return + } + case "recreate": + z.Recreate, bts, err = msgp.ReadBoolBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Recreate") + return + } + case "scanMode": + { + var zb0002 int + zb0002, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ScanMode") + return + } + z.ScanMode = HealScanMode(zb0002) + } + case "updateParity": + z.UpdateParity, bts, err = msgp.ReadBoolBytes(bts) + if err != nil { + err = msgp.WrapError(err, "UpdateParity") + return + } + case "nolock": + z.NoLock, bts, err = msgp.ReadBoolBytes(bts) + if err != nil { + err = msgp.WrapError(err, "NoLock") + return + } + case "pool": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.Pool = nil + } else { + if z.Pool == nil { + z.Pool = new(int) + } + *z.Pool, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Pool") + return + } + } + zb0001Mask |= 0x1 + case "set": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.Set = nil + } else { + if z.Set == nil { + z.Set = new(int) + } + *z.Set, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Set") + return + } + } + 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.Pool = nil + } + if (zb0001Mask & 0x2) == 0 { + z.Set = nil + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *HealOpts) Msgsize() (s int) { + s = 1 + 10 + msgp.BoolSize + 7 + msgp.BoolSize + 7 + msgp.BoolSize + 9 + msgp.BoolSize + 9 + msgp.IntSize + 13 + msgp.BoolSize + 7 + msgp.BoolSize + 5 + if z.Pool == nil { + s += msgp.NilSize + } else { + s += msgp.IntSize + } + s += 4 + if z.Set == nil { + s += msgp.NilSize + } else { + s += msgp.IntSize + } + return +} + +// DecodeMsg implements msgp.Decodable +func (z *HealResultItem) 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 "resultId": + z.ResultIndex, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "ResultIndex") + return + } + case "type": + { + var zb0002 string + zb0002, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Type") + return + } + z.Type = HealItemType(zb0002) + } + case "bucket": + z.Bucket, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Bucket") + return + } + case "object": + z.Object, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Object") + return + } + case "versionId": + z.VersionID, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "VersionID") + return + } + case "detail": + z.Detail, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Detail") + return + } + case "parityBlocks": + z.ParityBlocks, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "ParityBlocks") + return + } + zb0001Mask |= 0x1 + case "dataBlocks": + z.DataBlocks, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "DataBlocks") + return + } + zb0001Mask |= 0x2 + case "diskCount": + z.DiskCount, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "DiskCount") + return + } + case "setCount": + z.SetCount, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "SetCount") + return + } + case "before": + var zb0003 uint32 + zb0003, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "Before") + return + } + for zb0003 > 0 { + zb0003-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, "Before") + return + } + switch msgp.UnsafeString(field) { + case "drives": + var zb0004 uint32 + zb0004, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "Before", "Drives") + return + } + if cap(z.Before.Drives) >= int(zb0004) { + z.Before.Drives = (z.Before.Drives)[:zb0004] + } else { + z.Before.Drives = make([]HealDriveInfo, zb0004) + } + for za0001 := range z.Before.Drives { + var zb0005 uint32 + zb0005, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "Before", "Drives", za0001) + return + } + for zb0005 > 0 { + zb0005-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, "Before", "Drives", za0001) + return + } + switch msgp.UnsafeString(field) { + case "uuid": + z.Before.Drives[za0001].UUID, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Before", "Drives", za0001, "UUID") + return + } + case "endpoint": + z.Before.Drives[za0001].Endpoint, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Before", "Drives", za0001, "Endpoint") + return + } + case "state": + z.Before.Drives[za0001].State, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Before", "Drives", za0001, "State") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, "Before", "Drives", za0001) + return + } + } + } + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, "Before") + return + } + } + } + case "after": + var zb0006 uint32 + zb0006, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "After") + return + } + for zb0006 > 0 { + zb0006-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, "After") + return + } + switch msgp.UnsafeString(field) { + case "drives": + var zb0007 uint32 + zb0007, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "After", "Drives") + return + } + if cap(z.After.Drives) >= int(zb0007) { + z.After.Drives = (z.After.Drives)[:zb0007] + } else { + z.After.Drives = make([]HealDriveInfo, zb0007) + } + for za0002 := range z.After.Drives { + var zb0008 uint32 + zb0008, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "After", "Drives", za0002) + return + } + for zb0008 > 0 { + zb0008-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, "After", "Drives", za0002) + return + } + switch msgp.UnsafeString(field) { + case "uuid": + z.After.Drives[za0002].UUID, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "After", "Drives", za0002, "UUID") + return + } + case "endpoint": + z.After.Drives[za0002].Endpoint, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "After", "Drives", za0002, "Endpoint") + return + } + case "state": + z.After.Drives[za0002].State, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "After", "Drives", za0002, "State") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, "After", "Drives", za0002) + return + } + } + } + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, "After") + return + } + } + } + case "objectSize": + z.ObjectSize, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "ObjectSize") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x3 { + if (zb0001Mask & 0x1) == 0 { + z.ParityBlocks = 0 + } + if (zb0001Mask & 0x2) == 0 { + z.DataBlocks = 0 + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *HealResultItem) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(13) + var zb0001Mask uint16 /* 13 bits */ + _ = zb0001Mask + if z.ParityBlocks == 0 { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.DataBlocks == 0 { + zb0001Len-- + zb0001Mask |= 0x80 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + // write "resultId" + err = en.Append(0xa8, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64) + if err != nil { + return + } + err = en.WriteInt64(z.ResultIndex) + if err != nil { + err = msgp.WrapError(err, "ResultIndex") + return + } + // write "type" + err = en.Append(0xa4, 0x74, 0x79, 0x70, 0x65) + if err != nil { + return + } + err = en.WriteString(string(z.Type)) + if err != nil { + err = msgp.WrapError(err, "Type") + return + } + // write "bucket" + err = en.Append(0xa6, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74) + if err != nil { + return + } + err = en.WriteString(z.Bucket) + if err != nil { + err = msgp.WrapError(err, "Bucket") + return + } + // write "object" + err = en.Append(0xa6, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74) + if err != nil { + return + } + err = en.WriteString(z.Object) + if err != nil { + err = msgp.WrapError(err, "Object") + return + } + // write "versionId" + err = en.Append(0xa9, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64) + if err != nil { + return + } + err = en.WriteString(z.VersionID) + if err != nil { + err = msgp.WrapError(err, "VersionID") + return + } + // write "detail" + err = en.Append(0xa6, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c) + if err != nil { + return + } + err = en.WriteString(z.Detail) + if err != nil { + err = msgp.WrapError(err, "Detail") + return + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // write "parityBlocks" + err = en.Append(0xac, 0x70, 0x61, 0x72, 0x69, 0x74, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73) + if err != nil { + return + } + err = en.WriteInt(z.ParityBlocks) + if err != nil { + err = msgp.WrapError(err, "ParityBlocks") + return + } + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // write "dataBlocks" + err = en.Append(0xaa, 0x64, 0x61, 0x74, 0x61, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73) + if err != nil { + return + } + err = en.WriteInt(z.DataBlocks) + if err != nil { + err = msgp.WrapError(err, "DataBlocks") + return + } + } + // write "diskCount" + err = en.Append(0xa9, 0x64, 0x69, 0x73, 0x6b, 0x43, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteInt(z.DiskCount) + if err != nil { + err = msgp.WrapError(err, "DiskCount") + return + } + // write "setCount" + err = en.Append(0xa8, 0x73, 0x65, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteInt(z.SetCount) + if err != nil { + err = msgp.WrapError(err, "SetCount") + return + } + // write "before" + err = en.Append(0xa6, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65) + if err != nil { + return + } + // map header, size 1 + // write "drives" + err = en.Append(0x81, 0xa6, 0x64, 0x72, 0x69, 0x76, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Before.Drives))) + if err != nil { + err = msgp.WrapError(err, "Before", "Drives") + return + } + for za0001 := range z.Before.Drives { + // map header, size 3 + // write "uuid" + err = en.Append(0x83, 0xa4, 0x75, 0x75, 0x69, 0x64) + if err != nil { + return + } + err = en.WriteString(z.Before.Drives[za0001].UUID) + if err != nil { + err = msgp.WrapError(err, "Before", "Drives", za0001, "UUID") + return + } + // write "endpoint" + err = en.Append(0xa8, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteString(z.Before.Drives[za0001].Endpoint) + if err != nil { + err = msgp.WrapError(err, "Before", "Drives", za0001, "Endpoint") + return + } + // write "state" + err = en.Append(0xa5, 0x73, 0x74, 0x61, 0x74, 0x65) + if err != nil { + return + } + err = en.WriteString(z.Before.Drives[za0001].State) + if err != nil { + err = msgp.WrapError(err, "Before", "Drives", za0001, "State") + return + } + } + // write "after" + err = en.Append(0xa5, 0x61, 0x66, 0x74, 0x65, 0x72) + if err != nil { + return + } + // map header, size 1 + // write "drives" + err = en.Append(0x81, 0xa6, 0x64, 0x72, 0x69, 0x76, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.After.Drives))) + if err != nil { + err = msgp.WrapError(err, "After", "Drives") + return + } + for za0002 := range z.After.Drives { + // map header, size 3 + // write "uuid" + err = en.Append(0x83, 0xa4, 0x75, 0x75, 0x69, 0x64) + if err != nil { + return + } + err = en.WriteString(z.After.Drives[za0002].UUID) + if err != nil { + err = msgp.WrapError(err, "After", "Drives", za0002, "UUID") + return + } + // write "endpoint" + err = en.Append(0xa8, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteString(z.After.Drives[za0002].Endpoint) + if err != nil { + err = msgp.WrapError(err, "After", "Drives", za0002, "Endpoint") + return + } + // write "state" + err = en.Append(0xa5, 0x73, 0x74, 0x61, 0x74, 0x65) + if err != nil { + return + } + err = en.WriteString(z.After.Drives[za0002].State) + if err != nil { + err = msgp.WrapError(err, "After", "Drives", za0002, "State") + return + } + } + // write "objectSize" + err = en.Append(0xaa, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x69, 0x7a, 0x65) + if err != nil { + return + } + err = en.WriteInt64(z.ObjectSize) + if err != nil { + err = msgp.WrapError(err, "ObjectSize") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *HealResultItem) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(13) + var zb0001Mask uint16 /* 13 bits */ + _ = zb0001Mask + if z.ParityBlocks == 0 { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.DataBlocks == 0 { + zb0001Len-- + zb0001Mask |= 0x80 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + // string "resultId" + o = append(o, 0xa8, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x49, 0x64) + o = msgp.AppendInt64(o, z.ResultIndex) + // string "type" + o = append(o, 0xa4, 0x74, 0x79, 0x70, 0x65) + o = msgp.AppendString(o, string(z.Type)) + // string "bucket" + o = append(o, 0xa6, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74) + o = msgp.AppendString(o, z.Bucket) + // string "object" + o = append(o, 0xa6, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74) + o = msgp.AppendString(o, z.Object) + // string "versionId" + o = append(o, 0xa9, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64) + o = msgp.AppendString(o, z.VersionID) + // string "detail" + o = append(o, 0xa6, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c) + o = msgp.AppendString(o, z.Detail) + if (zb0001Mask & 0x40) == 0 { // if not omitted + // string "parityBlocks" + o = append(o, 0xac, 0x70, 0x61, 0x72, 0x69, 0x74, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73) + o = msgp.AppendInt(o, z.ParityBlocks) + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // string "dataBlocks" + o = append(o, 0xaa, 0x64, 0x61, 0x74, 0x61, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73) + o = msgp.AppendInt(o, z.DataBlocks) + } + // string "diskCount" + o = append(o, 0xa9, 0x64, 0x69, 0x73, 0x6b, 0x43, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendInt(o, z.DiskCount) + // string "setCount" + o = append(o, 0xa8, 0x73, 0x65, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendInt(o, z.SetCount) + // string "before" + o = append(o, 0xa6, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65) + // map header, size 1 + // string "drives" + o = append(o, 0x81, 0xa6, 0x64, 0x72, 0x69, 0x76, 0x65, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.Before.Drives))) + for za0001 := range z.Before.Drives { + // map header, size 3 + // string "uuid" + o = append(o, 0x83, 0xa4, 0x75, 0x75, 0x69, 0x64) + o = msgp.AppendString(o, z.Before.Drives[za0001].UUID) + // string "endpoint" + o = append(o, 0xa8, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74) + o = msgp.AppendString(o, z.Before.Drives[za0001].Endpoint) + // string "state" + o = append(o, 0xa5, 0x73, 0x74, 0x61, 0x74, 0x65) + o = msgp.AppendString(o, z.Before.Drives[za0001].State) + } + // string "after" + o = append(o, 0xa5, 0x61, 0x66, 0x74, 0x65, 0x72) + // map header, size 1 + // string "drives" + o = append(o, 0x81, 0xa6, 0x64, 0x72, 0x69, 0x76, 0x65, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.After.Drives))) + for za0002 := range z.After.Drives { + // map header, size 3 + // string "uuid" + o = append(o, 0x83, 0xa4, 0x75, 0x75, 0x69, 0x64) + o = msgp.AppendString(o, z.After.Drives[za0002].UUID) + // string "endpoint" + o = append(o, 0xa8, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74) + o = msgp.AppendString(o, z.After.Drives[za0002].Endpoint) + // string "state" + o = append(o, 0xa5, 0x73, 0x74, 0x61, 0x74, 0x65) + o = msgp.AppendString(o, z.After.Drives[za0002].State) + } + // string "objectSize" + o = append(o, 0xaa, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x69, 0x7a, 0x65) + o = msgp.AppendInt64(o, z.ObjectSize) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *HealResultItem) 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 "resultId": + z.ResultIndex, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ResultIndex") + return + } + case "type": + { + var zb0002 string + zb0002, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Type") + return + } + z.Type = HealItemType(zb0002) + } + case "bucket": + z.Bucket, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Bucket") + return + } + case "object": + z.Object, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Object") + return + } + case "versionId": + z.VersionID, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "VersionID") + return + } + case "detail": + z.Detail, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Detail") + return + } + case "parityBlocks": + z.ParityBlocks, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ParityBlocks") + return + } + zb0001Mask |= 0x1 + case "dataBlocks": + z.DataBlocks, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "DataBlocks") + return + } + zb0001Mask |= 0x2 + case "diskCount": + z.DiskCount, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "DiskCount") + return + } + case "setCount": + z.SetCount, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "SetCount") + return + } + case "before": + var zb0003 uint32 + zb0003, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Before") + return + } + for zb0003 > 0 { + zb0003-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "Before") + return + } + switch msgp.UnsafeString(field) { + case "drives": + var zb0004 uint32 + zb0004, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Before", "Drives") + return + } + if cap(z.Before.Drives) >= int(zb0004) { + z.Before.Drives = (z.Before.Drives)[:zb0004] + } else { + z.Before.Drives = make([]HealDriveInfo, zb0004) + } + for za0001 := range z.Before.Drives { + var zb0005 uint32 + zb0005, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Before", "Drives", za0001) + return + } + for zb0005 > 0 { + zb0005-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "Before", "Drives", za0001) + return + } + switch msgp.UnsafeString(field) { + case "uuid": + z.Before.Drives[za0001].UUID, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Before", "Drives", za0001, "UUID") + return + } + case "endpoint": + z.Before.Drives[za0001].Endpoint, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Before", "Drives", za0001, "Endpoint") + return + } + case "state": + z.Before.Drives[za0001].State, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Before", "Drives", za0001, "State") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "Before", "Drives", za0001) + return + } + } + } + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "Before") + return + } + } + } + case "after": + var zb0006 uint32 + zb0006, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "After") + return + } + for zb0006 > 0 { + zb0006-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "After") + return + } + switch msgp.UnsafeString(field) { + case "drives": + var zb0007 uint32 + zb0007, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "After", "Drives") + return + } + if cap(z.After.Drives) >= int(zb0007) { + z.After.Drives = (z.After.Drives)[:zb0007] + } else { + z.After.Drives = make([]HealDriveInfo, zb0007) + } + for za0002 := range z.After.Drives { + var zb0008 uint32 + zb0008, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "After", "Drives", za0002) + return + } + for zb0008 > 0 { + zb0008-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "After", "Drives", za0002) + return + } + switch msgp.UnsafeString(field) { + case "uuid": + z.After.Drives[za0002].UUID, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "After", "Drives", za0002, "UUID") + return + } + case "endpoint": + z.After.Drives[za0002].Endpoint, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "After", "Drives", za0002, "Endpoint") + return + } + case "state": + z.After.Drives[za0002].State, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "After", "Drives", za0002, "State") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "After", "Drives", za0002) + return + } + } + } + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "After") + return + } + } + } + case "objectSize": + z.ObjectSize, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ObjectSize") + return + } + 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.ParityBlocks = 0 + } + if (zb0001Mask & 0x2) == 0 { + z.DataBlocks = 0 + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *HealResultItem) Msgsize() (s int) { + s = 1 + 9 + msgp.Int64Size + 5 + msgp.StringPrefixSize + len(string(z.Type)) + 7 + msgp.StringPrefixSize + len(z.Bucket) + 7 + msgp.StringPrefixSize + len(z.Object) + 10 + msgp.StringPrefixSize + len(z.VersionID) + 7 + msgp.StringPrefixSize + len(z.Detail) + 13 + msgp.IntSize + 11 + msgp.IntSize + 10 + msgp.IntSize + 9 + msgp.IntSize + 7 + 1 + 7 + msgp.ArrayHeaderSize + for za0001 := range z.Before.Drives { + s += 1 + 5 + msgp.StringPrefixSize + len(z.Before.Drives[za0001].UUID) + 9 + msgp.StringPrefixSize + len(z.Before.Drives[za0001].Endpoint) + 6 + msgp.StringPrefixSize + len(z.Before.Drives[za0001].State) + } + s += 6 + 1 + 7 + msgp.ArrayHeaderSize + for za0002 := range z.After.Drives { + s += 1 + 5 + msgp.StringPrefixSize + len(z.After.Drives[za0002].UUID) + 9 + msgp.StringPrefixSize + len(z.After.Drives[za0002].Endpoint) + 6 + msgp.StringPrefixSize + len(z.After.Drives[za0002].State) + } + s += 11 + msgp.Int64Size + return +} + +// DecodeMsg implements msgp.Decodable +func (z *HealScanMode) DecodeMsg(dc *msgp.Reader) (err error) { + { + var zb0001 int + zb0001, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err) + return + } + (*z) = HealScanMode(zb0001) + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z HealScanMode) EncodeMsg(en *msgp.Writer) (err error) { + err = en.WriteInt(int(z)) + if err != nil { + err = msgp.WrapError(err) + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z HealScanMode) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + o = msgp.AppendInt(o, int(z)) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *HealScanMode) UnmarshalMsg(bts []byte) (o []byte, err error) { + { + var zb0001 int + zb0001, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + (*z) = HealScanMode(zb0001) + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z HealScanMode) Msgsize() (s int) { + s = msgp.IntSize + return +} + +// DecodeMsg implements msgp.Decodable +func (z *HealStartSuccess) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "clientToken": + z.ClientToken, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "ClientToken") + return + } + case "clientAddress": + z.ClientAddress, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "ClientAddress") + return + } + case "startTime": + z.StartTime, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "StartTime") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z HealStartSuccess) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 3 + // write "clientToken" + err = en.Append(0x83, 0xab, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e) + if err != nil { + return + } + err = en.WriteString(z.ClientToken) + if err != nil { + err = msgp.WrapError(err, "ClientToken") + return + } + // write "clientAddress" + err = en.Append(0xad, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73) + if err != nil { + return + } + err = en.WriteString(z.ClientAddress) + if err != nil { + err = msgp.WrapError(err, "ClientAddress") + return + } + // write "startTime" + err = en.Append(0xa9, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteTime(z.StartTime) + if err != nil { + err = msgp.WrapError(err, "StartTime") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z HealStartSuccess) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 3 + // string "clientToken" + o = append(o, 0x83, 0xab, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e) + o = msgp.AppendString(o, z.ClientToken) + // string "clientAddress" + o = append(o, 0xad, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73) + o = msgp.AppendString(o, z.ClientAddress) + // string "startTime" + o = append(o, 0xa9, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65) + o = msgp.AppendTime(o, z.StartTime) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *HealStartSuccess) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "clientToken": + z.ClientToken, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ClientToken") + return + } + case "clientAddress": + z.ClientAddress, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ClientAddress") + return + } + case "startTime": + z.StartTime, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "StartTime") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z HealStartSuccess) Msgsize() (s int) { + s = 1 + 12 + msgp.StringPrefixSize + len(z.ClientToken) + 14 + msgp.StringPrefixSize + len(z.ClientAddress) + 10 + msgp.TimeSize + return +} + +// DecodeMsg implements msgp.Decodable +func (z *HealStopSuccess) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "clientToken": + z.ClientToken, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "ClientToken") + return + } + case "clientAddress": + z.ClientAddress, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "ClientAddress") + return + } + case "startTime": + z.StartTime, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "StartTime") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z HealStopSuccess) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 3 + // write "clientToken" + err = en.Append(0x83, 0xab, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e) + if err != nil { + return + } + err = en.WriteString(z.ClientToken) + if err != nil { + err = msgp.WrapError(err, "ClientToken") + return + } + // write "clientAddress" + err = en.Append(0xad, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73) + if err != nil { + return + } + err = en.WriteString(z.ClientAddress) + if err != nil { + err = msgp.WrapError(err, "ClientAddress") + return + } + // write "startTime" + err = en.Append(0xa9, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteTime(z.StartTime) + if err != nil { + err = msgp.WrapError(err, "StartTime") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z HealStopSuccess) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 3 + // string "clientToken" + o = append(o, 0x83, 0xab, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e) + o = msgp.AppendString(o, z.ClientToken) + // string "clientAddress" + o = append(o, 0xad, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73) + o = msgp.AppendString(o, z.ClientAddress) + // string "startTime" + o = append(o, 0xa9, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65) + o = msgp.AppendTime(o, z.StartTime) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *HealStopSuccess) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "clientToken": + z.ClientToken, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ClientToken") + return + } + case "clientAddress": + z.ClientAddress, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ClientAddress") + return + } + case "startTime": + z.StartTime, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "StartTime") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z HealStopSuccess) Msgsize() (s int) { + s = 1 + 12 + msgp.StringPrefixSize + len(z.ClientToken) + 14 + msgp.StringPrefixSize + len(z.ClientAddress) + 10 + msgp.TimeSize + return +} + +// DecodeMsg implements msgp.Decodable +func (z *HealTaskStatus) 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 /* 1 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "summary": + z.Summary, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Summary") + return + } + case "detail": + z.FailureDetail, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "FailureDetail") + return + } + case "startTime": + z.StartTime, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "StartTime") + return + } + case "settings": + err = z.HealSettings.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "HealSettings") + return + } + case "items": + var zb0002 uint32 + zb0002, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "Items") + return + } + if cap(z.Items) >= int(zb0002) { + z.Items = (z.Items)[:zb0002] + } else { + z.Items = make([]HealResultItem, zb0002) + } + for za0001 := range z.Items { + err = z.Items[za0001].DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Items", za0001) + return + } + } + zb0001Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1 { + if (zb0001Mask & 0x1) == 0 { + z.Items = nil + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *HealTaskStatus) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(5) + var zb0001Mask uint8 /* 5 bits */ + _ = zb0001Mask + if z.Items == nil { + zb0001Len-- + zb0001Mask |= 0x10 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + // write "summary" + err = en.Append(0xa7, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79) + if err != nil { + return + } + err = en.WriteString(z.Summary) + if err != nil { + err = msgp.WrapError(err, "Summary") + return + } + // write "detail" + err = en.Append(0xa6, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c) + if err != nil { + return + } + err = en.WriteString(z.FailureDetail) + if err != nil { + err = msgp.WrapError(err, "FailureDetail") + return + } + // write "startTime" + err = en.Append(0xa9, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteTime(z.StartTime) + if err != nil { + err = msgp.WrapError(err, "StartTime") + return + } + // write "settings" + err = en.Append(0xa8, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73) + if err != nil { + return + } + err = z.HealSettings.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "HealSettings") + return + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // write "items" + err = en.Append(0xa5, 0x69, 0x74, 0x65, 0x6d, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Items))) + if err != nil { + err = msgp.WrapError(err, "Items") + return + } + for za0001 := range z.Items { + err = z.Items[za0001].EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Items", za0001) + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *HealTaskStatus) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(5) + var zb0001Mask uint8 /* 5 bits */ + _ = zb0001Mask + if z.Items == nil { + zb0001Len-- + zb0001Mask |= 0x10 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + // string "summary" + o = append(o, 0xa7, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79) + o = msgp.AppendString(o, z.Summary) + // string "detail" + o = append(o, 0xa6, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c) + o = msgp.AppendString(o, z.FailureDetail) + // string "startTime" + o = append(o, 0xa9, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65) + o = msgp.AppendTime(o, z.StartTime) + // string "settings" + o = append(o, 0xa8, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73) + o, err = z.HealSettings.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "HealSettings") + return + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // string "items" + o = append(o, 0xa5, 0x69, 0x74, 0x65, 0x6d, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.Items))) + for za0001 := range z.Items { + o, err = z.Items[za0001].MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Items", za0001) + return + } + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *HealTaskStatus) 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 /* 1 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 "summary": + z.Summary, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Summary") + return + } + case "detail": + z.FailureDetail, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "FailureDetail") + return + } + case "startTime": + z.StartTime, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "StartTime") + return + } + case "settings": + bts, err = z.HealSettings.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "HealSettings") + return + } + case "items": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Items") + return + } + if cap(z.Items) >= int(zb0002) { + z.Items = (z.Items)[:zb0002] + } else { + z.Items = make([]HealResultItem, zb0002) + } + for za0001 := range z.Items { + bts, err = z.Items[za0001].UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Items", za0001) + return + } + } + zb0001Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1 { + if (zb0001Mask & 0x1) == 0 { + z.Items = nil + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *HealTaskStatus) Msgsize() (s int) { + s = 1 + 8 + msgp.StringPrefixSize + len(z.Summary) + 7 + msgp.StringPrefixSize + len(z.FailureDetail) + 10 + msgp.TimeSize + 9 + z.HealSettings.Msgsize() + 6 + msgp.ArrayHeaderSize + for za0001 := range z.Items { + s += z.Items[za0001].Msgsize() + } + return +} + +// DecodeMsg implements msgp.Decodable +func (z *HealingDisk) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "id": + z.ID, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "ID") + return + } + case "heal_id": + z.HealID, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "HealID") + return + } + case "pool_index": + z.PoolIndex, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "PoolIndex") + return + } + case "set_index": + z.SetIndex, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "SetIndex") + return + } + case "disk_index": + z.DiskIndex, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "DiskIndex") + return + } + case "endpoint": + z.Endpoint, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Endpoint") + return + } + case "path": + z.Path, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Path") + return + } + case "started": + z.Started, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "Started") + return + } + case "last_update": + z.LastUpdate, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "LastUpdate") + return + } + case "retry_attempts": + z.RetryAttempts, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "RetryAttempts") + return + } + case "objects_total_count": + z.ObjectsTotalCount, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ObjectsTotalCount") + return + } + case "objects_total_size": + z.ObjectsTotalSize, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ObjectsTotalSize") + return + } + case "items_healed": + z.ItemsHealed, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ItemsHealed") + return + } + case "items_failed": + z.ItemsFailed, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ItemsFailed") + return + } + case "items_skipped": + z.ItemsSkipped, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ItemsSkipped") + return + } + case "bytes_done": + z.BytesDone, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "BytesDone") + return + } + case "bytes_failed": + z.BytesFailed, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "BytesFailed") + return + } + case "bytes_skipped": + z.BytesSkipped, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "BytesSkipped") + return + } + case "objects_healed": + z.ObjectsHealed, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ObjectsHealed") + return + } + case "objects_failed": + z.ObjectsFailed, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ObjectsFailed") + return + } + case "current_bucket": + z.Bucket, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Bucket") + return + } + case "current_object": + z.Object, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Object") + return + } + case "queued_buckets": + var zb0002 uint32 + zb0002, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "QueuedBuckets") + return + } + if cap(z.QueuedBuckets) >= int(zb0002) { + z.QueuedBuckets = (z.QueuedBuckets)[:zb0002] + } else { + z.QueuedBuckets = make([]string, zb0002) + } + for za0001 := range z.QueuedBuckets { + z.QueuedBuckets[za0001], err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "QueuedBuckets", za0001) + return + } + } + case "healed_buckets": + var zb0003 uint32 + zb0003, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "HealedBuckets") + return + } + if cap(z.HealedBuckets) >= int(zb0003) { + z.HealedBuckets = (z.HealedBuckets)[:zb0003] + } else { + z.HealedBuckets = make([]string, zb0003) + } + for za0002 := range z.HealedBuckets { + z.HealedBuckets[za0002], err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "HealedBuckets", za0002) + return + } + } + case "finished": + z.Finished, err = dc.ReadBool() + if err != nil { + err = msgp.WrapError(err, "Finished") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *HealingDisk) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 25 + // write "id" + err = en.Append(0xde, 0x0, 0x19, 0xa2, 0x69, 0x64) + if err != nil { + return + } + err = en.WriteString(z.ID) + if err != nil { + err = msgp.WrapError(err, "ID") + return + } + // write "heal_id" + err = en.Append(0xa7, 0x68, 0x65, 0x61, 0x6c, 0x5f, 0x69, 0x64) + if err != nil { + return + } + err = en.WriteString(z.HealID) + if err != nil { + err = msgp.WrapError(err, "HealID") + return + } + // write "pool_index" + err = en.Append(0xaa, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78) + if err != nil { + return + } + err = en.WriteInt(z.PoolIndex) + if err != nil { + err = msgp.WrapError(err, "PoolIndex") + return + } + // write "set_index" + err = en.Append(0xa9, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78) + if err != nil { + return + } + err = en.WriteInt(z.SetIndex) + if err != nil { + err = msgp.WrapError(err, "SetIndex") + return + } + // write "disk_index" + err = en.Append(0xaa, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78) + if err != nil { + return + } + err = en.WriteInt(z.DiskIndex) + if err != nil { + err = msgp.WrapError(err, "DiskIndex") + return + } + // write "endpoint" + err = en.Append(0xa8, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteString(z.Endpoint) + if err != nil { + err = msgp.WrapError(err, "Endpoint") + return + } + // write "path" + err = en.Append(0xa4, 0x70, 0x61, 0x74, 0x68) + if err != nil { + return + } + err = en.WriteString(z.Path) + if err != nil { + err = msgp.WrapError(err, "Path") + return + } + // write "started" + err = en.Append(0xa7, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteTime(z.Started) + if err != nil { + err = msgp.WrapError(err, "Started") + return + } + // write "last_update" + err = en.Append(0xab, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65) + if err != nil { + return + } + err = en.WriteTime(z.LastUpdate) + if err != nil { + err = msgp.WrapError(err, "LastUpdate") + return + } + // write "retry_attempts" + err = en.Append(0xae, 0x72, 0x65, 0x74, 0x72, 0x79, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.RetryAttempts) + if err != nil { + err = msgp.WrapError(err, "RetryAttempts") + return + } + // write "objects_total_count" + err = en.Append(0xb3, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteUint64(z.ObjectsTotalCount) + if err != nil { + err = msgp.WrapError(err, "ObjectsTotalCount") + return + } + // write "objects_total_size" + err = en.Append(0xb2, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.ObjectsTotalSize) + if err != nil { + err = msgp.WrapError(err, "ObjectsTotalSize") + return + } + // write "items_healed" + err = en.Append(0xac, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x5f, 0x68, 0x65, 0x61, 0x6c, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteUint64(z.ItemsHealed) + if err != nil { + err = msgp.WrapError(err, "ItemsHealed") + return + } + // write "items_failed" + err = en.Append(0xac, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteUint64(z.ItemsFailed) + if err != nil { + err = msgp.WrapError(err, "ItemsFailed") + return + } + // write "items_skipped" + err = en.Append(0xad, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteUint64(z.ItemsSkipped) + if err != nil { + err = msgp.WrapError(err, "ItemsSkipped") + return + } + // write "bytes_done" + err = en.Append(0xaa, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x64, 0x6f, 0x6e, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.BytesDone) + if err != nil { + err = msgp.WrapError(err, "BytesDone") + return + } + // write "bytes_failed" + err = en.Append(0xac, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteUint64(z.BytesFailed) + if err != nil { + err = msgp.WrapError(err, "BytesFailed") + return + } + // write "bytes_skipped" + err = en.Append(0xad, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteUint64(z.BytesSkipped) + if err != nil { + err = msgp.WrapError(err, "BytesSkipped") + return + } + // write "objects_healed" + err = en.Append(0xae, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x5f, 0x68, 0x65, 0x61, 0x6c, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteUint64(z.ObjectsHealed) + if err != nil { + err = msgp.WrapError(err, "ObjectsHealed") + return + } + // write "objects_failed" + err = en.Append(0xae, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteUint64(z.ObjectsFailed) + if err != nil { + err = msgp.WrapError(err, "ObjectsFailed") + return + } + // write "current_bucket" + err = en.Append(0xae, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74) + if err != nil { + return + } + err = en.WriteString(z.Bucket) + if err != nil { + err = msgp.WrapError(err, "Bucket") + return + } + // write "current_object" + err = en.Append(0xae, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74) + if err != nil { + return + } + err = en.WriteString(z.Object) + if err != nil { + err = msgp.WrapError(err, "Object") + return + } + // write "queued_buckets" + err = en.Append(0xae, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.QueuedBuckets))) + if err != nil { + err = msgp.WrapError(err, "QueuedBuckets") + return + } + for za0001 := range z.QueuedBuckets { + err = en.WriteString(z.QueuedBuckets[za0001]) + if err != nil { + err = msgp.WrapError(err, "QueuedBuckets", za0001) + return + } + } + // write "healed_buckets" + err = en.Append(0xae, 0x68, 0x65, 0x61, 0x6c, 0x65, 0x64, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.HealedBuckets))) + if err != nil { + err = msgp.WrapError(err, "HealedBuckets") + return + } + for za0002 := range z.HealedBuckets { + err = en.WriteString(z.HealedBuckets[za0002]) + if err != nil { + err = msgp.WrapError(err, "HealedBuckets", za0002) + return + } + } + // write "finished" + err = en.Append(0xa8, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteBool(z.Finished) + if err != nil { + err = msgp.WrapError(err, "Finished") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *HealingDisk) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 25 + // string "id" + o = append(o, 0xde, 0x0, 0x19, 0xa2, 0x69, 0x64) + o = msgp.AppendString(o, z.ID) + // string "heal_id" + o = append(o, 0xa7, 0x68, 0x65, 0x61, 0x6c, 0x5f, 0x69, 0x64) + o = msgp.AppendString(o, z.HealID) + // string "pool_index" + o = append(o, 0xaa, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78) + o = msgp.AppendInt(o, z.PoolIndex) + // string "set_index" + o = append(o, 0xa9, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78) + o = msgp.AppendInt(o, z.SetIndex) + // string "disk_index" + o = append(o, 0xaa, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78) + o = msgp.AppendInt(o, z.DiskIndex) + // string "endpoint" + o = append(o, 0xa8, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74) + o = msgp.AppendString(o, z.Endpoint) + // string "path" + o = append(o, 0xa4, 0x70, 0x61, 0x74, 0x68) + o = msgp.AppendString(o, z.Path) + // string "started" + o = append(o, 0xa7, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64) + o = msgp.AppendTime(o, z.Started) + // string "last_update" + o = append(o, 0xab, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65) + o = msgp.AppendTime(o, z.LastUpdate) + // string "retry_attempts" + o = append(o, 0xae, 0x72, 0x65, 0x74, 0x72, 0x79, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x73) + o = msgp.AppendUint64(o, z.RetryAttempts) + // string "objects_total_count" + o = append(o, 0xb3, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendUint64(o, z.ObjectsTotalCount) + // string "objects_total_size" + o = append(o, 0xb2, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65) + o = msgp.AppendUint64(o, z.ObjectsTotalSize) + // string "items_healed" + o = append(o, 0xac, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x5f, 0x68, 0x65, 0x61, 0x6c, 0x65, 0x64) + o = msgp.AppendUint64(o, z.ItemsHealed) + // string "items_failed" + o = append(o, 0xac, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64) + o = msgp.AppendUint64(o, z.ItemsFailed) + // string "items_skipped" + o = append(o, 0xad, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64) + o = msgp.AppendUint64(o, z.ItemsSkipped) + // string "bytes_done" + o = append(o, 0xaa, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x64, 0x6f, 0x6e, 0x65) + o = msgp.AppendUint64(o, z.BytesDone) + // string "bytes_failed" + o = append(o, 0xac, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64) + o = msgp.AppendUint64(o, z.BytesFailed) + // string "bytes_skipped" + o = append(o, 0xad, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64) + o = msgp.AppendUint64(o, z.BytesSkipped) + // string "objects_healed" + o = append(o, 0xae, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x5f, 0x68, 0x65, 0x61, 0x6c, 0x65, 0x64) + o = msgp.AppendUint64(o, z.ObjectsHealed) + // string "objects_failed" + o = append(o, 0xae, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64) + o = msgp.AppendUint64(o, z.ObjectsFailed) + // string "current_bucket" + o = append(o, 0xae, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74) + o = msgp.AppendString(o, z.Bucket) + // string "current_object" + o = append(o, 0xae, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74) + o = msgp.AppendString(o, z.Object) + // string "queued_buckets" + o = append(o, 0xae, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.QueuedBuckets))) + for za0001 := range z.QueuedBuckets { + o = msgp.AppendString(o, z.QueuedBuckets[za0001]) + } + // string "healed_buckets" + o = append(o, 0xae, 0x68, 0x65, 0x61, 0x6c, 0x65, 0x64, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.HealedBuckets))) + for za0002 := range z.HealedBuckets { + o = msgp.AppendString(o, z.HealedBuckets[za0002]) + } + // string "finished" + o = append(o, 0xa8, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64) + o = msgp.AppendBool(o, z.Finished) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *HealingDisk) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "id": + z.ID, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ID") + return + } + case "heal_id": + z.HealID, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "HealID") + return + } + case "pool_index": + z.PoolIndex, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "PoolIndex") + return + } + case "set_index": + z.SetIndex, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "SetIndex") + return + } + case "disk_index": + z.DiskIndex, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "DiskIndex") + return + } + case "endpoint": + z.Endpoint, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Endpoint") + return + } + case "path": + z.Path, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Path") + return + } + case "started": + z.Started, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Started") + return + } + case "last_update": + z.LastUpdate, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LastUpdate") + return + } + case "retry_attempts": + z.RetryAttempts, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "RetryAttempts") + return + } + case "objects_total_count": + z.ObjectsTotalCount, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ObjectsTotalCount") + return + } + case "objects_total_size": + z.ObjectsTotalSize, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ObjectsTotalSize") + return + } + case "items_healed": + z.ItemsHealed, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ItemsHealed") + return + } + case "items_failed": + z.ItemsFailed, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ItemsFailed") + return + } + case "items_skipped": + z.ItemsSkipped, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ItemsSkipped") + return + } + case "bytes_done": + z.BytesDone, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "BytesDone") + return + } + case "bytes_failed": + z.BytesFailed, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "BytesFailed") + return + } + case "bytes_skipped": + z.BytesSkipped, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "BytesSkipped") + return + } + case "objects_healed": + z.ObjectsHealed, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ObjectsHealed") + return + } + case "objects_failed": + z.ObjectsFailed, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ObjectsFailed") + return + } + case "current_bucket": + z.Bucket, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Bucket") + return + } + case "current_object": + z.Object, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Object") + return + } + case "queued_buckets": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "QueuedBuckets") + return + } + if cap(z.QueuedBuckets) >= int(zb0002) { + z.QueuedBuckets = (z.QueuedBuckets)[:zb0002] + } else { + z.QueuedBuckets = make([]string, zb0002) + } + for za0001 := range z.QueuedBuckets { + z.QueuedBuckets[za0001], bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "QueuedBuckets", za0001) + return + } + } + case "healed_buckets": + var zb0003 uint32 + zb0003, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "HealedBuckets") + return + } + if cap(z.HealedBuckets) >= int(zb0003) { + z.HealedBuckets = (z.HealedBuckets)[:zb0003] + } else { + z.HealedBuckets = make([]string, zb0003) + } + for za0002 := range z.HealedBuckets { + z.HealedBuckets[za0002], bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "HealedBuckets", za0002) + return + } + } + case "finished": + z.Finished, bts, err = msgp.ReadBoolBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Finished") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *HealingDisk) Msgsize() (s int) { + s = 3 + 3 + msgp.StringPrefixSize + len(z.ID) + 8 + msgp.StringPrefixSize + len(z.HealID) + 11 + msgp.IntSize + 10 + msgp.IntSize + 11 + msgp.IntSize + 9 + msgp.StringPrefixSize + len(z.Endpoint) + 5 + msgp.StringPrefixSize + len(z.Path) + 8 + msgp.TimeSize + 12 + msgp.TimeSize + 15 + msgp.Uint64Size + 20 + msgp.Uint64Size + 19 + msgp.Uint64Size + 13 + msgp.Uint64Size + 13 + msgp.Uint64Size + 14 + msgp.Uint64Size + 11 + msgp.Uint64Size + 13 + msgp.Uint64Size + 14 + msgp.Uint64Size + 15 + msgp.Uint64Size + 15 + msgp.Uint64Size + 15 + msgp.StringPrefixSize + len(z.Bucket) + 15 + msgp.StringPrefixSize + len(z.Object) + 15 + msgp.ArrayHeaderSize + for za0001 := range z.QueuedBuckets { + s += msgp.StringPrefixSize + len(z.QueuedBuckets[za0001]) + } + s += 15 + msgp.ArrayHeaderSize + for za0002 := range z.HealedBuckets { + s += msgp.StringPrefixSize + len(z.HealedBuckets[za0002]) + } + s += 9 + msgp.BoolSize + return +} + +// DecodeMsg implements msgp.Decodable +func (z *MRFStatus) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "bytes_healed": + z.BytesHealed, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "BytesHealed") + return + } + case "items_healed": + z.ItemsHealed, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ItemsHealed") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z MRFStatus) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 2 + // write "bytes_healed" + err = en.Append(0x82, 0xac, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x68, 0x65, 0x61, 0x6c, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteUint64(z.BytesHealed) + if err != nil { + err = msgp.WrapError(err, "BytesHealed") + return + } + // write "items_healed" + err = en.Append(0xac, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x5f, 0x68, 0x65, 0x61, 0x6c, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteUint64(z.ItemsHealed) + if err != nil { + err = msgp.WrapError(err, "ItemsHealed") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z MRFStatus) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 2 + // string "bytes_healed" + o = append(o, 0x82, 0xac, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x68, 0x65, 0x61, 0x6c, 0x65, 0x64) + o = msgp.AppendUint64(o, z.BytesHealed) + // string "items_healed" + o = append(o, 0xac, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x5f, 0x68, 0x65, 0x61, 0x6c, 0x65, 0x64) + o = msgp.AppendUint64(o, z.ItemsHealed) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *MRFStatus) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "bytes_healed": + z.BytesHealed, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "BytesHealed") + return + } + case "items_healed": + z.ItemsHealed, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ItemsHealed") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z MRFStatus) Msgsize() (s int) { + s = 1 + 13 + msgp.Uint64Size + 13 + msgp.Uint64Size + return +} + +// DecodeMsg implements msgp.Decodable +func (z *SetStatus) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "id": + z.ID, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "ID") + return + } + case "pool_index": + z.PoolIndex, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "PoolIndex") + return + } + case "set_index": + z.SetIndex, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "SetIndex") + return + } + case "heal_status": + z.HealStatus, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "HealStatus") + return + } + case "heal_priority": + z.HealPriority, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "HealPriority") + return + } + case "total_objects": + z.TotalObjects, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "TotalObjects") + return + } + case "disks": + var zb0002 uint32 + zb0002, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "Disks") + return + } + if cap(z.Disks) >= int(zb0002) { + z.Disks = (z.Disks)[:zb0002] + } else { + z.Disks = make([]Disk, zb0002) + } + for za0001 := range z.Disks { + err = z.Disks[za0001].DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Disks", za0001) + return + } + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *SetStatus) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 7 + // write "id" + err = en.Append(0x87, 0xa2, 0x69, 0x64) + if err != nil { + return + } + err = en.WriteString(z.ID) + if err != nil { + err = msgp.WrapError(err, "ID") + return + } + // write "pool_index" + err = en.Append(0xaa, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78) + if err != nil { + return + } + err = en.WriteInt(z.PoolIndex) + if err != nil { + err = msgp.WrapError(err, "PoolIndex") + return + } + // write "set_index" + err = en.Append(0xa9, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78) + if err != nil { + return + } + err = en.WriteInt(z.SetIndex) + if err != nil { + err = msgp.WrapError(err, "SetIndex") + return + } + // write "heal_status" + err = en.Append(0xab, 0x68, 0x65, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73) + if err != nil { + return + } + err = en.WriteString(z.HealStatus) + if err != nil { + err = msgp.WrapError(err, "HealStatus") + return + } + // write "heal_priority" + err = en.Append(0xad, 0x68, 0x65, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79) + if err != nil { + return + } + err = en.WriteString(z.HealPriority) + if err != nil { + err = msgp.WrapError(err, "HealPriority") + return + } + // write "total_objects" + err = en.Append(0xad, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteInt(z.TotalObjects) + if err != nil { + err = msgp.WrapError(err, "TotalObjects") + return + } + // write "disks" + err = en.Append(0xa5, 0x64, 0x69, 0x73, 0x6b, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Disks))) + if err != nil { + err = msgp.WrapError(err, "Disks") + return + } + for za0001 := range z.Disks { + err = z.Disks[za0001].EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Disks", za0001) + return + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *SetStatus) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 7 + // string "id" + o = append(o, 0x87, 0xa2, 0x69, 0x64) + o = msgp.AppendString(o, z.ID) + // string "pool_index" + o = append(o, 0xaa, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78) + o = msgp.AppendInt(o, z.PoolIndex) + // string "set_index" + o = append(o, 0xa9, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78) + o = msgp.AppendInt(o, z.SetIndex) + // string "heal_status" + o = append(o, 0xab, 0x68, 0x65, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73) + o = msgp.AppendString(o, z.HealStatus) + // string "heal_priority" + o = append(o, 0xad, 0x68, 0x65, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79) + o = msgp.AppendString(o, z.HealPriority) + // string "total_objects" + o = append(o, 0xad, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73) + o = msgp.AppendInt(o, z.TotalObjects) + // string "disks" + o = append(o, 0xa5, 0x64, 0x69, 0x73, 0x6b, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.Disks))) + for za0001 := range z.Disks { + o, err = z.Disks[za0001].MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Disks", za0001) + return + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *SetStatus) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "id": + z.ID, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ID") + return + } + case "pool_index": + z.PoolIndex, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "PoolIndex") + return + } + case "set_index": + z.SetIndex, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "SetIndex") + return + } + case "heal_status": + z.HealStatus, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "HealStatus") + return + } + case "heal_priority": + z.HealPriority, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "HealPriority") + return + } + case "total_objects": + z.TotalObjects, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "TotalObjects") + return + } + case "disks": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Disks") + return + } + if cap(z.Disks) >= int(zb0002) { + z.Disks = (z.Disks)[:zb0002] + } else { + z.Disks = make([]Disk, zb0002) + } + for za0001 := range z.Disks { + bts, err = z.Disks[za0001].UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Disks", za0001) + return + } + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *SetStatus) Msgsize() (s int) { + s = 1 + 3 + msgp.StringPrefixSize + len(z.ID) + 11 + msgp.IntSize + 10 + msgp.IntSize + 12 + msgp.StringPrefixSize + len(z.HealStatus) + 14 + msgp.StringPrefixSize + len(z.HealPriority) + 14 + msgp.IntSize + 6 + msgp.ArrayHeaderSize + for za0001 := range z.Disks { + s += z.Disks[za0001].Msgsize() + } + return +} diff --git a/heal-commands_gen_test.go b/heal-commands_gen_test.go new file mode 100644 index 0000000..3fca0bf --- /dev/null +++ b/heal-commands_gen_test.go @@ -0,0 +1,1140 @@ +package madmin + +// Code generated by github.com/tinylib/msgp DO NOT EDIT. + +import ( + "bytes" + "testing" + + "github.com/tinylib/msgp/msgp" +) + +func TestMarshalUnmarshalBgHealState(t *testing.T) { + v := BgHealState{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgBgHealState(b *testing.B) { + v := BgHealState{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgBgHealState(b *testing.B) { + v := BgHealState{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalBgHealState(b *testing.B) { + v := BgHealState{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeBgHealState(t *testing.T) { + v := BgHealState{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeBgHealState Msgsize() is inaccurate") + } + + vn := BgHealState{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeBgHealState(b *testing.B) { + v := BgHealState{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeBgHealState(b *testing.B) { + v := BgHealState{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalHealDriveInfo(t *testing.T) { + v := HealDriveInfo{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgHealDriveInfo(b *testing.B) { + v := HealDriveInfo{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgHealDriveInfo(b *testing.B) { + v := HealDriveInfo{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalHealDriveInfo(b *testing.B) { + v := HealDriveInfo{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeHealDriveInfo(t *testing.T) { + v := HealDriveInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeHealDriveInfo Msgsize() is inaccurate") + } + + vn := HealDriveInfo{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeHealDriveInfo(b *testing.B) { + v := HealDriveInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeHealDriveInfo(b *testing.B) { + v := HealDriveInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalHealOpts(t *testing.T) { + v := HealOpts{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgHealOpts(b *testing.B) { + v := HealOpts{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgHealOpts(b *testing.B) { + v := HealOpts{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalHealOpts(b *testing.B) { + v := HealOpts{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeHealOpts(t *testing.T) { + v := HealOpts{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeHealOpts Msgsize() is inaccurate") + } + + vn := HealOpts{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeHealOpts(b *testing.B) { + v := HealOpts{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeHealOpts(b *testing.B) { + v := HealOpts{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalHealResultItem(t *testing.T) { + v := HealResultItem{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgHealResultItem(b *testing.B) { + v := HealResultItem{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgHealResultItem(b *testing.B) { + v := HealResultItem{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalHealResultItem(b *testing.B) { + v := HealResultItem{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeHealResultItem(t *testing.T) { + v := HealResultItem{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeHealResultItem Msgsize() is inaccurate") + } + + vn := HealResultItem{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeHealResultItem(b *testing.B) { + v := HealResultItem{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeHealResultItem(b *testing.B) { + v := HealResultItem{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalHealStartSuccess(t *testing.T) { + v := HealStartSuccess{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgHealStartSuccess(b *testing.B) { + v := HealStartSuccess{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgHealStartSuccess(b *testing.B) { + v := HealStartSuccess{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalHealStartSuccess(b *testing.B) { + v := HealStartSuccess{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeHealStartSuccess(t *testing.T) { + v := HealStartSuccess{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeHealStartSuccess Msgsize() is inaccurate") + } + + vn := HealStartSuccess{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeHealStartSuccess(b *testing.B) { + v := HealStartSuccess{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeHealStartSuccess(b *testing.B) { + v := HealStartSuccess{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalHealStopSuccess(t *testing.T) { + v := HealStopSuccess{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgHealStopSuccess(b *testing.B) { + v := HealStopSuccess{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgHealStopSuccess(b *testing.B) { + v := HealStopSuccess{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalHealStopSuccess(b *testing.B) { + v := HealStopSuccess{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeHealStopSuccess(t *testing.T) { + v := HealStopSuccess{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeHealStopSuccess Msgsize() is inaccurate") + } + + vn := HealStopSuccess{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeHealStopSuccess(b *testing.B) { + v := HealStopSuccess{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeHealStopSuccess(b *testing.B) { + v := HealStopSuccess{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalHealTaskStatus(t *testing.T) { + v := HealTaskStatus{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgHealTaskStatus(b *testing.B) { + v := HealTaskStatus{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgHealTaskStatus(b *testing.B) { + v := HealTaskStatus{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalHealTaskStatus(b *testing.B) { + v := HealTaskStatus{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeHealTaskStatus(t *testing.T) { + v := HealTaskStatus{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeHealTaskStatus Msgsize() is inaccurate") + } + + vn := HealTaskStatus{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeHealTaskStatus(b *testing.B) { + v := HealTaskStatus{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeHealTaskStatus(b *testing.B) { + v := HealTaskStatus{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalHealingDisk(t *testing.T) { + v := HealingDisk{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgHealingDisk(b *testing.B) { + v := HealingDisk{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgHealingDisk(b *testing.B) { + v := HealingDisk{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalHealingDisk(b *testing.B) { + v := HealingDisk{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeHealingDisk(t *testing.T) { + v := HealingDisk{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeHealingDisk Msgsize() is inaccurate") + } + + vn := HealingDisk{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeHealingDisk(b *testing.B) { + v := HealingDisk{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeHealingDisk(b *testing.B) { + v := HealingDisk{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalMRFStatus(t *testing.T) { + v := MRFStatus{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgMRFStatus(b *testing.B) { + v := MRFStatus{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgMRFStatus(b *testing.B) { + v := MRFStatus{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalMRFStatus(b *testing.B) { + v := MRFStatus{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeMRFStatus(t *testing.T) { + v := MRFStatus{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeMRFStatus Msgsize() is inaccurate") + } + + vn := MRFStatus{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeMRFStatus(b *testing.B) { + v := MRFStatus{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeMRFStatus(b *testing.B) { + v := MRFStatus{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalSetStatus(t *testing.T) { + v := SetStatus{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgSetStatus(b *testing.B) { + v := SetStatus{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgSetStatus(b *testing.B) { + v := SetStatus{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalSetStatus(b *testing.B) { + v := SetStatus{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeSetStatus(t *testing.T) { + v := SetStatus{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeSetStatus Msgsize() is inaccurate") + } + + vn := SetStatus{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeSetStatus(b *testing.B) { + v := SetStatus{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeSetStatus(b *testing.B) { + v := SetStatus{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} diff --git a/health.go b/health.go index 5e4b446..0f2e15b 100644 --- a/health.go +++ b/health.go @@ -85,27 +85,6 @@ type NodeInfo interface { SetError(err string) } -// NodeCommon - Common fields across most node-specific health structs -type NodeCommon struct { - Addr string `json:"addr"` - Error string `json:"error,omitempty"` -} - -// GetAddr - return the address of the node -func (n *NodeCommon) GetAddr() string { - return n.Addr -} - -// SetAddr - set the address of the node -func (n *NodeCommon) SetAddr(addr string) { - n.Addr = addr -} - -// SetError - set the address of the node -func (n *NodeCommon) SetError(err string) { - n.Error = err -} - // SysErrors - contains a system error type SysErrors struct { NodeCommon @@ -692,24 +671,6 @@ func isKauditdRunning() (bool, error) { return false, nil } -// MemInfo contains system's RAM and swap information. -type MemInfo struct { - NodeCommon - - Total uint64 `json:"total,omitempty"` - Used uint64 `json:"used,omitempty"` - Free uint64 `json:"free,omitempty"` - Available uint64 `json:"available,omitempty"` - Shared uint64 `json:"shared,omitempty"` - Cache uint64 `json:"cache,omitempty"` - Buffers uint64 `json:"buffer,omitempty"` - SwapSpaceTotal uint64 `json:"swap_space_total,omitempty"` - SwapSpaceFree uint64 `json:"swap_space_free,omitempty"` - // Limit will store cgroup limit if configured and - // less than Total, otherwise same as Total - Limit uint64 `json:"limit,omitempty"` -} - // Get the final system memory limit chosen by the user. // by default without any configuration on a vanilla Linux // system you would see physical RAM limit. If cgroup @@ -1018,24 +979,6 @@ type MinioConfig struct { Config interface{} `json:"config,omitempty"` } -// MemStats is strip down version of runtime.MemStats containing memory stats of MinIO server. -type MemStats struct { - Alloc uint64 - TotalAlloc uint64 - Mallocs uint64 - Frees uint64 - HeapAlloc uint64 -} - -// GCStats collect information about recent garbage collections. -type GCStats struct { - LastGC time.Time `json:"last_gc"` // time of last collection - NumGC int64 `json:"num_gc"` // number of garbage collections - PauseTotal time.Duration `json:"pause_total"` // total pause for all collections - Pause []time.Duration `json:"pause"` // pause history, most recent first - PauseEnd []time.Time `json:"pause_end"` // pause end times history, most recent first -} - // ServerInfo holds server information type ServerInfo struct { State string `json:"state,omitempty"` diff --git a/info-commands.go b/info-commands.go index cb3a7fc..4749891 100644 --- a/info-commands.go +++ b/info-commands.go @@ -28,6 +28,10 @@ import ( "time" ) +//msgp:clearomitted +//msgp:tag json +//go:generate msgp + // BackendType - represents different backend types. type BackendType int @@ -369,6 +373,8 @@ type Logger map[string]Status // TargetIDStatus containsid and status type TargetIDStatus map[string]Status +//msgp:replace backendType with:string + // backendType - indicates the type of backend storage type backendType string @@ -419,6 +425,24 @@ type ServerProperties struct { MinioEnvVars map[string]string `json:"minio_env_vars,omitempty"` } +// MemStats is strip down version of runtime.MemStats containing memory stats of MinIO server. +type MemStats struct { + Alloc uint64 + TotalAlloc uint64 + Mallocs uint64 + Frees uint64 + HeapAlloc uint64 +} + +// GCStats collect information about recent garbage collections. +type GCStats struct { + LastGC time.Time `json:"last_gc"` // time of last collection + NumGC int64 `json:"num_gc"` // number of garbage collections + PauseTotal time.Duration `json:"pause_total"` // total pause for all collections + Pause []time.Duration `json:"pause"` // pause history, most recent first + PauseEnd []time.Time `json:"pause_end"` // pause end times history, most recent first +} + // DiskMetrics has the information about XL Storage APIs // the number of calls of each API and the moving average of // the duration, in nanosecond, of each API. diff --git a/info-commands_gen.go b/info-commands_gen.go new file mode 100644 index 0000000..b530a19 --- /dev/null +++ b/info-commands_gen.go @@ -0,0 +1,12183 @@ +package madmin + +// Code generated by github.com/tinylib/msgp DO NOT EDIT. + +import ( + "time" + + "github.com/tinylib/msgp/msgp" +) + +// DecodeMsg implements msgp.Decodable +func (z *Audit) DecodeMsg(dc *msgp.Reader) (err error) { + var zb0003 uint32 + zb0003, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err) + return + } + if (*z) == nil { + (*z) = make(Audit, zb0003) + } else if len((*z)) > 0 { + for key := range *z { + delete((*z), key) + } + } + var field []byte + _ = field + for zb0003 > 0 { + zb0003-- + var zb0001 string + var zb0002 Status + zb0001, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0004 uint32 + zb0004, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, zb0001) + return + } + var zb0004Mask uint8 /* 1 bits */ + _ = zb0004Mask + for zb0004 > 0 { + zb0004-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, zb0001) + return + } + switch msgp.UnsafeString(field) { + case "status": + zb0002.Status, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, zb0001, "Status") + return + } + zb0004Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, zb0001) + return + } + } + } + // Clear omitted fields. + if zb0004Mask != 0x1 { + if (zb0004Mask & 0x1) == 0 { + zb0002.Status = "" + } + } + (*z)[zb0001] = zb0002 + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z Audit) EncodeMsg(en *msgp.Writer) (err error) { + err = en.WriteMapHeader(uint32(len(z))) + if err != nil { + err = msgp.WrapError(err) + return + } + for zb0005, zb0006 := range z { + err = en.WriteString(zb0005) + if err != nil { + err = msgp.WrapError(err) + return + } + // check for omitted fields + zb0001Len := uint32(1) + var zb0001Mask uint8 /* 1 bits */ + _ = zb0001Mask + if zb0006.Status == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + if (zb0001Mask & 0x1) == 0 { // if not omitted + // write "status" + err = en.Append(0xa6, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73) + if err != nil { + return + } + err = en.WriteString(zb0006.Status) + if err != nil { + err = msgp.WrapError(err, zb0005, "Status") + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z Audit) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + o = msgp.AppendMapHeader(o, uint32(len(z))) + for zb0005, zb0006 := range z { + o = msgp.AppendString(o, zb0005) + // check for omitted fields + zb0001Len := uint32(1) + var zb0001Mask uint8 /* 1 bits */ + _ = zb0001Mask + if zb0006.Status == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + if (zb0001Mask & 0x1) == 0 { // if not omitted + // string "status" + o = append(o, 0xa6, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73) + o = msgp.AppendString(o, zb0006.Status) + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *Audit) UnmarshalMsg(bts []byte) (o []byte, err error) { + var zb0003 uint32 + zb0003, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + if (*z) == nil { + (*z) = make(Audit, zb0003) + } else if len((*z)) > 0 { + for key := range *z { + delete((*z), key) + } + } + var field []byte + _ = field + for zb0003 > 0 { + var zb0001 string + var zb0002 Status + zb0003-- + zb0001, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0004 uint32 + zb0004, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, zb0001) + return + } + var zb0004Mask uint8 /* 1 bits */ + _ = zb0004Mask + for zb0004 > 0 { + zb0004-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, zb0001) + return + } + switch msgp.UnsafeString(field) { + case "status": + zb0002.Status, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, zb0001, "Status") + return + } + zb0004Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, zb0001) + return + } + } + } + // Clear omitted fields. + if zb0004Mask != 0x1 { + if (zb0004Mask & 0x1) == 0 { + zb0002.Status = "" + } + } + (*z)[zb0001] = zb0002 + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z Audit) Msgsize() (s int) { + s = msgp.MapHeaderSize + if z != nil { + for zb0005, zb0006 := range z { + _ = zb0006 + s += msgp.StringPrefixSize + len(zb0005) + 1 + 7 + msgp.StringPrefixSize + len(zb0006.Status) + } + } + return +} + +// DecodeMsg implements msgp.Decodable +func (z *BackendDisks) DecodeMsg(dc *msgp.Reader) (err error) { + var zb0003 uint32 + zb0003, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err) + return + } + if (*z) == nil { + (*z) = make(BackendDisks, zb0003) + } else if len((*z)) > 0 { + for key := range *z { + delete((*z), key) + } + } + var field []byte + _ = field + for zb0003 > 0 { + zb0003-- + var zb0001 string + var zb0002 int + zb0001, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err) + return + } + zb0002, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, zb0001) + return + } + (*z)[zb0001] = zb0002 + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z BackendDisks) EncodeMsg(en *msgp.Writer) (err error) { + err = en.WriteMapHeader(uint32(len(z))) + if err != nil { + err = msgp.WrapError(err) + return + } + for zb0004, zb0005 := range z { + err = en.WriteString(zb0004) + if err != nil { + err = msgp.WrapError(err) + return + } + err = en.WriteInt(zb0005) + if err != nil { + err = msgp.WrapError(err, zb0004) + return + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z BackendDisks) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + o = msgp.AppendMapHeader(o, uint32(len(z))) + for zb0004, zb0005 := range z { + o = msgp.AppendString(o, zb0004) + o = msgp.AppendInt(o, zb0005) + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *BackendDisks) UnmarshalMsg(bts []byte) (o []byte, err error) { + var zb0003 uint32 + zb0003, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + if (*z) == nil { + (*z) = make(BackendDisks, zb0003) + } else if len((*z)) > 0 { + for key := range *z { + delete((*z), key) + } + } + var field []byte + _ = field + for zb0003 > 0 { + var zb0001 string + var zb0002 int + zb0003-- + zb0001, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + zb0002, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, zb0001) + return + } + (*z)[zb0001] = zb0002 + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z BackendDisks) Msgsize() (s int) { + s = msgp.MapHeaderSize + if z != nil { + for zb0004, zb0005 := range z { + _ = zb0005 + s += msgp.StringPrefixSize + len(zb0004) + msgp.IntSize + } + } + return +} + +// DecodeMsg implements msgp.Decodable +func (z *BackendInfo) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "Type": + { + var zb0002 int + zb0002, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "Type") + return + } + z.Type = BackendType(zb0002) + } + case "GatewayOnline": + z.GatewayOnline, err = dc.ReadBool() + if err != nil { + err = msgp.WrapError(err, "GatewayOnline") + return + } + case "OnlineDisks": + var zb0003 uint32 + zb0003, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "OnlineDisks") + return + } + if z.OnlineDisks == nil { + z.OnlineDisks = make(BackendDisks, zb0003) + } else if len(z.OnlineDisks) > 0 { + for key := range z.OnlineDisks { + delete(z.OnlineDisks, key) + } + } + for zb0003 > 0 { + zb0003-- + var za0001 string + var za0002 int + za0001, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "OnlineDisks") + return + } + za0002, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "OnlineDisks", za0001) + return + } + z.OnlineDisks[za0001] = za0002 + } + case "OfflineDisks": + var zb0004 uint32 + zb0004, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "OfflineDisks") + return + } + if z.OfflineDisks == nil { + z.OfflineDisks = make(BackendDisks, zb0004) + } else if len(z.OfflineDisks) > 0 { + for key := range z.OfflineDisks { + delete(z.OfflineDisks, key) + } + } + for zb0004 > 0 { + zb0004-- + var za0003 string + var za0004 int + za0003, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "OfflineDisks") + return + } + za0004, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "OfflineDisks", za0003) + return + } + z.OfflineDisks[za0003] = za0004 + } + case "StandardSCData": + var zb0005 uint32 + zb0005, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "StandardSCData") + return + } + if cap(z.StandardSCData) >= int(zb0005) { + z.StandardSCData = (z.StandardSCData)[:zb0005] + } else { + z.StandardSCData = make([]int, zb0005) + } + for za0005 := range z.StandardSCData { + z.StandardSCData[za0005], err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "StandardSCData", za0005) + return + } + } + case "StandardSCParities": + var zb0006 uint32 + zb0006, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "StandardSCParities") + return + } + if cap(z.StandardSCParities) >= int(zb0006) { + z.StandardSCParities = (z.StandardSCParities)[:zb0006] + } else { + z.StandardSCParities = make([]int, zb0006) + } + for za0006 := range z.StandardSCParities { + z.StandardSCParities[za0006], err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "StandardSCParities", za0006) + return + } + } + case "RRSCData": + var zb0007 uint32 + zb0007, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "RRSCData") + return + } + if cap(z.RRSCData) >= int(zb0007) { + z.RRSCData = (z.RRSCData)[:zb0007] + } else { + z.RRSCData = make([]int, zb0007) + } + for za0007 := range z.RRSCData { + z.RRSCData[za0007], err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "RRSCData", za0007) + return + } + } + case "RRSCParities": + var zb0008 uint32 + zb0008, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "RRSCParities") + return + } + if cap(z.RRSCParities) >= int(zb0008) { + z.RRSCParities = (z.RRSCParities)[:zb0008] + } else { + z.RRSCParities = make([]int, zb0008) + } + for za0008 := range z.RRSCParities { + z.RRSCParities[za0008], err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "RRSCParities", za0008) + return + } + } + case "TotalSets": + var zb0009 uint32 + zb0009, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "TotalSets") + return + } + if cap(z.TotalSets) >= int(zb0009) { + z.TotalSets = (z.TotalSets)[:zb0009] + } else { + z.TotalSets = make([]int, zb0009) + } + for za0009 := range z.TotalSets { + z.TotalSets[za0009], err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "TotalSets", za0009) + return + } + } + case "DrivesPerSet": + var zb0010 uint32 + zb0010, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "DrivesPerSet") + return + } + if cap(z.DrivesPerSet) >= int(zb0010) { + z.DrivesPerSet = (z.DrivesPerSet)[:zb0010] + } else { + z.DrivesPerSet = make([]int, zb0010) + } + for za0010 := range z.DrivesPerSet { + z.DrivesPerSet[za0010], err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "DrivesPerSet", za0010) + return + } + } + case "StandardSCParity": + z.StandardSCParity, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "StandardSCParity") + return + } + case "RRSCParity": + z.RRSCParity, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "RRSCParity") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *BackendInfo) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 12 + // write "Type" + err = en.Append(0x8c, 0xa4, 0x54, 0x79, 0x70, 0x65) + if err != nil { + return + } + err = en.WriteInt(int(z.Type)) + if err != nil { + err = msgp.WrapError(err, "Type") + return + } + // write "GatewayOnline" + err = en.Append(0xad, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65) + if err != nil { + return + } + err = en.WriteBool(z.GatewayOnline) + if err != nil { + err = msgp.WrapError(err, "GatewayOnline") + return + } + // write "OnlineDisks" + err = en.Append(0xab, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x69, 0x73, 0x6b, 0x73) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.OnlineDisks))) + if err != nil { + err = msgp.WrapError(err, "OnlineDisks") + return + } + for za0001, za0002 := range z.OnlineDisks { + err = en.WriteString(za0001) + if err != nil { + err = msgp.WrapError(err, "OnlineDisks") + return + } + err = en.WriteInt(za0002) + if err != nil { + err = msgp.WrapError(err, "OnlineDisks", za0001) + return + } + } + // write "OfflineDisks" + err = en.Append(0xac, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x69, 0x73, 0x6b, 0x73) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.OfflineDisks))) + if err != nil { + err = msgp.WrapError(err, "OfflineDisks") + return + } + for za0003, za0004 := range z.OfflineDisks { + err = en.WriteString(za0003) + if err != nil { + err = msgp.WrapError(err, "OfflineDisks") + return + } + err = en.WriteInt(za0004) + if err != nil { + err = msgp.WrapError(err, "OfflineDisks", za0003) + return + } + } + // write "StandardSCData" + err = en.Append(0xae, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x53, 0x43, 0x44, 0x61, 0x74, 0x61) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.StandardSCData))) + if err != nil { + err = msgp.WrapError(err, "StandardSCData") + return + } + for za0005 := range z.StandardSCData { + err = en.WriteInt(z.StandardSCData[za0005]) + if err != nil { + err = msgp.WrapError(err, "StandardSCData", za0005) + return + } + } + // write "StandardSCParities" + err = en.Append(0xb2, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x53, 0x43, 0x50, 0x61, 0x72, 0x69, 0x74, 0x69, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.StandardSCParities))) + if err != nil { + err = msgp.WrapError(err, "StandardSCParities") + return + } + for za0006 := range z.StandardSCParities { + err = en.WriteInt(z.StandardSCParities[za0006]) + if err != nil { + err = msgp.WrapError(err, "StandardSCParities", za0006) + return + } + } + // write "RRSCData" + err = en.Append(0xa8, 0x52, 0x52, 0x53, 0x43, 0x44, 0x61, 0x74, 0x61) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.RRSCData))) + if err != nil { + err = msgp.WrapError(err, "RRSCData") + return + } + for za0007 := range z.RRSCData { + err = en.WriteInt(z.RRSCData[za0007]) + if err != nil { + err = msgp.WrapError(err, "RRSCData", za0007) + return + } + } + // write "RRSCParities" + err = en.Append(0xac, 0x52, 0x52, 0x53, 0x43, 0x50, 0x61, 0x72, 0x69, 0x74, 0x69, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.RRSCParities))) + if err != nil { + err = msgp.WrapError(err, "RRSCParities") + return + } + for za0008 := range z.RRSCParities { + err = en.WriteInt(z.RRSCParities[za0008]) + if err != nil { + err = msgp.WrapError(err, "RRSCParities", za0008) + return + } + } + // write "TotalSets" + err = en.Append(0xa9, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x65, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.TotalSets))) + if err != nil { + err = msgp.WrapError(err, "TotalSets") + return + } + for za0009 := range z.TotalSets { + err = en.WriteInt(z.TotalSets[za0009]) + if err != nil { + err = msgp.WrapError(err, "TotalSets", za0009) + return + } + } + // write "DrivesPerSet" + err = en.Append(0xac, 0x44, 0x72, 0x69, 0x76, 0x65, 0x73, 0x50, 0x65, 0x72, 0x53, 0x65, 0x74) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.DrivesPerSet))) + if err != nil { + err = msgp.WrapError(err, "DrivesPerSet") + return + } + for za0010 := range z.DrivesPerSet { + err = en.WriteInt(z.DrivesPerSet[za0010]) + if err != nil { + err = msgp.WrapError(err, "DrivesPerSet", za0010) + return + } + } + // write "StandardSCParity" + err = en.Append(0xb0, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x53, 0x43, 0x50, 0x61, 0x72, 0x69, 0x74, 0x79) + if err != nil { + return + } + err = en.WriteInt(z.StandardSCParity) + if err != nil { + err = msgp.WrapError(err, "StandardSCParity") + return + } + // write "RRSCParity" + err = en.Append(0xaa, 0x52, 0x52, 0x53, 0x43, 0x50, 0x61, 0x72, 0x69, 0x74, 0x79) + if err != nil { + return + } + err = en.WriteInt(z.RRSCParity) + if err != nil { + err = msgp.WrapError(err, "RRSCParity") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *BackendInfo) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 12 + // string "Type" + o = append(o, 0x8c, 0xa4, 0x54, 0x79, 0x70, 0x65) + o = msgp.AppendInt(o, int(z.Type)) + // string "GatewayOnline" + o = append(o, 0xad, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65) + o = msgp.AppendBool(o, z.GatewayOnline) + // string "OnlineDisks" + o = append(o, 0xab, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x69, 0x73, 0x6b, 0x73) + o = msgp.AppendMapHeader(o, uint32(len(z.OnlineDisks))) + for za0001, za0002 := range z.OnlineDisks { + o = msgp.AppendString(o, za0001) + o = msgp.AppendInt(o, za0002) + } + // string "OfflineDisks" + o = append(o, 0xac, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x69, 0x73, 0x6b, 0x73) + o = msgp.AppendMapHeader(o, uint32(len(z.OfflineDisks))) + for za0003, za0004 := range z.OfflineDisks { + o = msgp.AppendString(o, za0003) + o = msgp.AppendInt(o, za0004) + } + // string "StandardSCData" + o = append(o, 0xae, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x53, 0x43, 0x44, 0x61, 0x74, 0x61) + o = msgp.AppendArrayHeader(o, uint32(len(z.StandardSCData))) + for za0005 := range z.StandardSCData { + o = msgp.AppendInt(o, z.StandardSCData[za0005]) + } + // string "StandardSCParities" + o = append(o, 0xb2, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x53, 0x43, 0x50, 0x61, 0x72, 0x69, 0x74, 0x69, 0x65, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.StandardSCParities))) + for za0006 := range z.StandardSCParities { + o = msgp.AppendInt(o, z.StandardSCParities[za0006]) + } + // string "RRSCData" + o = append(o, 0xa8, 0x52, 0x52, 0x53, 0x43, 0x44, 0x61, 0x74, 0x61) + o = msgp.AppendArrayHeader(o, uint32(len(z.RRSCData))) + for za0007 := range z.RRSCData { + o = msgp.AppendInt(o, z.RRSCData[za0007]) + } + // string "RRSCParities" + o = append(o, 0xac, 0x52, 0x52, 0x53, 0x43, 0x50, 0x61, 0x72, 0x69, 0x74, 0x69, 0x65, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.RRSCParities))) + for za0008 := range z.RRSCParities { + o = msgp.AppendInt(o, z.RRSCParities[za0008]) + } + // string "TotalSets" + o = append(o, 0xa9, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x65, 0x74, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.TotalSets))) + for za0009 := range z.TotalSets { + o = msgp.AppendInt(o, z.TotalSets[za0009]) + } + // string "DrivesPerSet" + o = append(o, 0xac, 0x44, 0x72, 0x69, 0x76, 0x65, 0x73, 0x50, 0x65, 0x72, 0x53, 0x65, 0x74) + o = msgp.AppendArrayHeader(o, uint32(len(z.DrivesPerSet))) + for za0010 := range z.DrivesPerSet { + o = msgp.AppendInt(o, z.DrivesPerSet[za0010]) + } + // string "StandardSCParity" + o = append(o, 0xb0, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x53, 0x43, 0x50, 0x61, 0x72, 0x69, 0x74, 0x79) + o = msgp.AppendInt(o, z.StandardSCParity) + // string "RRSCParity" + o = append(o, 0xaa, 0x52, 0x52, 0x53, 0x43, 0x50, 0x61, 0x72, 0x69, 0x74, 0x79) + o = msgp.AppendInt(o, z.RRSCParity) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *BackendInfo) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "Type": + { + var zb0002 int + zb0002, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Type") + return + } + z.Type = BackendType(zb0002) + } + case "GatewayOnline": + z.GatewayOnline, bts, err = msgp.ReadBoolBytes(bts) + if err != nil { + err = msgp.WrapError(err, "GatewayOnline") + return + } + case "OnlineDisks": + var zb0003 uint32 + zb0003, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "OnlineDisks") + return + } + if z.OnlineDisks == nil { + z.OnlineDisks = make(BackendDisks, zb0003) + } else if len(z.OnlineDisks) > 0 { + for key := range z.OnlineDisks { + delete(z.OnlineDisks, key) + } + } + for zb0003 > 0 { + var za0001 string + var za0002 int + zb0003-- + za0001, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "OnlineDisks") + return + } + za0002, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "OnlineDisks", za0001) + return + } + z.OnlineDisks[za0001] = za0002 + } + case "OfflineDisks": + var zb0004 uint32 + zb0004, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "OfflineDisks") + return + } + if z.OfflineDisks == nil { + z.OfflineDisks = make(BackendDisks, zb0004) + } else if len(z.OfflineDisks) > 0 { + for key := range z.OfflineDisks { + delete(z.OfflineDisks, key) + } + } + for zb0004 > 0 { + var za0003 string + var za0004 int + zb0004-- + za0003, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "OfflineDisks") + return + } + za0004, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "OfflineDisks", za0003) + return + } + z.OfflineDisks[za0003] = za0004 + } + case "StandardSCData": + var zb0005 uint32 + zb0005, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "StandardSCData") + return + } + if cap(z.StandardSCData) >= int(zb0005) { + z.StandardSCData = (z.StandardSCData)[:zb0005] + } else { + z.StandardSCData = make([]int, zb0005) + } + for za0005 := range z.StandardSCData { + z.StandardSCData[za0005], bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "StandardSCData", za0005) + return + } + } + case "StandardSCParities": + var zb0006 uint32 + zb0006, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "StandardSCParities") + return + } + if cap(z.StandardSCParities) >= int(zb0006) { + z.StandardSCParities = (z.StandardSCParities)[:zb0006] + } else { + z.StandardSCParities = make([]int, zb0006) + } + for za0006 := range z.StandardSCParities { + z.StandardSCParities[za0006], bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "StandardSCParities", za0006) + return + } + } + case "RRSCData": + var zb0007 uint32 + zb0007, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "RRSCData") + return + } + if cap(z.RRSCData) >= int(zb0007) { + z.RRSCData = (z.RRSCData)[:zb0007] + } else { + z.RRSCData = make([]int, zb0007) + } + for za0007 := range z.RRSCData { + z.RRSCData[za0007], bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "RRSCData", za0007) + return + } + } + case "RRSCParities": + var zb0008 uint32 + zb0008, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "RRSCParities") + return + } + if cap(z.RRSCParities) >= int(zb0008) { + z.RRSCParities = (z.RRSCParities)[:zb0008] + } else { + z.RRSCParities = make([]int, zb0008) + } + for za0008 := range z.RRSCParities { + z.RRSCParities[za0008], bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "RRSCParities", za0008) + return + } + } + case "TotalSets": + var zb0009 uint32 + zb0009, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "TotalSets") + return + } + if cap(z.TotalSets) >= int(zb0009) { + z.TotalSets = (z.TotalSets)[:zb0009] + } else { + z.TotalSets = make([]int, zb0009) + } + for za0009 := range z.TotalSets { + z.TotalSets[za0009], bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "TotalSets", za0009) + return + } + } + case "DrivesPerSet": + var zb0010 uint32 + zb0010, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "DrivesPerSet") + return + } + if cap(z.DrivesPerSet) >= int(zb0010) { + z.DrivesPerSet = (z.DrivesPerSet)[:zb0010] + } else { + z.DrivesPerSet = make([]int, zb0010) + } + for za0010 := range z.DrivesPerSet { + z.DrivesPerSet[za0010], bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "DrivesPerSet", za0010) + return + } + } + case "StandardSCParity": + z.StandardSCParity, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "StandardSCParity") + return + } + case "RRSCParity": + z.RRSCParity, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "RRSCParity") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *BackendInfo) Msgsize() (s int) { + s = 1 + 5 + msgp.IntSize + 14 + msgp.BoolSize + 12 + msgp.MapHeaderSize + if z.OnlineDisks != nil { + for za0001, za0002 := range z.OnlineDisks { + _ = za0002 + s += msgp.StringPrefixSize + len(za0001) + msgp.IntSize + } + } + s += 13 + msgp.MapHeaderSize + if z.OfflineDisks != nil { + for za0003, za0004 := range z.OfflineDisks { + _ = za0004 + s += msgp.StringPrefixSize + len(za0003) + msgp.IntSize + } + } + s += 15 + msgp.ArrayHeaderSize + (len(z.StandardSCData) * (msgp.IntSize)) + 19 + msgp.ArrayHeaderSize + (len(z.StandardSCParities) * (msgp.IntSize)) + 9 + msgp.ArrayHeaderSize + (len(z.RRSCData) * (msgp.IntSize)) + 13 + msgp.ArrayHeaderSize + (len(z.RRSCParities) * (msgp.IntSize)) + 10 + msgp.ArrayHeaderSize + (len(z.TotalSets) * (msgp.IntSize)) + 13 + msgp.ArrayHeaderSize + (len(z.DrivesPerSet) * (msgp.IntSize)) + 17 + msgp.IntSize + 11 + msgp.IntSize + return +} + +// DecodeMsg implements msgp.Decodable +func (z *BackendType) DecodeMsg(dc *msgp.Reader) (err error) { + { + var zb0001 int + zb0001, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err) + return + } + (*z) = BackendType(zb0001) + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z BackendType) EncodeMsg(en *msgp.Writer) (err error) { + err = en.WriteInt(int(z)) + if err != nil { + err = msgp.WrapError(err) + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z BackendType) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + o = msgp.AppendInt(o, int(z)) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *BackendType) UnmarshalMsg(bts []byte) (o []byte, err error) { + { + var zb0001 int + zb0001, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + (*z) = BackendType(zb0001) + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z BackendType) Msgsize() (s int) { + s = msgp.IntSize + return +} + +// DecodeMsg implements msgp.Decodable +func (z *BucketUsageInfo) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "size": + z.Size, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "Size") + return + } + case "objectsPendingReplicationTotalSize": + z.ReplicationPendingSize, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ReplicationPendingSize") + return + } + case "objectsFailedReplicationTotalSize": + z.ReplicationFailedSize, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ReplicationFailedSize") + return + } + case "objectsReplicatedTotalSize": + z.ReplicatedSize, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ReplicatedSize") + return + } + case "objectReplicaTotalSize": + z.ReplicaSize, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ReplicaSize") + return + } + case "objectsPendingReplicationCount": + z.ReplicationPendingCount, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ReplicationPendingCount") + return + } + case "objectsFailedReplicationCount": + z.ReplicationFailedCount, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ReplicationFailedCount") + return + } + case "versionsCount": + z.VersionsCount, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "VersionsCount") + return + } + case "objectsCount": + z.ObjectsCount, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ObjectsCount") + return + } + case "deleteMarkersCount": + z.DeleteMarkersCount, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "DeleteMarkersCount") + return + } + case "objectsSizesHistogram": + var zb0002 uint32 + zb0002, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "ObjectSizesHistogram") + return + } + if z.ObjectSizesHistogram == nil { + z.ObjectSizesHistogram = make(map[string]uint64, zb0002) + } else if len(z.ObjectSizesHistogram) > 0 { + for key := range z.ObjectSizesHistogram { + delete(z.ObjectSizesHistogram, key) + } + } + for zb0002 > 0 { + zb0002-- + var za0001 string + var za0002 uint64 + za0001, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "ObjectSizesHistogram") + return + } + za0002, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ObjectSizesHistogram", za0001) + return + } + z.ObjectSizesHistogram[za0001] = za0002 + } + case "objectsVersionsHistogram": + var zb0003 uint32 + zb0003, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "ObjectVersionsHistogram") + return + } + if z.ObjectVersionsHistogram == nil { + z.ObjectVersionsHistogram = make(map[string]uint64, zb0003) + } else if len(z.ObjectVersionsHistogram) > 0 { + for key := range z.ObjectVersionsHistogram { + delete(z.ObjectVersionsHistogram, key) + } + } + for zb0003 > 0 { + zb0003-- + var za0003 string + var za0004 uint64 + za0003, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "ObjectVersionsHistogram") + return + } + za0004, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ObjectVersionsHistogram", za0003) + return + } + z.ObjectVersionsHistogram[za0003] = za0004 + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *BucketUsageInfo) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 12 + // write "size" + err = en.Append(0x8c, 0xa4, 0x73, 0x69, 0x7a, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.Size) + if err != nil { + err = msgp.WrapError(err, "Size") + return + } + // write "objectsPendingReplicationTotalSize" + err = en.Append(0xd9, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.ReplicationPendingSize) + if err != nil { + err = msgp.WrapError(err, "ReplicationPendingSize") + return + } + // write "objectsFailedReplicationTotalSize" + err = en.Append(0xd9, 0x21, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.ReplicationFailedSize) + if err != nil { + err = msgp.WrapError(err, "ReplicationFailedSize") + return + } + // write "objectsReplicatedTotalSize" + err = en.Append(0xba, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.ReplicatedSize) + if err != nil { + err = msgp.WrapError(err, "ReplicatedSize") + return + } + // write "objectReplicaTotalSize" + err = en.Append(0xb6, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.ReplicaSize) + if err != nil { + err = msgp.WrapError(err, "ReplicaSize") + return + } + // write "objectsPendingReplicationCount" + err = en.Append(0xbe, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteUint64(z.ReplicationPendingCount) + if err != nil { + err = msgp.WrapError(err, "ReplicationPendingCount") + return + } + // write "objectsFailedReplicationCount" + err = en.Append(0xbd, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteUint64(z.ReplicationFailedCount) + if err != nil { + err = msgp.WrapError(err, "ReplicationFailedCount") + return + } + // write "versionsCount" + err = en.Append(0xad, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteUint64(z.VersionsCount) + if err != nil { + err = msgp.WrapError(err, "VersionsCount") + return + } + // write "objectsCount" + err = en.Append(0xac, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteUint64(z.ObjectsCount) + if err != nil { + err = msgp.WrapError(err, "ObjectsCount") + return + } + // write "deleteMarkersCount" + err = en.Append(0xb2, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x72, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteUint64(z.DeleteMarkersCount) + if err != nil { + err = msgp.WrapError(err, "DeleteMarkersCount") + return + } + // write "objectsSizesHistogram" + err = en.Append(0xb5, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x53, 0x69, 0x7a, 0x65, 0x73, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.ObjectSizesHistogram))) + if err != nil { + err = msgp.WrapError(err, "ObjectSizesHistogram") + return + } + for za0001, za0002 := range z.ObjectSizesHistogram { + err = en.WriteString(za0001) + if err != nil { + err = msgp.WrapError(err, "ObjectSizesHistogram") + return + } + err = en.WriteUint64(za0002) + if err != nil { + err = msgp.WrapError(err, "ObjectSizesHistogram", za0001) + return + } + } + // write "objectsVersionsHistogram" + err = en.Append(0xb8, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.ObjectVersionsHistogram))) + if err != nil { + err = msgp.WrapError(err, "ObjectVersionsHistogram") + return + } + for za0003, za0004 := range z.ObjectVersionsHistogram { + err = en.WriteString(za0003) + if err != nil { + err = msgp.WrapError(err, "ObjectVersionsHistogram") + return + } + err = en.WriteUint64(za0004) + if err != nil { + err = msgp.WrapError(err, "ObjectVersionsHistogram", za0003) + return + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *BucketUsageInfo) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 12 + // string "size" + o = append(o, 0x8c, 0xa4, 0x73, 0x69, 0x7a, 0x65) + o = msgp.AppendUint64(o, z.Size) + // string "objectsPendingReplicationTotalSize" + o = append(o, 0xd9, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65) + o = msgp.AppendUint64(o, z.ReplicationPendingSize) + // string "objectsFailedReplicationTotalSize" + o = append(o, 0xd9, 0x21, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65) + o = msgp.AppendUint64(o, z.ReplicationFailedSize) + // string "objectsReplicatedTotalSize" + o = append(o, 0xba, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65) + o = msgp.AppendUint64(o, z.ReplicatedSize) + // string "objectReplicaTotalSize" + o = append(o, 0xb6, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65) + o = msgp.AppendUint64(o, z.ReplicaSize) + // string "objectsPendingReplicationCount" + o = append(o, 0xbe, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendUint64(o, z.ReplicationPendingCount) + // string "objectsFailedReplicationCount" + o = append(o, 0xbd, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendUint64(o, z.ReplicationFailedCount) + // string "versionsCount" + o = append(o, 0xad, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendUint64(o, z.VersionsCount) + // string "objectsCount" + o = append(o, 0xac, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendUint64(o, z.ObjectsCount) + // string "deleteMarkersCount" + o = append(o, 0xb2, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x72, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendUint64(o, z.DeleteMarkersCount) + // string "objectsSizesHistogram" + o = append(o, 0xb5, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x53, 0x69, 0x7a, 0x65, 0x73, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d) + o = msgp.AppendMapHeader(o, uint32(len(z.ObjectSizesHistogram))) + for za0001, za0002 := range z.ObjectSizesHistogram { + o = msgp.AppendString(o, za0001) + o = msgp.AppendUint64(o, za0002) + } + // string "objectsVersionsHistogram" + o = append(o, 0xb8, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d) + o = msgp.AppendMapHeader(o, uint32(len(z.ObjectVersionsHistogram))) + for za0003, za0004 := range z.ObjectVersionsHistogram { + o = msgp.AppendString(o, za0003) + o = msgp.AppendUint64(o, za0004) + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *BucketUsageInfo) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "size": + z.Size, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Size") + return + } + case "objectsPendingReplicationTotalSize": + z.ReplicationPendingSize, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ReplicationPendingSize") + return + } + case "objectsFailedReplicationTotalSize": + z.ReplicationFailedSize, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ReplicationFailedSize") + return + } + case "objectsReplicatedTotalSize": + z.ReplicatedSize, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ReplicatedSize") + return + } + case "objectReplicaTotalSize": + z.ReplicaSize, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ReplicaSize") + return + } + case "objectsPendingReplicationCount": + z.ReplicationPendingCount, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ReplicationPendingCount") + return + } + case "objectsFailedReplicationCount": + z.ReplicationFailedCount, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ReplicationFailedCount") + return + } + case "versionsCount": + z.VersionsCount, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "VersionsCount") + return + } + case "objectsCount": + z.ObjectsCount, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ObjectsCount") + return + } + case "deleteMarkersCount": + z.DeleteMarkersCount, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "DeleteMarkersCount") + return + } + case "objectsSizesHistogram": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ObjectSizesHistogram") + return + } + if z.ObjectSizesHistogram == nil { + z.ObjectSizesHistogram = make(map[string]uint64, zb0002) + } else if len(z.ObjectSizesHistogram) > 0 { + for key := range z.ObjectSizesHistogram { + delete(z.ObjectSizesHistogram, key) + } + } + for zb0002 > 0 { + var za0001 string + var za0002 uint64 + zb0002-- + za0001, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ObjectSizesHistogram") + return + } + za0002, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ObjectSizesHistogram", za0001) + return + } + z.ObjectSizesHistogram[za0001] = za0002 + } + case "objectsVersionsHistogram": + var zb0003 uint32 + zb0003, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ObjectVersionsHistogram") + return + } + if z.ObjectVersionsHistogram == nil { + z.ObjectVersionsHistogram = make(map[string]uint64, zb0003) + } else if len(z.ObjectVersionsHistogram) > 0 { + for key := range z.ObjectVersionsHistogram { + delete(z.ObjectVersionsHistogram, key) + } + } + for zb0003 > 0 { + var za0003 string + var za0004 uint64 + zb0003-- + za0003, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ObjectVersionsHistogram") + return + } + za0004, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ObjectVersionsHistogram", za0003) + return + } + z.ObjectVersionsHistogram[za0003] = za0004 + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *BucketUsageInfo) Msgsize() (s int) { + s = 1 + 5 + msgp.Uint64Size + 36 + msgp.Uint64Size + 35 + msgp.Uint64Size + 27 + msgp.Uint64Size + 23 + msgp.Uint64Size + 31 + msgp.Uint64Size + 30 + msgp.Uint64Size + 14 + msgp.Uint64Size + 13 + msgp.Uint64Size + 19 + msgp.Uint64Size + 22 + msgp.MapHeaderSize + if z.ObjectSizesHistogram != nil { + for za0001, za0002 := range z.ObjectSizesHistogram { + _ = za0002 + s += msgp.StringPrefixSize + len(za0001) + msgp.Uint64Size + } + } + s += 25 + msgp.MapHeaderSize + if z.ObjectVersionsHistogram != nil { + for za0003, za0004 := range z.ObjectVersionsHistogram { + _ = za0004 + s += msgp.StringPrefixSize + len(za0003) + msgp.Uint64Size + } + } + return +} + +// DecodeMsg implements msgp.Decodable +func (z *Buckets) 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 /* 1 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "count": + z.Count, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "Count") + return + } + case "error": + z.Error, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Error") + return + } + zb0001Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1 { + if (zb0001Mask & 0x1) == 0 { + z.Error = "" + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z Buckets) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(2) + var zb0001Mask uint8 /* 2 bits */ + _ = zb0001Mask + if z.Error == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + // write "count" + err = en.Append(0xa5, 0x63, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteUint64(z.Count) + if err != nil { + err = msgp.WrapError(err, "Count") + return + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "error" + err = en.Append(0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72) + if err != nil { + return + } + err = en.WriteString(z.Error) + if err != nil { + err = msgp.WrapError(err, "Error") + return + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z Buckets) 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.Error == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + // string "count" + o = append(o, 0xa5, 0x63, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendUint64(o, z.Count) + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "error" + o = append(o, 0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72) + o = msgp.AppendString(o, z.Error) + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *Buckets) 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 /* 1 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 "count": + z.Count, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Count") + return + } + case "error": + z.Error, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Error") + return + } + zb0001Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1 { + if (zb0001Mask & 0x1) == 0 { + z.Error = "" + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z Buckets) Msgsize() (s int) { + s = 1 + 6 + msgp.Uint64Size + 6 + msgp.StringPrefixSize + len(z.Error) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *CacheStats) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "capacity": + z.Capacity, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "Capacity") + return + } + case "used": + z.Used, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "Used") + return + } + case "hits": + z.Hits, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "Hits") + return + } + case "misses": + z.Misses, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "Misses") + return + } + case "delHits": + z.DelHits, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "DelHits") + return + } + case "delMisses": + z.DelMisses, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "DelMisses") + return + } + case "collisions": + z.Collisions, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "Collisions") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *CacheStats) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 7 + // write "capacity" + err = en.Append(0x87, 0xa8, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79) + if err != nil { + return + } + err = en.WriteInt64(z.Capacity) + if err != nil { + err = msgp.WrapError(err, "Capacity") + return + } + // write "used" + err = en.Append(0xa4, 0x75, 0x73, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteInt64(z.Used) + if err != nil { + err = msgp.WrapError(err, "Used") + return + } + // write "hits" + err = en.Append(0xa4, 0x68, 0x69, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteInt64(z.Hits) + if err != nil { + err = msgp.WrapError(err, "Hits") + return + } + // write "misses" + err = en.Append(0xa6, 0x6d, 0x69, 0x73, 0x73, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteInt64(z.Misses) + if err != nil { + err = msgp.WrapError(err, "Misses") + return + } + // write "delHits" + err = en.Append(0xa7, 0x64, 0x65, 0x6c, 0x48, 0x69, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteInt64(z.DelHits) + if err != nil { + err = msgp.WrapError(err, "DelHits") + return + } + // write "delMisses" + err = en.Append(0xa9, 0x64, 0x65, 0x6c, 0x4d, 0x69, 0x73, 0x73, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteInt64(z.DelMisses) + if err != nil { + err = msgp.WrapError(err, "DelMisses") + return + } + // write "collisions" + err = en.Append(0xaa, 0x63, 0x6f, 0x6c, 0x6c, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73) + if err != nil { + return + } + err = en.WriteInt64(z.Collisions) + if err != nil { + err = msgp.WrapError(err, "Collisions") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *CacheStats) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 7 + // string "capacity" + o = append(o, 0x87, 0xa8, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79) + o = msgp.AppendInt64(o, z.Capacity) + // string "used" + o = append(o, 0xa4, 0x75, 0x73, 0x65, 0x64) + o = msgp.AppendInt64(o, z.Used) + // string "hits" + o = append(o, 0xa4, 0x68, 0x69, 0x74, 0x73) + o = msgp.AppendInt64(o, z.Hits) + // string "misses" + o = append(o, 0xa6, 0x6d, 0x69, 0x73, 0x73, 0x65, 0x73) + o = msgp.AppendInt64(o, z.Misses) + // string "delHits" + o = append(o, 0xa7, 0x64, 0x65, 0x6c, 0x48, 0x69, 0x74, 0x73) + o = msgp.AppendInt64(o, z.DelHits) + // string "delMisses" + o = append(o, 0xa9, 0x64, 0x65, 0x6c, 0x4d, 0x69, 0x73, 0x73, 0x65, 0x73) + o = msgp.AppendInt64(o, z.DelMisses) + // string "collisions" + o = append(o, 0xaa, 0x63, 0x6f, 0x6c, 0x6c, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73) + o = msgp.AppendInt64(o, z.Collisions) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *CacheStats) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "capacity": + z.Capacity, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Capacity") + return + } + case "used": + z.Used, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Used") + return + } + case "hits": + z.Hits, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Hits") + return + } + case "misses": + z.Misses, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Misses") + return + } + case "delHits": + z.DelHits, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "DelHits") + return + } + case "delMisses": + z.DelMisses, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "DelMisses") + return + } + case "collisions": + z.Collisions, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Collisions") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *CacheStats) Msgsize() (s int) { + s = 1 + 9 + msgp.Int64Size + 5 + msgp.Int64Size + 5 + msgp.Int64Size + 7 + msgp.Int64Size + 8 + msgp.Int64Size + 10 + msgp.Int64Size + 11 + msgp.Int64Size + return +} + +// DecodeMsg implements msgp.Decodable +func (z *DataUsageInfo) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "lastUpdate": + z.LastUpdate, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "LastUpdate") + return + } + case "objectsCount": + z.ObjectsTotalCount, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ObjectsTotalCount") + return + } + case "objectsTotalSize": + z.ObjectsTotalSize, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ObjectsTotalSize") + return + } + case "objectsPendingReplicationTotalSize": + z.ReplicationPendingSize, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ReplicationPendingSize") + return + } + case "objectsFailedReplicationTotalSize": + z.ReplicationFailedSize, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ReplicationFailedSize") + return + } + case "objectsReplicatedTotalSize": + z.ReplicatedSize, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ReplicatedSize") + return + } + case "objectsReplicaTotalSize": + z.ReplicaSize, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ReplicaSize") + return + } + case "objectsPendingReplicationCount": + z.ReplicationPendingCount, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ReplicationPendingCount") + return + } + case "objectsFailedReplicationCount": + z.ReplicationFailedCount, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ReplicationFailedCount") + return + } + case "bucketsCount": + z.BucketsCount, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "BucketsCount") + return + } + case "bucketsUsageInfo": + var zb0002 uint32 + zb0002, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "BucketsUsage") + return + } + if z.BucketsUsage == nil { + z.BucketsUsage = make(map[string]BucketUsageInfo, zb0002) + } else if len(z.BucketsUsage) > 0 { + for key := range z.BucketsUsage { + delete(z.BucketsUsage, key) + } + } + for zb0002 > 0 { + zb0002-- + var za0001 string + var za0002 BucketUsageInfo + za0001, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "BucketsUsage") + return + } + err = za0002.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "BucketsUsage", za0001) + return + } + z.BucketsUsage[za0001] = za0002 + } + case "tierStats": + var zb0003 uint32 + zb0003, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "TierStats") + return + } + if z.TierStats == nil { + z.TierStats = make(map[string]TierStats, zb0003) + } else if len(z.TierStats) > 0 { + for key := range z.TierStats { + delete(z.TierStats, key) + } + } + for zb0003 > 0 { + zb0003-- + var za0003 string + var za0004 TierStats + za0003, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "TierStats") + return + } + var zb0004 uint32 + zb0004, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "TierStats", za0003) + return + } + for zb0004 > 0 { + zb0004-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, "TierStats", za0003) + return + } + switch msgp.UnsafeString(field) { + case "totalSize": + za0004.TotalSize, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "TierStats", za0003, "TotalSize") + return + } + case "numVersions": + za0004.NumVersions, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "TierStats", za0003, "NumVersions") + return + } + case "numObjects": + za0004.NumObjects, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "TierStats", za0003, "NumObjects") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, "TierStats", za0003) + return + } + } + } + z.TierStats[za0003] = za0004 + } + case "bucketsSizes": + var zb0005 uint32 + zb0005, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "BucketSizes") + return + } + if z.BucketSizes == nil { + z.BucketSizes = make(map[string]uint64, zb0005) + } else if len(z.BucketSizes) > 0 { + for key := range z.BucketSizes { + delete(z.BucketSizes, key) + } + } + for zb0005 > 0 { + zb0005-- + var za0005 string + var za0006 uint64 + za0005, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "BucketSizes") + return + } + za0006, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "BucketSizes", za0005) + return + } + z.BucketSizes[za0005] = za0006 + } + case "capacity": + z.TotalCapacity, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "TotalCapacity") + return + } + case "freeCapacity": + z.TotalFreeCapacity, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "TotalFreeCapacity") + return + } + case "usedCapacity": + z.TotalUsedCapacity, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "TotalUsedCapacity") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *DataUsageInfo) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 16 + // write "lastUpdate" + err = en.Append(0xde, 0x0, 0x10, 0xaa, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65) + if err != nil { + return + } + err = en.WriteTime(z.LastUpdate) + if err != nil { + err = msgp.WrapError(err, "LastUpdate") + return + } + // write "objectsCount" + err = en.Append(0xac, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteUint64(z.ObjectsTotalCount) + if err != nil { + err = msgp.WrapError(err, "ObjectsTotalCount") + return + } + // write "objectsTotalSize" + err = en.Append(0xb0, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.ObjectsTotalSize) + if err != nil { + err = msgp.WrapError(err, "ObjectsTotalSize") + return + } + // write "objectsPendingReplicationTotalSize" + err = en.Append(0xd9, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.ReplicationPendingSize) + if err != nil { + err = msgp.WrapError(err, "ReplicationPendingSize") + return + } + // write "objectsFailedReplicationTotalSize" + err = en.Append(0xd9, 0x21, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.ReplicationFailedSize) + if err != nil { + err = msgp.WrapError(err, "ReplicationFailedSize") + return + } + // write "objectsReplicatedTotalSize" + err = en.Append(0xba, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.ReplicatedSize) + if err != nil { + err = msgp.WrapError(err, "ReplicatedSize") + return + } + // write "objectsReplicaTotalSize" + err = en.Append(0xb7, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.ReplicaSize) + if err != nil { + err = msgp.WrapError(err, "ReplicaSize") + return + } + // write "objectsPendingReplicationCount" + err = en.Append(0xbe, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteUint64(z.ReplicationPendingCount) + if err != nil { + err = msgp.WrapError(err, "ReplicationPendingCount") + return + } + // write "objectsFailedReplicationCount" + err = en.Append(0xbd, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteUint64(z.ReplicationFailedCount) + if err != nil { + err = msgp.WrapError(err, "ReplicationFailedCount") + return + } + // write "bucketsCount" + err = en.Append(0xac, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteUint64(z.BucketsCount) + if err != nil { + err = msgp.WrapError(err, "BucketsCount") + return + } + // write "bucketsUsageInfo" + err = en.Append(0xb0, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x55, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.BucketsUsage))) + if err != nil { + err = msgp.WrapError(err, "BucketsUsage") + return + } + for za0001, za0002 := range z.BucketsUsage { + err = en.WriteString(za0001) + if err != nil { + err = msgp.WrapError(err, "BucketsUsage") + return + } + err = za0002.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "BucketsUsage", za0001) + return + } + } + // write "tierStats" + err = en.Append(0xa9, 0x74, 0x69, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.TierStats))) + if err != nil { + err = msgp.WrapError(err, "TierStats") + return + } + for za0003, za0004 := range z.TierStats { + err = en.WriteString(za0003) + if err != nil { + err = msgp.WrapError(err, "TierStats") + return + } + // map header, size 3 + // write "totalSize" + err = en.Append(0x83, 0xa9, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65) + if err != nil { + return + } + err = en.WriteUint64(za0004.TotalSize) + if err != nil { + err = msgp.WrapError(err, "TierStats", za0003, "TotalSize") + return + } + // write "numVersions" + err = en.Append(0xab, 0x6e, 0x75, 0x6d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73) + if err != nil { + return + } + err = en.WriteInt(za0004.NumVersions) + if err != nil { + err = msgp.WrapError(err, "TierStats", za0003, "NumVersions") + return + } + // write "numObjects" + err = en.Append(0xaa, 0x6e, 0x75, 0x6d, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteInt(za0004.NumObjects) + if err != nil { + err = msgp.WrapError(err, "TierStats", za0003, "NumObjects") + return + } + } + // write "bucketsSizes" + err = en.Append(0xac, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x53, 0x69, 0x7a, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.BucketSizes))) + if err != nil { + err = msgp.WrapError(err, "BucketSizes") + return + } + for za0005, za0006 := range z.BucketSizes { + err = en.WriteString(za0005) + if err != nil { + err = msgp.WrapError(err, "BucketSizes") + return + } + err = en.WriteUint64(za0006) + if err != nil { + err = msgp.WrapError(err, "BucketSizes", za0005) + return + } + } + // write "capacity" + err = en.Append(0xa8, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79) + if err != nil { + return + } + err = en.WriteUint64(z.TotalCapacity) + if err != nil { + err = msgp.WrapError(err, "TotalCapacity") + return + } + // write "freeCapacity" + err = en.Append(0xac, 0x66, 0x72, 0x65, 0x65, 0x43, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79) + if err != nil { + return + } + err = en.WriteUint64(z.TotalFreeCapacity) + if err != nil { + err = msgp.WrapError(err, "TotalFreeCapacity") + return + } + // write "usedCapacity" + err = en.Append(0xac, 0x75, 0x73, 0x65, 0x64, 0x43, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79) + if err != nil { + return + } + err = en.WriteUint64(z.TotalUsedCapacity) + if err != nil { + err = msgp.WrapError(err, "TotalUsedCapacity") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *DataUsageInfo) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 16 + // string "lastUpdate" + o = append(o, 0xde, 0x0, 0x10, 0xaa, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65) + o = msgp.AppendTime(o, z.LastUpdate) + // string "objectsCount" + o = append(o, 0xac, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendUint64(o, z.ObjectsTotalCount) + // string "objectsTotalSize" + o = append(o, 0xb0, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65) + o = msgp.AppendUint64(o, z.ObjectsTotalSize) + // string "objectsPendingReplicationTotalSize" + o = append(o, 0xd9, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65) + o = msgp.AppendUint64(o, z.ReplicationPendingSize) + // string "objectsFailedReplicationTotalSize" + o = append(o, 0xd9, 0x21, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65) + o = msgp.AppendUint64(o, z.ReplicationFailedSize) + // string "objectsReplicatedTotalSize" + o = append(o, 0xba, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65) + o = msgp.AppendUint64(o, z.ReplicatedSize) + // string "objectsReplicaTotalSize" + o = append(o, 0xb7, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65) + o = msgp.AppendUint64(o, z.ReplicaSize) + // string "objectsPendingReplicationCount" + o = append(o, 0xbe, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendUint64(o, z.ReplicationPendingCount) + // string "objectsFailedReplicationCount" + o = append(o, 0xbd, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendUint64(o, z.ReplicationFailedCount) + // string "bucketsCount" + o = append(o, 0xac, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendUint64(o, z.BucketsCount) + // string "bucketsUsageInfo" + o = append(o, 0xb0, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x55, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f) + o = msgp.AppendMapHeader(o, uint32(len(z.BucketsUsage))) + for za0001, za0002 := range z.BucketsUsage { + o = msgp.AppendString(o, za0001) + o, err = za0002.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "BucketsUsage", za0001) + return + } + } + // string "tierStats" + o = append(o, 0xa9, 0x74, 0x69, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73) + o = msgp.AppendMapHeader(o, uint32(len(z.TierStats))) + for za0003, za0004 := range z.TierStats { + o = msgp.AppendString(o, za0003) + // map header, size 3 + // string "totalSize" + o = append(o, 0x83, 0xa9, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65) + o = msgp.AppendUint64(o, za0004.TotalSize) + // string "numVersions" + o = append(o, 0xab, 0x6e, 0x75, 0x6d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73) + o = msgp.AppendInt(o, za0004.NumVersions) + // string "numObjects" + o = append(o, 0xaa, 0x6e, 0x75, 0x6d, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73) + o = msgp.AppendInt(o, za0004.NumObjects) + } + // string "bucketsSizes" + o = append(o, 0xac, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x53, 0x69, 0x7a, 0x65, 0x73) + o = msgp.AppendMapHeader(o, uint32(len(z.BucketSizes))) + for za0005, za0006 := range z.BucketSizes { + o = msgp.AppendString(o, za0005) + o = msgp.AppendUint64(o, za0006) + } + // string "capacity" + o = append(o, 0xa8, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79) + o = msgp.AppendUint64(o, z.TotalCapacity) + // string "freeCapacity" + o = append(o, 0xac, 0x66, 0x72, 0x65, 0x65, 0x43, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79) + o = msgp.AppendUint64(o, z.TotalFreeCapacity) + // string "usedCapacity" + o = append(o, 0xac, 0x75, 0x73, 0x65, 0x64, 0x43, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79) + o = msgp.AppendUint64(o, z.TotalUsedCapacity) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *DataUsageInfo) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "lastUpdate": + z.LastUpdate, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LastUpdate") + return + } + case "objectsCount": + z.ObjectsTotalCount, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ObjectsTotalCount") + return + } + case "objectsTotalSize": + z.ObjectsTotalSize, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ObjectsTotalSize") + return + } + case "objectsPendingReplicationTotalSize": + z.ReplicationPendingSize, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ReplicationPendingSize") + return + } + case "objectsFailedReplicationTotalSize": + z.ReplicationFailedSize, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ReplicationFailedSize") + return + } + case "objectsReplicatedTotalSize": + z.ReplicatedSize, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ReplicatedSize") + return + } + case "objectsReplicaTotalSize": + z.ReplicaSize, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ReplicaSize") + return + } + case "objectsPendingReplicationCount": + z.ReplicationPendingCount, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ReplicationPendingCount") + return + } + case "objectsFailedReplicationCount": + z.ReplicationFailedCount, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ReplicationFailedCount") + return + } + case "bucketsCount": + z.BucketsCount, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "BucketsCount") + return + } + case "bucketsUsageInfo": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "BucketsUsage") + return + } + if z.BucketsUsage == nil { + z.BucketsUsage = make(map[string]BucketUsageInfo, zb0002) + } else if len(z.BucketsUsage) > 0 { + for key := range z.BucketsUsage { + delete(z.BucketsUsage, key) + } + } + for zb0002 > 0 { + var za0001 string + var za0002 BucketUsageInfo + zb0002-- + za0001, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "BucketsUsage") + return + } + bts, err = za0002.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "BucketsUsage", za0001) + return + } + z.BucketsUsage[za0001] = za0002 + } + case "tierStats": + var zb0003 uint32 + zb0003, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "TierStats") + return + } + if z.TierStats == nil { + z.TierStats = make(map[string]TierStats, zb0003) + } else if len(z.TierStats) > 0 { + for key := range z.TierStats { + delete(z.TierStats, key) + } + } + for zb0003 > 0 { + var za0003 string + var za0004 TierStats + zb0003-- + za0003, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "TierStats") + return + } + var zb0004 uint32 + zb0004, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "TierStats", za0003) + return + } + for zb0004 > 0 { + zb0004-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "TierStats", za0003) + return + } + switch msgp.UnsafeString(field) { + case "totalSize": + za0004.TotalSize, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "TierStats", za0003, "TotalSize") + return + } + case "numVersions": + za0004.NumVersions, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "TierStats", za0003, "NumVersions") + return + } + case "numObjects": + za0004.NumObjects, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "TierStats", za0003, "NumObjects") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "TierStats", za0003) + return + } + } + } + z.TierStats[za0003] = za0004 + } + case "bucketsSizes": + var zb0005 uint32 + zb0005, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "BucketSizes") + return + } + if z.BucketSizes == nil { + z.BucketSizes = make(map[string]uint64, zb0005) + } else if len(z.BucketSizes) > 0 { + for key := range z.BucketSizes { + delete(z.BucketSizes, key) + } + } + for zb0005 > 0 { + var za0005 string + var za0006 uint64 + zb0005-- + za0005, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "BucketSizes") + return + } + za0006, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "BucketSizes", za0005) + return + } + z.BucketSizes[za0005] = za0006 + } + case "capacity": + z.TotalCapacity, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "TotalCapacity") + return + } + case "freeCapacity": + z.TotalFreeCapacity, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "TotalFreeCapacity") + return + } + case "usedCapacity": + z.TotalUsedCapacity, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "TotalUsedCapacity") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *DataUsageInfo) Msgsize() (s int) { + s = 3 + 11 + msgp.TimeSize + 13 + msgp.Uint64Size + 17 + msgp.Uint64Size + 36 + msgp.Uint64Size + 35 + msgp.Uint64Size + 27 + msgp.Uint64Size + 24 + msgp.Uint64Size + 31 + msgp.Uint64Size + 30 + msgp.Uint64Size + 13 + msgp.Uint64Size + 17 + msgp.MapHeaderSize + if z.BucketsUsage != nil { + for za0001, za0002 := range z.BucketsUsage { + _ = za0002 + s += msgp.StringPrefixSize + len(za0001) + za0002.Msgsize() + } + } + s += 10 + msgp.MapHeaderSize + if z.TierStats != nil { + for za0003, za0004 := range z.TierStats { + _ = za0004 + s += msgp.StringPrefixSize + len(za0003) + 1 + 10 + msgp.Uint64Size + 12 + msgp.IntSize + 11 + msgp.IntSize + } + } + s += 13 + msgp.MapHeaderSize + if z.BucketSizes != nil { + for za0005, za0006 := range z.BucketSizes { + _ = za0006 + s += msgp.StringPrefixSize + len(za0005) + msgp.Uint64Size + } + } + s += 9 + msgp.Uint64Size + 13 + msgp.Uint64Size + 13 + msgp.Uint64Size + return +} + +// DecodeMsg implements msgp.Decodable +func (z *DeleteMarkers) 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 /* 1 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "count": + z.Count, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "Count") + return + } + case "error": + z.Error, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Error") + return + } + zb0001Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1 { + if (zb0001Mask & 0x1) == 0 { + z.Error = "" + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z DeleteMarkers) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(2) + var zb0001Mask uint8 /* 2 bits */ + _ = zb0001Mask + if z.Error == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + // write "count" + err = en.Append(0xa5, 0x63, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteUint64(z.Count) + if err != nil { + err = msgp.WrapError(err, "Count") + return + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "error" + err = en.Append(0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72) + if err != nil { + return + } + err = en.WriteString(z.Error) + if err != nil { + err = msgp.WrapError(err, "Error") + return + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z DeleteMarkers) 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.Error == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + // string "count" + o = append(o, 0xa5, 0x63, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendUint64(o, z.Count) + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "error" + o = append(o, 0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72) + o = msgp.AppendString(o, z.Error) + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *DeleteMarkers) 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 /* 1 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 "count": + z.Count, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Count") + return + } + case "error": + z.Error, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Error") + return + } + zb0001Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1 { + if (zb0001Mask & 0x1) == 0 { + z.Error = "" + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z DeleteMarkers) Msgsize() (s int) { + s = 1 + 6 + msgp.Uint64Size + 6 + msgp.StringPrefixSize + len(z.Error) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *Disk) 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 uint32 /* 21 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "endpoint": + z.Endpoint, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Endpoint") + return + } + zb0001Mask |= 0x1 + case "rootDisk": + z.RootDisk, err = dc.ReadBool() + if err != nil { + err = msgp.WrapError(err, "RootDisk") + return + } + zb0001Mask |= 0x2 + case "path": + z.DrivePath, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "DrivePath") + return + } + zb0001Mask |= 0x4 + case "healing": + z.Healing, err = dc.ReadBool() + if err != nil { + err = msgp.WrapError(err, "Healing") + return + } + zb0001Mask |= 0x8 + case "scanning": + z.Scanning, err = dc.ReadBool() + if err != nil { + err = msgp.WrapError(err, "Scanning") + return + } + zb0001Mask |= 0x10 + case "state": + z.State, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "State") + return + } + zb0001Mask |= 0x20 + case "uuid": + z.UUID, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "UUID") + return + } + zb0001Mask |= 0x40 + case "major": + z.Major, err = dc.ReadUint32() + if err != nil { + err = msgp.WrapError(err, "Major") + return + } + case "minor": + z.Minor, err = dc.ReadUint32() + if err != nil { + err = msgp.WrapError(err, "Minor") + return + } + case "model": + z.Model, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Model") + return + } + zb0001Mask |= 0x80 + case "totalspace": + z.TotalSpace, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "TotalSpace") + return + } + zb0001Mask |= 0x100 + case "usedspace": + z.UsedSpace, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "UsedSpace") + return + } + zb0001Mask |= 0x200 + case "availspace": + z.AvailableSpace, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "AvailableSpace") + return + } + zb0001Mask |= 0x400 + case "readthroughput": + z.ReadThroughput, err = dc.ReadFloat64() + if err != nil { + err = msgp.WrapError(err, "ReadThroughput") + return + } + zb0001Mask |= 0x800 + case "writethroughput": + z.WriteThroughPut, err = dc.ReadFloat64() + if err != nil { + err = msgp.WrapError(err, "WriteThroughPut") + return + } + zb0001Mask |= 0x1000 + case "readlatency": + z.ReadLatency, err = dc.ReadFloat64() + if err != nil { + err = msgp.WrapError(err, "ReadLatency") + return + } + zb0001Mask |= 0x2000 + case "writelatency": + z.WriteLatency, err = dc.ReadFloat64() + if err != nil { + err = msgp.WrapError(err, "WriteLatency") + return + } + zb0001Mask |= 0x4000 + case "utilization": + z.Utilization, err = dc.ReadFloat64() + if err != nil { + err = msgp.WrapError(err, "Utilization") + return + } + zb0001Mask |= 0x8000 + case "metrics": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "Metrics") + return + } + z.Metrics = nil + } else { + if z.Metrics == nil { + z.Metrics = new(DiskMetrics) + } + err = z.Metrics.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Metrics") + return + } + } + zb0001Mask |= 0x10000 + case "heal_info": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "HealInfo") + return + } + z.HealInfo = nil + } else { + if z.HealInfo == nil { + z.HealInfo = new(HealingDisk) + } + err = z.HealInfo.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "HealInfo") + return + } + } + zb0001Mask |= 0x20000 + case "used_inodes": + z.UsedInodes, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "UsedInodes") + return + } + case "free_inodes": + z.FreeInodes, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "FreeInodes") + return + } + zb0001Mask |= 0x40000 + case "local": + z.Local, err = dc.ReadBool() + if err != nil { + err = msgp.WrapError(err, "Local") + return + } + zb0001Mask |= 0x80000 + case "cacheStats": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "Cache") + return + } + z.Cache = nil + } else { + if z.Cache == nil { + z.Cache = new(CacheStats) + } + err = z.Cache.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Cache") + return + } + } + zb0001Mask |= 0x100000 + case "pool_index": + z.PoolIndex, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "PoolIndex") + return + } + case "set_index": + z.SetIndex, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "SetIndex") + return + } + case "disk_index": + z.DiskIndex, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "DiskIndex") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1fffff { + if (zb0001Mask & 0x1) == 0 { + z.Endpoint = "" + } + if (zb0001Mask & 0x2) == 0 { + z.RootDisk = false + } + if (zb0001Mask & 0x4) == 0 { + z.DrivePath = "" + } + if (zb0001Mask & 0x8) == 0 { + z.Healing = false + } + if (zb0001Mask & 0x10) == 0 { + z.Scanning = false + } + if (zb0001Mask & 0x20) == 0 { + z.State = "" + } + if (zb0001Mask & 0x40) == 0 { + z.UUID = "" + } + if (zb0001Mask & 0x80) == 0 { + z.Model = "" + } + if (zb0001Mask & 0x100) == 0 { + z.TotalSpace = 0 + } + if (zb0001Mask & 0x200) == 0 { + z.UsedSpace = 0 + } + if (zb0001Mask & 0x400) == 0 { + z.AvailableSpace = 0 + } + if (zb0001Mask & 0x800) == 0 { + z.ReadThroughput = 0 + } + if (zb0001Mask & 0x1000) == 0 { + z.WriteThroughPut = 0 + } + if (zb0001Mask & 0x2000) == 0 { + z.ReadLatency = 0 + } + if (zb0001Mask & 0x4000) == 0 { + z.WriteLatency = 0 + } + if (zb0001Mask & 0x8000) == 0 { + z.Utilization = 0 + } + if (zb0001Mask & 0x10000) == 0 { + z.Metrics = nil + } + if (zb0001Mask & 0x20000) == 0 { + z.HealInfo = nil + } + if (zb0001Mask & 0x40000) == 0 { + z.FreeInodes = 0 + } + if (zb0001Mask & 0x80000) == 0 { + z.Local = false + } + if (zb0001Mask & 0x100000) == 0 { + z.Cache = nil + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *Disk) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(27) + var zb0001Mask uint32 /* 27 bits */ + _ = zb0001Mask + if z.Endpoint == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.RootDisk == false { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.DrivePath == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.Healing == false { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.Scanning == false { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.State == "" { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.UUID == "" { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.Model == "" { + zb0001Len-- + zb0001Mask |= 0x200 + } + if z.TotalSpace == 0 { + zb0001Len-- + zb0001Mask |= 0x400 + } + if z.UsedSpace == 0 { + zb0001Len-- + zb0001Mask |= 0x800 + } + if z.AvailableSpace == 0 { + zb0001Len-- + zb0001Mask |= 0x1000 + } + if z.ReadThroughput == 0 { + zb0001Len-- + zb0001Mask |= 0x2000 + } + if z.WriteThroughPut == 0 { + zb0001Len-- + zb0001Mask |= 0x4000 + } + if z.ReadLatency == 0 { + zb0001Len-- + zb0001Mask |= 0x8000 + } + if z.WriteLatency == 0 { + zb0001Len-- + zb0001Mask |= 0x10000 + } + if z.Utilization == 0 { + zb0001Len-- + zb0001Mask |= 0x20000 + } + if z.Metrics == nil { + zb0001Len-- + zb0001Mask |= 0x40000 + } + if z.HealInfo == nil { + zb0001Len-- + zb0001Mask |= 0x80000 + } + if z.FreeInodes == 0 { + zb0001Len-- + zb0001Mask |= 0x200000 + } + if z.Local == false { + zb0001Len-- + zb0001Mask |= 0x400000 + } + if z.Cache == nil { + zb0001Len-- + zb0001Mask |= 0x800000 + } + // variable map header, size zb0001Len + err = en.WriteMapHeader(zb0001Len) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + if (zb0001Mask & 0x1) == 0 { // if not omitted + // write "endpoint" + err = en.Append(0xa8, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteString(z.Endpoint) + if err != nil { + err = msgp.WrapError(err, "Endpoint") + return + } + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "rootDisk" + err = en.Append(0xa8, 0x72, 0x6f, 0x6f, 0x74, 0x44, 0x69, 0x73, 0x6b) + if err != nil { + return + } + err = en.WriteBool(z.RootDisk) + if err != nil { + err = msgp.WrapError(err, "RootDisk") + return + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "path" + err = en.Append(0xa4, 0x70, 0x61, 0x74, 0x68) + if err != nil { + return + } + err = en.WriteString(z.DrivePath) + if err != nil { + err = msgp.WrapError(err, "DrivePath") + return + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // write "healing" + err = en.Append(0xa7, 0x68, 0x65, 0x61, 0x6c, 0x69, 0x6e, 0x67) + if err != nil { + return + } + err = en.WriteBool(z.Healing) + if err != nil { + err = msgp.WrapError(err, "Healing") + return + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // write "scanning" + err = en.Append(0xa8, 0x73, 0x63, 0x61, 0x6e, 0x6e, 0x69, 0x6e, 0x67) + if err != nil { + return + } + err = en.WriteBool(z.Scanning) + if err != nil { + err = msgp.WrapError(err, "Scanning") + return + } + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // write "state" + err = en.Append(0xa5, 0x73, 0x74, 0x61, 0x74, 0x65) + if err != nil { + return + } + err = en.WriteString(z.State) + if err != nil { + err = msgp.WrapError(err, "State") + return + } + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // write "uuid" + err = en.Append(0xa4, 0x75, 0x75, 0x69, 0x64) + if err != nil { + return + } + err = en.WriteString(z.UUID) + if err != nil { + err = msgp.WrapError(err, "UUID") + return + } + } + // write "major" + err = en.Append(0xa5, 0x6d, 0x61, 0x6a, 0x6f, 0x72) + if err != nil { + return + } + err = en.WriteUint32(z.Major) + if err != nil { + err = msgp.WrapError(err, "Major") + return + } + // write "minor" + err = en.Append(0xa5, 0x6d, 0x69, 0x6e, 0x6f, 0x72) + if err != nil { + return + } + err = en.WriteUint32(z.Minor) + if err != nil { + err = msgp.WrapError(err, "Minor") + return + } + if (zb0001Mask & 0x200) == 0 { // if not omitted + // write "model" + err = en.Append(0xa5, 0x6d, 0x6f, 0x64, 0x65, 0x6c) + if err != nil { + return + } + err = en.WriteString(z.Model) + if err != nil { + err = msgp.WrapError(err, "Model") + return + } + } + if (zb0001Mask & 0x400) == 0 { // if not omitted + // write "totalspace" + err = en.Append(0xaa, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x73, 0x70, 0x61, 0x63, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.TotalSpace) + if err != nil { + err = msgp.WrapError(err, "TotalSpace") + return + } + } + if (zb0001Mask & 0x800) == 0 { // if not omitted + // write "usedspace" + err = en.Append(0xa9, 0x75, 0x73, 0x65, 0x64, 0x73, 0x70, 0x61, 0x63, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.UsedSpace) + if err != nil { + err = msgp.WrapError(err, "UsedSpace") + return + } + } + if (zb0001Mask & 0x1000) == 0 { // if not omitted + // write "availspace" + err = en.Append(0xaa, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x73, 0x70, 0x61, 0x63, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.AvailableSpace) + if err != nil { + err = msgp.WrapError(err, "AvailableSpace") + return + } + } + if (zb0001Mask & 0x2000) == 0 { // if not omitted + // write "readthroughput" + err = en.Append(0xae, 0x72, 0x65, 0x61, 0x64, 0x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x70, 0x75, 0x74) + if err != nil { + return + } + err = en.WriteFloat64(z.ReadThroughput) + if err != nil { + err = msgp.WrapError(err, "ReadThroughput") + return + } + } + if (zb0001Mask & 0x4000) == 0 { // if not omitted + // write "writethroughput" + err = en.Append(0xaf, 0x77, 0x72, 0x69, 0x74, 0x65, 0x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x70, 0x75, 0x74) + if err != nil { + return + } + err = en.WriteFloat64(z.WriteThroughPut) + if err != nil { + err = msgp.WrapError(err, "WriteThroughPut") + return + } + } + if (zb0001Mask & 0x8000) == 0 { // if not omitted + // write "readlatency" + err = en.Append(0xab, 0x72, 0x65, 0x61, 0x64, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79) + if err != nil { + return + } + err = en.WriteFloat64(z.ReadLatency) + if err != nil { + err = msgp.WrapError(err, "ReadLatency") + return + } + } + if (zb0001Mask & 0x10000) == 0 { // if not omitted + // write "writelatency" + err = en.Append(0xac, 0x77, 0x72, 0x69, 0x74, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79) + if err != nil { + return + } + err = en.WriteFloat64(z.WriteLatency) + if err != nil { + err = msgp.WrapError(err, "WriteLatency") + return + } + } + if (zb0001Mask & 0x20000) == 0 { // if not omitted + // write "utilization" + err = en.Append(0xab, 0x75, 0x74, 0x69, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e) + if err != nil { + return + } + err = en.WriteFloat64(z.Utilization) + if err != nil { + err = msgp.WrapError(err, "Utilization") + return + } + } + if (zb0001Mask & 0x40000) == 0 { // if not omitted + // write "metrics" + err = en.Append(0xa7, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73) + if err != nil { + return + } + if z.Metrics == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.Metrics.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Metrics") + return + } + } + } + if (zb0001Mask & 0x80000) == 0 { // if not omitted + // write "heal_info" + err = en.Append(0xa9, 0x68, 0x65, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x66, 0x6f) + if err != nil { + return + } + if z.HealInfo == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.HealInfo.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "HealInfo") + return + } + } + } + // write "used_inodes" + err = en.Append(0xab, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x6f, 0x64, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.UsedInodes) + if err != nil { + err = msgp.WrapError(err, "UsedInodes") + return + } + if (zb0001Mask & 0x200000) == 0 { // if not omitted + // write "free_inodes" + err = en.Append(0xab, 0x66, 0x72, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x6f, 0x64, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.FreeInodes) + if err != nil { + err = msgp.WrapError(err, "FreeInodes") + return + } + } + if (zb0001Mask & 0x400000) == 0 { // if not omitted + // write "local" + err = en.Append(0xa5, 0x6c, 0x6f, 0x63, 0x61, 0x6c) + if err != nil { + return + } + err = en.WriteBool(z.Local) + if err != nil { + err = msgp.WrapError(err, "Local") + return + } + } + if (zb0001Mask & 0x800000) == 0 { // if not omitted + // write "cacheStats" + err = en.Append(0xaa, 0x63, 0x61, 0x63, 0x68, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73) + if err != nil { + return + } + if z.Cache == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.Cache.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Cache") + return + } + } + } + // write "pool_index" + err = en.Append(0xaa, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78) + if err != nil { + return + } + err = en.WriteInt(z.PoolIndex) + if err != nil { + err = msgp.WrapError(err, "PoolIndex") + return + } + // write "set_index" + err = en.Append(0xa9, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78) + if err != nil { + return + } + err = en.WriteInt(z.SetIndex) + if err != nil { + err = msgp.WrapError(err, "SetIndex") + return + } + // write "disk_index" + err = en.Append(0xaa, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78) + if err != nil { + return + } + err = en.WriteInt(z.DiskIndex) + if err != nil { + err = msgp.WrapError(err, "DiskIndex") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *Disk) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(27) + var zb0001Mask uint32 /* 27 bits */ + _ = zb0001Mask + if z.Endpoint == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.RootDisk == false { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.DrivePath == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.Healing == false { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.Scanning == false { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.State == "" { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.UUID == "" { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.Model == "" { + zb0001Len-- + zb0001Mask |= 0x200 + } + if z.TotalSpace == 0 { + zb0001Len-- + zb0001Mask |= 0x400 + } + if z.UsedSpace == 0 { + zb0001Len-- + zb0001Mask |= 0x800 + } + if z.AvailableSpace == 0 { + zb0001Len-- + zb0001Mask |= 0x1000 + } + if z.ReadThroughput == 0 { + zb0001Len-- + zb0001Mask |= 0x2000 + } + if z.WriteThroughPut == 0 { + zb0001Len-- + zb0001Mask |= 0x4000 + } + if z.ReadLatency == 0 { + zb0001Len-- + zb0001Mask |= 0x8000 + } + if z.WriteLatency == 0 { + zb0001Len-- + zb0001Mask |= 0x10000 + } + if z.Utilization == 0 { + zb0001Len-- + zb0001Mask |= 0x20000 + } + if z.Metrics == nil { + zb0001Len-- + zb0001Mask |= 0x40000 + } + if z.HealInfo == nil { + zb0001Len-- + zb0001Mask |= 0x80000 + } + if z.FreeInodes == 0 { + zb0001Len-- + zb0001Mask |= 0x200000 + } + if z.Local == false { + zb0001Len-- + zb0001Mask |= 0x400000 + } + if z.Cache == nil { + zb0001Len-- + zb0001Mask |= 0x800000 + } + // variable map header, size zb0001Len + o = msgp.AppendMapHeader(o, zb0001Len) + if zb0001Len == 0 { + return + } + if (zb0001Mask & 0x1) == 0 { // if not omitted + // string "endpoint" + o = append(o, 0xa8, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74) + o = msgp.AppendString(o, z.Endpoint) + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "rootDisk" + o = append(o, 0xa8, 0x72, 0x6f, 0x6f, 0x74, 0x44, 0x69, 0x73, 0x6b) + o = msgp.AppendBool(o, z.RootDisk) + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "path" + o = append(o, 0xa4, 0x70, 0x61, 0x74, 0x68) + o = msgp.AppendString(o, z.DrivePath) + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // string "healing" + o = append(o, 0xa7, 0x68, 0x65, 0x61, 0x6c, 0x69, 0x6e, 0x67) + o = msgp.AppendBool(o, z.Healing) + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // string "scanning" + o = append(o, 0xa8, 0x73, 0x63, 0x61, 0x6e, 0x6e, 0x69, 0x6e, 0x67) + o = msgp.AppendBool(o, z.Scanning) + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // string "state" + o = append(o, 0xa5, 0x73, 0x74, 0x61, 0x74, 0x65) + o = msgp.AppendString(o, z.State) + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // string "uuid" + o = append(o, 0xa4, 0x75, 0x75, 0x69, 0x64) + o = msgp.AppendString(o, z.UUID) + } + // string "major" + o = append(o, 0xa5, 0x6d, 0x61, 0x6a, 0x6f, 0x72) + o = msgp.AppendUint32(o, z.Major) + // string "minor" + o = append(o, 0xa5, 0x6d, 0x69, 0x6e, 0x6f, 0x72) + o = msgp.AppendUint32(o, z.Minor) + if (zb0001Mask & 0x200) == 0 { // if not omitted + // string "model" + o = append(o, 0xa5, 0x6d, 0x6f, 0x64, 0x65, 0x6c) + o = msgp.AppendString(o, z.Model) + } + if (zb0001Mask & 0x400) == 0 { // if not omitted + // string "totalspace" + o = append(o, 0xaa, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x73, 0x70, 0x61, 0x63, 0x65) + o = msgp.AppendUint64(o, z.TotalSpace) + } + if (zb0001Mask & 0x800) == 0 { // if not omitted + // string "usedspace" + o = append(o, 0xa9, 0x75, 0x73, 0x65, 0x64, 0x73, 0x70, 0x61, 0x63, 0x65) + o = msgp.AppendUint64(o, z.UsedSpace) + } + if (zb0001Mask & 0x1000) == 0 { // if not omitted + // string "availspace" + o = append(o, 0xaa, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x73, 0x70, 0x61, 0x63, 0x65) + o = msgp.AppendUint64(o, z.AvailableSpace) + } + if (zb0001Mask & 0x2000) == 0 { // if not omitted + // string "readthroughput" + o = append(o, 0xae, 0x72, 0x65, 0x61, 0x64, 0x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x70, 0x75, 0x74) + o = msgp.AppendFloat64(o, z.ReadThroughput) + } + if (zb0001Mask & 0x4000) == 0 { // if not omitted + // string "writethroughput" + o = append(o, 0xaf, 0x77, 0x72, 0x69, 0x74, 0x65, 0x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x70, 0x75, 0x74) + o = msgp.AppendFloat64(o, z.WriteThroughPut) + } + if (zb0001Mask & 0x8000) == 0 { // if not omitted + // string "readlatency" + o = append(o, 0xab, 0x72, 0x65, 0x61, 0x64, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79) + o = msgp.AppendFloat64(o, z.ReadLatency) + } + if (zb0001Mask & 0x10000) == 0 { // if not omitted + // string "writelatency" + o = append(o, 0xac, 0x77, 0x72, 0x69, 0x74, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79) + o = msgp.AppendFloat64(o, z.WriteLatency) + } + if (zb0001Mask & 0x20000) == 0 { // if not omitted + // string "utilization" + o = append(o, 0xab, 0x75, 0x74, 0x69, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e) + o = msgp.AppendFloat64(o, z.Utilization) + } + if (zb0001Mask & 0x40000) == 0 { // if not omitted + // string "metrics" + o = append(o, 0xa7, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73) + if z.Metrics == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.Metrics.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Metrics") + return + } + } + } + if (zb0001Mask & 0x80000) == 0 { // if not omitted + // string "heal_info" + o = append(o, 0xa9, 0x68, 0x65, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x66, 0x6f) + if z.HealInfo == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.HealInfo.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "HealInfo") + return + } + } + } + // string "used_inodes" + o = append(o, 0xab, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x6f, 0x64, 0x65, 0x73) + o = msgp.AppendUint64(o, z.UsedInodes) + if (zb0001Mask & 0x200000) == 0 { // if not omitted + // string "free_inodes" + o = append(o, 0xab, 0x66, 0x72, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x6f, 0x64, 0x65, 0x73) + o = msgp.AppendUint64(o, z.FreeInodes) + } + if (zb0001Mask & 0x400000) == 0 { // if not omitted + // string "local" + o = append(o, 0xa5, 0x6c, 0x6f, 0x63, 0x61, 0x6c) + o = msgp.AppendBool(o, z.Local) + } + if (zb0001Mask & 0x800000) == 0 { // if not omitted + // string "cacheStats" + o = append(o, 0xaa, 0x63, 0x61, 0x63, 0x68, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73) + if z.Cache == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.Cache.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Cache") + return + } + } + } + // string "pool_index" + o = append(o, 0xaa, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78) + o = msgp.AppendInt(o, z.PoolIndex) + // string "set_index" + o = append(o, 0xa9, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78) + o = msgp.AppendInt(o, z.SetIndex) + // string "disk_index" + o = append(o, 0xaa, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78) + o = msgp.AppendInt(o, z.DiskIndex) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *Disk) 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 uint32 /* 21 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 "endpoint": + z.Endpoint, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Endpoint") + return + } + zb0001Mask |= 0x1 + case "rootDisk": + z.RootDisk, bts, err = msgp.ReadBoolBytes(bts) + if err != nil { + err = msgp.WrapError(err, "RootDisk") + return + } + zb0001Mask |= 0x2 + case "path": + z.DrivePath, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "DrivePath") + return + } + zb0001Mask |= 0x4 + case "healing": + z.Healing, bts, err = msgp.ReadBoolBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Healing") + return + } + zb0001Mask |= 0x8 + case "scanning": + z.Scanning, bts, err = msgp.ReadBoolBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Scanning") + return + } + zb0001Mask |= 0x10 + case "state": + z.State, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "State") + return + } + zb0001Mask |= 0x20 + case "uuid": + z.UUID, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "UUID") + return + } + zb0001Mask |= 0x40 + case "major": + z.Major, bts, err = msgp.ReadUint32Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Major") + return + } + case "minor": + z.Minor, bts, err = msgp.ReadUint32Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Minor") + return + } + case "model": + z.Model, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Model") + return + } + zb0001Mask |= 0x80 + case "totalspace": + z.TotalSpace, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "TotalSpace") + return + } + zb0001Mask |= 0x100 + case "usedspace": + z.UsedSpace, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "UsedSpace") + return + } + zb0001Mask |= 0x200 + case "availspace": + z.AvailableSpace, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "AvailableSpace") + return + } + zb0001Mask |= 0x400 + case "readthroughput": + z.ReadThroughput, bts, err = msgp.ReadFloat64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ReadThroughput") + return + } + zb0001Mask |= 0x800 + case "writethroughput": + z.WriteThroughPut, bts, err = msgp.ReadFloat64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "WriteThroughPut") + return + } + zb0001Mask |= 0x1000 + case "readlatency": + z.ReadLatency, bts, err = msgp.ReadFloat64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ReadLatency") + return + } + zb0001Mask |= 0x2000 + case "writelatency": + z.WriteLatency, bts, err = msgp.ReadFloat64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "WriteLatency") + return + } + zb0001Mask |= 0x4000 + case "utilization": + z.Utilization, bts, err = msgp.ReadFloat64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Utilization") + return + } + zb0001Mask |= 0x8000 + case "metrics": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.Metrics = nil + } else { + if z.Metrics == nil { + z.Metrics = new(DiskMetrics) + } + bts, err = z.Metrics.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Metrics") + return + } + } + zb0001Mask |= 0x10000 + case "heal_info": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.HealInfo = nil + } else { + if z.HealInfo == nil { + z.HealInfo = new(HealingDisk) + } + bts, err = z.HealInfo.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "HealInfo") + return + } + } + zb0001Mask |= 0x20000 + case "used_inodes": + z.UsedInodes, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "UsedInodes") + return + } + case "free_inodes": + z.FreeInodes, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "FreeInodes") + return + } + zb0001Mask |= 0x40000 + case "local": + z.Local, bts, err = msgp.ReadBoolBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Local") + return + } + zb0001Mask |= 0x80000 + case "cacheStats": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.Cache = nil + } else { + if z.Cache == nil { + z.Cache = new(CacheStats) + } + bts, err = z.Cache.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Cache") + return + } + } + zb0001Mask |= 0x100000 + case "pool_index": + z.PoolIndex, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "PoolIndex") + return + } + case "set_index": + z.SetIndex, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "SetIndex") + return + } + case "disk_index": + z.DiskIndex, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "DiskIndex") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1fffff { + if (zb0001Mask & 0x1) == 0 { + z.Endpoint = "" + } + if (zb0001Mask & 0x2) == 0 { + z.RootDisk = false + } + if (zb0001Mask & 0x4) == 0 { + z.DrivePath = "" + } + if (zb0001Mask & 0x8) == 0 { + z.Healing = false + } + if (zb0001Mask & 0x10) == 0 { + z.Scanning = false + } + if (zb0001Mask & 0x20) == 0 { + z.State = "" + } + if (zb0001Mask & 0x40) == 0 { + z.UUID = "" + } + if (zb0001Mask & 0x80) == 0 { + z.Model = "" + } + if (zb0001Mask & 0x100) == 0 { + z.TotalSpace = 0 + } + if (zb0001Mask & 0x200) == 0 { + z.UsedSpace = 0 + } + if (zb0001Mask & 0x400) == 0 { + z.AvailableSpace = 0 + } + if (zb0001Mask & 0x800) == 0 { + z.ReadThroughput = 0 + } + if (zb0001Mask & 0x1000) == 0 { + z.WriteThroughPut = 0 + } + if (zb0001Mask & 0x2000) == 0 { + z.ReadLatency = 0 + } + if (zb0001Mask & 0x4000) == 0 { + z.WriteLatency = 0 + } + if (zb0001Mask & 0x8000) == 0 { + z.Utilization = 0 + } + if (zb0001Mask & 0x10000) == 0 { + z.Metrics = nil + } + if (zb0001Mask & 0x20000) == 0 { + z.HealInfo = nil + } + if (zb0001Mask & 0x40000) == 0 { + z.FreeInodes = 0 + } + if (zb0001Mask & 0x80000) == 0 { + z.Local = false + } + if (zb0001Mask & 0x100000) == 0 { + z.Cache = nil + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *Disk) Msgsize() (s int) { + s = 3 + 9 + msgp.StringPrefixSize + len(z.Endpoint) + 9 + msgp.BoolSize + 5 + msgp.StringPrefixSize + len(z.DrivePath) + 8 + msgp.BoolSize + 9 + msgp.BoolSize + 6 + msgp.StringPrefixSize + len(z.State) + 5 + msgp.StringPrefixSize + len(z.UUID) + 6 + msgp.Uint32Size + 6 + msgp.Uint32Size + 6 + msgp.StringPrefixSize + len(z.Model) + 11 + msgp.Uint64Size + 10 + msgp.Uint64Size + 11 + msgp.Uint64Size + 15 + msgp.Float64Size + 16 + msgp.Float64Size + 12 + msgp.Float64Size + 13 + msgp.Float64Size + 12 + msgp.Float64Size + 8 + if z.Metrics == nil { + s += msgp.NilSize + } else { + s += z.Metrics.Msgsize() + } + s += 10 + if z.HealInfo == nil { + s += msgp.NilSize + } else { + s += z.HealInfo.Msgsize() + } + s += 12 + msgp.Uint64Size + 12 + msgp.Uint64Size + 6 + msgp.BoolSize + 11 + if z.Cache == nil { + s += msgp.NilSize + } else { + s += z.Cache.Msgsize() + } + s += 11 + msgp.IntSize + 10 + msgp.IntSize + 11 + msgp.IntSize + return +} + +// DecodeMsg implements msgp.Decodable +func (z *DiskMetrics) 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 uint16 /* 9 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "lastMinute": + var zb0002 uint32 + zb0002, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "LastMinute") + return + } + if z.LastMinute == nil { + z.LastMinute = make(map[string]TimedAction, zb0002) + } else if len(z.LastMinute) > 0 { + for key := range z.LastMinute { + delete(z.LastMinute, key) + } + } + for zb0002 > 0 { + zb0002-- + var za0001 string + var za0002 TimedAction + za0001, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "LastMinute") + return + } + err = za0002.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "LastMinute", za0001) + return + } + z.LastMinute[za0001] = za0002 + } + zb0001Mask |= 0x1 + case "apiCalls": + var zb0003 uint32 + zb0003, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "APICalls") + return + } + if z.APICalls == nil { + z.APICalls = make(map[string]uint64, zb0003) + } else if len(z.APICalls) > 0 { + for key := range z.APICalls { + delete(z.APICalls, key) + } + } + for zb0003 > 0 { + zb0003-- + var za0003 string + var za0004 uint64 + za0003, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "APICalls") + return + } + za0004, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "APICalls", za0003) + return + } + z.APICalls[za0003] = za0004 + } + zb0001Mask |= 0x2 + case "totalTokens": + z.TotalTokens, err = dc.ReadUint32() + if err != nil { + err = msgp.WrapError(err, "TotalTokens") + return + } + zb0001Mask |= 0x4 + case "totalWaiting": + z.TotalWaiting, err = dc.ReadUint32() + if err != nil { + err = msgp.WrapError(err, "TotalWaiting") + return + } + zb0001Mask |= 0x8 + case "totalErrorsAvailability": + z.TotalErrorsAvailability, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "TotalErrorsAvailability") + return + } + zb0001Mask |= 0x10 + case "totalErrorsTimeout": + z.TotalErrorsTimeout, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "TotalErrorsTimeout") + return + } + zb0001Mask |= 0x20 + case "totalWrites": + z.TotalWrites, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "TotalWrites") + return + } + zb0001Mask |= 0x40 + case "totalDeletes": + z.TotalDeletes, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "TotalDeletes") + return + } + zb0001Mask |= 0x80 + case "apiLatencies": + var zb0004 uint32 + zb0004, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "APILatencies") + return + } + if z.APILatencies == nil { + z.APILatencies = make(map[string]interface{}, zb0004) + } else if len(z.APILatencies) > 0 { + for key := range z.APILatencies { + delete(z.APILatencies, key) + } + } + for zb0004 > 0 { + zb0004-- + var za0005 string + var za0006 interface{} + za0005, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "APILatencies") + return + } + za0006, err = dc.ReadIntf() + if err != nil { + err = msgp.WrapError(err, "APILatencies", za0005) + return + } + z.APILatencies[za0005] = za0006 + } + zb0001Mask |= 0x100 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1ff { + if (zb0001Mask & 0x1) == 0 { + z.LastMinute = nil + } + if (zb0001Mask & 0x2) == 0 { + z.APICalls = nil + } + if (zb0001Mask & 0x4) == 0 { + z.TotalTokens = 0 + } + if (zb0001Mask & 0x8) == 0 { + z.TotalWaiting = 0 + } + if (zb0001Mask & 0x10) == 0 { + z.TotalErrorsAvailability = 0 + } + if (zb0001Mask & 0x20) == 0 { + z.TotalErrorsTimeout = 0 + } + if (zb0001Mask & 0x40) == 0 { + z.TotalWrites = 0 + } + if (zb0001Mask & 0x80) == 0 { + z.TotalDeletes = 0 + } + if (zb0001Mask & 0x100) == 0 { + z.APILatencies = nil + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *DiskMetrics) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(9) + var zb0001Mask uint16 /* 9 bits */ + _ = zb0001Mask + if z.LastMinute == nil { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.APICalls == nil { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.TotalTokens == 0 { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.TotalWaiting == 0 { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.TotalErrorsAvailability == 0 { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.TotalErrorsTimeout == 0 { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.TotalWrites == 0 { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.TotalDeletes == 0 { + zb0001Len-- + zb0001Mask |= 0x80 + } + if z.APILatencies == nil { + zb0001Len-- + zb0001Mask |= 0x100 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + if (zb0001Mask & 0x1) == 0 { // if not omitted + // write "lastMinute" + err = en.Append(0xaa, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x69, 0x6e, 0x75, 0x74, 0x65) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.LastMinute))) + if err != nil { + err = msgp.WrapError(err, "LastMinute") + return + } + for za0001, za0002 := range z.LastMinute { + err = en.WriteString(za0001) + if err != nil { + err = msgp.WrapError(err, "LastMinute") + return + } + err = za0002.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "LastMinute", za0001) + return + } + } + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "apiCalls" + err = en.Append(0xa8, 0x61, 0x70, 0x69, 0x43, 0x61, 0x6c, 0x6c, 0x73) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.APICalls))) + if err != nil { + err = msgp.WrapError(err, "APICalls") + return + } + for za0003, za0004 := range z.APICalls { + err = en.WriteString(za0003) + if err != nil { + err = msgp.WrapError(err, "APICalls") + return + } + err = en.WriteUint64(za0004) + if err != nil { + err = msgp.WrapError(err, "APICalls", za0003) + return + } + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "totalTokens" + err = en.Append(0xab, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73) + if err != nil { + return + } + err = en.WriteUint32(z.TotalTokens) + if err != nil { + err = msgp.WrapError(err, "TotalTokens") + return + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // write "totalWaiting" + err = en.Append(0xac, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x57, 0x61, 0x69, 0x74, 0x69, 0x6e, 0x67) + if err != nil { + return + } + err = en.WriteUint32(z.TotalWaiting) + if err != nil { + err = msgp.WrapError(err, "TotalWaiting") + return + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // write "totalErrorsAvailability" + err = en.Append(0xb7, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79) + if err != nil { + return + } + err = en.WriteUint64(z.TotalErrorsAvailability) + if err != nil { + err = msgp.WrapError(err, "TotalErrorsAvailability") + return + } + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // write "totalErrorsTimeout" + err = en.Append(0xb2, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74) + if err != nil { + return + } + err = en.WriteUint64(z.TotalErrorsTimeout) + if err != nil { + err = msgp.WrapError(err, "TotalErrorsTimeout") + return + } + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // write "totalWrites" + err = en.Append(0xab, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x57, 0x72, 0x69, 0x74, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.TotalWrites) + if err != nil { + err = msgp.WrapError(err, "TotalWrites") + return + } + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // write "totalDeletes" + err = en.Append(0xac, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.TotalDeletes) + if err != nil { + err = msgp.WrapError(err, "TotalDeletes") + return + } + } + if (zb0001Mask & 0x100) == 0 { // if not omitted + // write "apiLatencies" + err = en.Append(0xac, 0x61, 0x70, 0x69, 0x4c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.APILatencies))) + if err != nil { + err = msgp.WrapError(err, "APILatencies") + return + } + for za0005, za0006 := range z.APILatencies { + err = en.WriteString(za0005) + if err != nil { + err = msgp.WrapError(err, "APILatencies") + return + } + err = en.WriteIntf(za0006) + if err != nil { + err = msgp.WrapError(err, "APILatencies", za0005) + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *DiskMetrics) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(9) + var zb0001Mask uint16 /* 9 bits */ + _ = zb0001Mask + if z.LastMinute == nil { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.APICalls == nil { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.TotalTokens == 0 { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.TotalWaiting == 0 { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.TotalErrorsAvailability == 0 { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.TotalErrorsTimeout == 0 { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.TotalWrites == 0 { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.TotalDeletes == 0 { + zb0001Len-- + zb0001Mask |= 0x80 + } + if z.APILatencies == nil { + zb0001Len-- + zb0001Mask |= 0x100 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + if (zb0001Mask & 0x1) == 0 { // if not omitted + // string "lastMinute" + o = append(o, 0xaa, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x69, 0x6e, 0x75, 0x74, 0x65) + o = msgp.AppendMapHeader(o, uint32(len(z.LastMinute))) + for za0001, za0002 := range z.LastMinute { + o = msgp.AppendString(o, za0001) + o, err = za0002.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "LastMinute", za0001) + return + } + } + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "apiCalls" + o = append(o, 0xa8, 0x61, 0x70, 0x69, 0x43, 0x61, 0x6c, 0x6c, 0x73) + o = msgp.AppendMapHeader(o, uint32(len(z.APICalls))) + for za0003, za0004 := range z.APICalls { + o = msgp.AppendString(o, za0003) + o = msgp.AppendUint64(o, za0004) + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "totalTokens" + o = append(o, 0xab, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73) + o = msgp.AppendUint32(o, z.TotalTokens) + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // string "totalWaiting" + o = append(o, 0xac, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x57, 0x61, 0x69, 0x74, 0x69, 0x6e, 0x67) + o = msgp.AppendUint32(o, z.TotalWaiting) + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // string "totalErrorsAvailability" + o = append(o, 0xb7, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79) + o = msgp.AppendUint64(o, z.TotalErrorsAvailability) + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // string "totalErrorsTimeout" + o = append(o, 0xb2, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74) + o = msgp.AppendUint64(o, z.TotalErrorsTimeout) + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // string "totalWrites" + o = append(o, 0xab, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x57, 0x72, 0x69, 0x74, 0x65, 0x73) + o = msgp.AppendUint64(o, z.TotalWrites) + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // string "totalDeletes" + o = append(o, 0xac, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x73) + o = msgp.AppendUint64(o, z.TotalDeletes) + } + if (zb0001Mask & 0x100) == 0 { // if not omitted + // string "apiLatencies" + o = append(o, 0xac, 0x61, 0x70, 0x69, 0x4c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73) + o = msgp.AppendMapHeader(o, uint32(len(z.APILatencies))) + for za0005, za0006 := range z.APILatencies { + o = msgp.AppendString(o, za0005) + o, err = msgp.AppendIntf(o, za0006) + if err != nil { + err = msgp.WrapError(err, "APILatencies", za0005) + return + } + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *DiskMetrics) 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 uint16 /* 9 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 "lastMinute": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LastMinute") + return + } + if z.LastMinute == nil { + z.LastMinute = make(map[string]TimedAction, zb0002) + } else if len(z.LastMinute) > 0 { + for key := range z.LastMinute { + delete(z.LastMinute, key) + } + } + for zb0002 > 0 { + var za0001 string + var za0002 TimedAction + zb0002-- + za0001, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LastMinute") + return + } + bts, err = za0002.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "LastMinute", za0001) + return + } + z.LastMinute[za0001] = za0002 + } + zb0001Mask |= 0x1 + case "apiCalls": + var zb0003 uint32 + zb0003, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "APICalls") + return + } + if z.APICalls == nil { + z.APICalls = make(map[string]uint64, zb0003) + } else if len(z.APICalls) > 0 { + for key := range z.APICalls { + delete(z.APICalls, key) + } + } + for zb0003 > 0 { + var za0003 string + var za0004 uint64 + zb0003-- + za0003, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "APICalls") + return + } + za0004, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "APICalls", za0003) + return + } + z.APICalls[za0003] = za0004 + } + zb0001Mask |= 0x2 + case "totalTokens": + z.TotalTokens, bts, err = msgp.ReadUint32Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "TotalTokens") + return + } + zb0001Mask |= 0x4 + case "totalWaiting": + z.TotalWaiting, bts, err = msgp.ReadUint32Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "TotalWaiting") + return + } + zb0001Mask |= 0x8 + case "totalErrorsAvailability": + z.TotalErrorsAvailability, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "TotalErrorsAvailability") + return + } + zb0001Mask |= 0x10 + case "totalErrorsTimeout": + z.TotalErrorsTimeout, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "TotalErrorsTimeout") + return + } + zb0001Mask |= 0x20 + case "totalWrites": + z.TotalWrites, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "TotalWrites") + return + } + zb0001Mask |= 0x40 + case "totalDeletes": + z.TotalDeletes, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "TotalDeletes") + return + } + zb0001Mask |= 0x80 + case "apiLatencies": + var zb0004 uint32 + zb0004, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "APILatencies") + return + } + if z.APILatencies == nil { + z.APILatencies = make(map[string]interface{}, zb0004) + } else if len(z.APILatencies) > 0 { + for key := range z.APILatencies { + delete(z.APILatencies, key) + } + } + for zb0004 > 0 { + var za0005 string + var za0006 interface{} + zb0004-- + za0005, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "APILatencies") + return + } + za0006, bts, err = msgp.ReadIntfBytes(bts) + if err != nil { + err = msgp.WrapError(err, "APILatencies", za0005) + return + } + z.APILatencies[za0005] = za0006 + } + zb0001Mask |= 0x100 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1ff { + if (zb0001Mask & 0x1) == 0 { + z.LastMinute = nil + } + if (zb0001Mask & 0x2) == 0 { + z.APICalls = nil + } + if (zb0001Mask & 0x4) == 0 { + z.TotalTokens = 0 + } + if (zb0001Mask & 0x8) == 0 { + z.TotalWaiting = 0 + } + if (zb0001Mask & 0x10) == 0 { + z.TotalErrorsAvailability = 0 + } + if (zb0001Mask & 0x20) == 0 { + z.TotalErrorsTimeout = 0 + } + if (zb0001Mask & 0x40) == 0 { + z.TotalWrites = 0 + } + if (zb0001Mask & 0x80) == 0 { + z.TotalDeletes = 0 + } + if (zb0001Mask & 0x100) == 0 { + z.APILatencies = nil + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *DiskMetrics) Msgsize() (s int) { + s = 1 + 11 + msgp.MapHeaderSize + if z.LastMinute != nil { + for za0001, za0002 := range z.LastMinute { + _ = za0002 + s += msgp.StringPrefixSize + len(za0001) + za0002.Msgsize() + } + } + s += 9 + msgp.MapHeaderSize + if z.APICalls != nil { + for za0003, za0004 := range z.APICalls { + _ = za0004 + s += msgp.StringPrefixSize + len(za0003) + msgp.Uint64Size + } + } + s += 12 + msgp.Uint32Size + 13 + msgp.Uint32Size + 24 + msgp.Uint64Size + 19 + msgp.Uint64Size + 12 + msgp.Uint64Size + 13 + msgp.Uint64Size + 13 + msgp.MapHeaderSize + if z.APILatencies != nil { + for za0005, za0006 := range z.APILatencies { + _ = za0006 + s += msgp.StringPrefixSize + len(za0005) + msgp.GuessSize(za0006) + } + } + return +} + +// DecodeMsg implements msgp.Decodable +func (z *ErasureBackend) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "backendType": + { + var zb0002 string + zb0002, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Type") + return + } + z.Type = backendType(zb0002) + } + case "onlineDisks": + z.OnlineDisks, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "OnlineDisks") + return + } + case "offlineDisks": + z.OfflineDisks, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "OfflineDisks") + return + } + case "standardSCParity": + z.StandardSCParity, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "StandardSCParity") + return + } + case "rrSCParity": + z.RRSCParity, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "RRSCParity") + return + } + case "totalSets": + var zb0003 uint32 + zb0003, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "TotalSets") + return + } + if cap(z.TotalSets) >= int(zb0003) { + z.TotalSets = (z.TotalSets)[:zb0003] + } else { + z.TotalSets = make([]int, zb0003) + } + for za0001 := range z.TotalSets { + z.TotalSets[za0001], err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "TotalSets", za0001) + return + } + } + case "totalDrivesPerSet": + var zb0004 uint32 + zb0004, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "DrivesPerSet") + return + } + if cap(z.DrivesPerSet) >= int(zb0004) { + z.DrivesPerSet = (z.DrivesPerSet)[:zb0004] + } else { + z.DrivesPerSet = make([]int, zb0004) + } + for za0002 := range z.DrivesPerSet { + z.DrivesPerSet[za0002], err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "DrivesPerSet", za0002) + return + } + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *ErasureBackend) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 7 + // write "backendType" + err = en.Append(0x87, 0xab, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65) + if err != nil { + return + } + err = en.WriteString(string(z.Type)) + if err != nil { + err = msgp.WrapError(err, "Type") + return + } + // write "onlineDisks" + err = en.Append(0xab, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x69, 0x73, 0x6b, 0x73) + if err != nil { + return + } + err = en.WriteInt(z.OnlineDisks) + if err != nil { + err = msgp.WrapError(err, "OnlineDisks") + return + } + // write "offlineDisks" + err = en.Append(0xac, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x69, 0x73, 0x6b, 0x73) + if err != nil { + return + } + err = en.WriteInt(z.OfflineDisks) + if err != nil { + err = msgp.WrapError(err, "OfflineDisks") + return + } + // write "standardSCParity" + err = en.Append(0xb0, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x53, 0x43, 0x50, 0x61, 0x72, 0x69, 0x74, 0x79) + if err != nil { + return + } + err = en.WriteInt(z.StandardSCParity) + if err != nil { + err = msgp.WrapError(err, "StandardSCParity") + return + } + // write "rrSCParity" + err = en.Append(0xaa, 0x72, 0x72, 0x53, 0x43, 0x50, 0x61, 0x72, 0x69, 0x74, 0x79) + if err != nil { + return + } + err = en.WriteInt(z.RRSCParity) + if err != nil { + err = msgp.WrapError(err, "RRSCParity") + return + } + // write "totalSets" + err = en.Append(0xa9, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x65, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.TotalSets))) + if err != nil { + err = msgp.WrapError(err, "TotalSets") + return + } + for za0001 := range z.TotalSets { + err = en.WriteInt(z.TotalSets[za0001]) + if err != nil { + err = msgp.WrapError(err, "TotalSets", za0001) + return + } + } + // write "totalDrivesPerSet" + err = en.Append(0xb1, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x44, 0x72, 0x69, 0x76, 0x65, 0x73, 0x50, 0x65, 0x72, 0x53, 0x65, 0x74) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.DrivesPerSet))) + if err != nil { + err = msgp.WrapError(err, "DrivesPerSet") + return + } + for za0002 := range z.DrivesPerSet { + err = en.WriteInt(z.DrivesPerSet[za0002]) + if err != nil { + err = msgp.WrapError(err, "DrivesPerSet", za0002) + return + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *ErasureBackend) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 7 + // string "backendType" + o = append(o, 0x87, 0xab, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65) + o = msgp.AppendString(o, string(z.Type)) + // string "onlineDisks" + o = append(o, 0xab, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x69, 0x73, 0x6b, 0x73) + o = msgp.AppendInt(o, z.OnlineDisks) + // string "offlineDisks" + o = append(o, 0xac, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x69, 0x73, 0x6b, 0x73) + o = msgp.AppendInt(o, z.OfflineDisks) + // string "standardSCParity" + o = append(o, 0xb0, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x53, 0x43, 0x50, 0x61, 0x72, 0x69, 0x74, 0x79) + o = msgp.AppendInt(o, z.StandardSCParity) + // string "rrSCParity" + o = append(o, 0xaa, 0x72, 0x72, 0x53, 0x43, 0x50, 0x61, 0x72, 0x69, 0x74, 0x79) + o = msgp.AppendInt(o, z.RRSCParity) + // string "totalSets" + o = append(o, 0xa9, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x65, 0x74, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.TotalSets))) + for za0001 := range z.TotalSets { + o = msgp.AppendInt(o, z.TotalSets[za0001]) + } + // string "totalDrivesPerSet" + o = append(o, 0xb1, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x44, 0x72, 0x69, 0x76, 0x65, 0x73, 0x50, 0x65, 0x72, 0x53, 0x65, 0x74) + o = msgp.AppendArrayHeader(o, uint32(len(z.DrivesPerSet))) + for za0002 := range z.DrivesPerSet { + o = msgp.AppendInt(o, z.DrivesPerSet[za0002]) + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *ErasureBackend) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "backendType": + { + var zb0002 string + zb0002, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Type") + return + } + z.Type = backendType(zb0002) + } + case "onlineDisks": + z.OnlineDisks, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "OnlineDisks") + return + } + case "offlineDisks": + z.OfflineDisks, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "OfflineDisks") + return + } + case "standardSCParity": + z.StandardSCParity, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "StandardSCParity") + return + } + case "rrSCParity": + z.RRSCParity, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "RRSCParity") + return + } + case "totalSets": + var zb0003 uint32 + zb0003, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "TotalSets") + return + } + if cap(z.TotalSets) >= int(zb0003) { + z.TotalSets = (z.TotalSets)[:zb0003] + } else { + z.TotalSets = make([]int, zb0003) + } + for za0001 := range z.TotalSets { + z.TotalSets[za0001], bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "TotalSets", za0001) + return + } + } + case "totalDrivesPerSet": + var zb0004 uint32 + zb0004, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "DrivesPerSet") + return + } + if cap(z.DrivesPerSet) >= int(zb0004) { + z.DrivesPerSet = (z.DrivesPerSet)[:zb0004] + } else { + z.DrivesPerSet = make([]int, zb0004) + } + for za0002 := range z.DrivesPerSet { + z.DrivesPerSet[za0002], bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "DrivesPerSet", za0002) + return + } + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *ErasureBackend) Msgsize() (s int) { + s = 1 + 12 + msgp.StringPrefixSize + len(string(z.Type)) + 12 + msgp.IntSize + 13 + msgp.IntSize + 17 + msgp.IntSize + 11 + msgp.IntSize + 10 + msgp.ArrayHeaderSize + (len(z.TotalSets) * (msgp.IntSize)) + 18 + msgp.ArrayHeaderSize + (len(z.DrivesPerSet) * (msgp.IntSize)) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *ErasureSetInfo) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "id": + z.ID, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "ID") + return + } + case "rawUsage": + z.RawUsage, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "RawUsage") + return + } + case "rawCapacity": + z.RawCapacity, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "RawCapacity") + return + } + case "usage": + z.Usage, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "Usage") + return + } + case "objectsCount": + z.ObjectsCount, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ObjectsCount") + return + } + case "versionsCount": + z.VersionsCount, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "VersionsCount") + return + } + case "deleteMarkersCount": + z.DeleteMarkersCount, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "DeleteMarkersCount") + return + } + case "healDisks": + z.HealDisks, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "HealDisks") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *ErasureSetInfo) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 8 + // write "id" + err = en.Append(0x88, 0xa2, 0x69, 0x64) + if err != nil { + return + } + err = en.WriteInt(z.ID) + if err != nil { + err = msgp.WrapError(err, "ID") + return + } + // write "rawUsage" + err = en.Append(0xa8, 0x72, 0x61, 0x77, 0x55, 0x73, 0x61, 0x67, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.RawUsage) + if err != nil { + err = msgp.WrapError(err, "RawUsage") + return + } + // write "rawCapacity" + err = en.Append(0xab, 0x72, 0x61, 0x77, 0x43, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79) + if err != nil { + return + } + err = en.WriteUint64(z.RawCapacity) + if err != nil { + err = msgp.WrapError(err, "RawCapacity") + return + } + // write "usage" + err = en.Append(0xa5, 0x75, 0x73, 0x61, 0x67, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.Usage) + if err != nil { + err = msgp.WrapError(err, "Usage") + return + } + // write "objectsCount" + err = en.Append(0xac, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteUint64(z.ObjectsCount) + if err != nil { + err = msgp.WrapError(err, "ObjectsCount") + return + } + // write "versionsCount" + err = en.Append(0xad, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteUint64(z.VersionsCount) + if err != nil { + err = msgp.WrapError(err, "VersionsCount") + return + } + // write "deleteMarkersCount" + err = en.Append(0xb2, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x72, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteUint64(z.DeleteMarkersCount) + if err != nil { + err = msgp.WrapError(err, "DeleteMarkersCount") + return + } + // write "healDisks" + err = en.Append(0xa9, 0x68, 0x65, 0x61, 0x6c, 0x44, 0x69, 0x73, 0x6b, 0x73) + if err != nil { + return + } + err = en.WriteInt(z.HealDisks) + if err != nil { + err = msgp.WrapError(err, "HealDisks") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *ErasureSetInfo) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 8 + // string "id" + o = append(o, 0x88, 0xa2, 0x69, 0x64) + o = msgp.AppendInt(o, z.ID) + // string "rawUsage" + o = append(o, 0xa8, 0x72, 0x61, 0x77, 0x55, 0x73, 0x61, 0x67, 0x65) + o = msgp.AppendUint64(o, z.RawUsage) + // string "rawCapacity" + o = append(o, 0xab, 0x72, 0x61, 0x77, 0x43, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79) + o = msgp.AppendUint64(o, z.RawCapacity) + // string "usage" + o = append(o, 0xa5, 0x75, 0x73, 0x61, 0x67, 0x65) + o = msgp.AppendUint64(o, z.Usage) + // string "objectsCount" + o = append(o, 0xac, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendUint64(o, z.ObjectsCount) + // string "versionsCount" + o = append(o, 0xad, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendUint64(o, z.VersionsCount) + // string "deleteMarkersCount" + o = append(o, 0xb2, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x72, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendUint64(o, z.DeleteMarkersCount) + // string "healDisks" + o = append(o, 0xa9, 0x68, 0x65, 0x61, 0x6c, 0x44, 0x69, 0x73, 0x6b, 0x73) + o = msgp.AppendInt(o, z.HealDisks) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *ErasureSetInfo) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "id": + z.ID, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ID") + return + } + case "rawUsage": + z.RawUsage, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "RawUsage") + return + } + case "rawCapacity": + z.RawCapacity, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "RawCapacity") + return + } + case "usage": + z.Usage, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Usage") + return + } + case "objectsCount": + z.ObjectsCount, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ObjectsCount") + return + } + case "versionsCount": + z.VersionsCount, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "VersionsCount") + return + } + case "deleteMarkersCount": + z.DeleteMarkersCount, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "DeleteMarkersCount") + return + } + case "healDisks": + z.HealDisks, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "HealDisks") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *ErasureSetInfo) Msgsize() (s int) { + s = 1 + 3 + msgp.IntSize + 9 + msgp.Uint64Size + 12 + msgp.Uint64Size + 6 + msgp.Uint64Size + 13 + msgp.Uint64Size + 14 + msgp.Uint64Size + 19 + msgp.Uint64Size + 10 + msgp.IntSize + return +} + +// DecodeMsg implements msgp.Decodable +func (z *FSBackend) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "backendType": + { + var zb0002 string + zb0002, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Type") + return + } + z.Type = backendType(zb0002) + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z FSBackend) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 1 + // write "backendType" + err = en.Append(0x81, 0xab, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65) + if err != nil { + return + } + err = en.WriteString(string(z.Type)) + if err != nil { + err = msgp.WrapError(err, "Type") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z FSBackend) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 1 + // string "backendType" + o = append(o, 0x81, 0xab, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65) + o = msgp.AppendString(o, string(z.Type)) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *FSBackend) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "backendType": + { + var zb0002 string + zb0002, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Type") + return + } + z.Type = backendType(zb0002) + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z FSBackend) Msgsize() (s int) { + s = 1 + 12 + msgp.StringPrefixSize + len(string(z.Type)) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *GCStats) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "last_gc": + z.LastGC, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "LastGC") + return + } + case "num_gc": + z.NumGC, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "NumGC") + return + } + case "pause_total": + z.PauseTotal, err = dc.ReadDuration() + if err != nil { + err = msgp.WrapError(err, "PauseTotal") + return + } + case "pause": + var zb0002 uint32 + zb0002, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "Pause") + return + } + if cap(z.Pause) >= int(zb0002) { + z.Pause = (z.Pause)[:zb0002] + } else { + z.Pause = make([]time.Duration, zb0002) + } + for za0001 := range z.Pause { + z.Pause[za0001], err = dc.ReadDuration() + if err != nil { + err = msgp.WrapError(err, "Pause", za0001) + return + } + } + case "pause_end": + var zb0003 uint32 + zb0003, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "PauseEnd") + return + } + if cap(z.PauseEnd) >= int(zb0003) { + z.PauseEnd = (z.PauseEnd)[:zb0003] + } else { + z.PauseEnd = make([]time.Time, zb0003) + } + for za0002 := range z.PauseEnd { + z.PauseEnd[za0002], err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "PauseEnd", za0002) + return + } + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *GCStats) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 5 + // write "last_gc" + err = en.Append(0x85, 0xa7, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x67, 0x63) + if err != nil { + return + } + err = en.WriteTime(z.LastGC) + if err != nil { + err = msgp.WrapError(err, "LastGC") + return + } + // write "num_gc" + err = en.Append(0xa6, 0x6e, 0x75, 0x6d, 0x5f, 0x67, 0x63) + if err != nil { + return + } + err = en.WriteInt64(z.NumGC) + if err != nil { + err = msgp.WrapError(err, "NumGC") + return + } + // write "pause_total" + err = en.Append(0xab, 0x70, 0x61, 0x75, 0x73, 0x65, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c) + if err != nil { + return + } + err = en.WriteDuration(z.PauseTotal) + if err != nil { + err = msgp.WrapError(err, "PauseTotal") + return + } + // write "pause" + err = en.Append(0xa5, 0x70, 0x61, 0x75, 0x73, 0x65) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Pause))) + if err != nil { + err = msgp.WrapError(err, "Pause") + return + } + for za0001 := range z.Pause { + err = en.WriteDuration(z.Pause[za0001]) + if err != nil { + err = msgp.WrapError(err, "Pause", za0001) + return + } + } + // write "pause_end" + err = en.Append(0xa9, 0x70, 0x61, 0x75, 0x73, 0x65, 0x5f, 0x65, 0x6e, 0x64) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.PauseEnd))) + if err != nil { + err = msgp.WrapError(err, "PauseEnd") + return + } + for za0002 := range z.PauseEnd { + err = en.WriteTime(z.PauseEnd[za0002]) + if err != nil { + err = msgp.WrapError(err, "PauseEnd", za0002) + return + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *GCStats) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 5 + // string "last_gc" + o = append(o, 0x85, 0xa7, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x67, 0x63) + o = msgp.AppendTime(o, z.LastGC) + // string "num_gc" + o = append(o, 0xa6, 0x6e, 0x75, 0x6d, 0x5f, 0x67, 0x63) + o = msgp.AppendInt64(o, z.NumGC) + // string "pause_total" + o = append(o, 0xab, 0x70, 0x61, 0x75, 0x73, 0x65, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c) + o = msgp.AppendDuration(o, z.PauseTotal) + // string "pause" + o = append(o, 0xa5, 0x70, 0x61, 0x75, 0x73, 0x65) + o = msgp.AppendArrayHeader(o, uint32(len(z.Pause))) + for za0001 := range z.Pause { + o = msgp.AppendDuration(o, z.Pause[za0001]) + } + // string "pause_end" + o = append(o, 0xa9, 0x70, 0x61, 0x75, 0x73, 0x65, 0x5f, 0x65, 0x6e, 0x64) + o = msgp.AppendArrayHeader(o, uint32(len(z.PauseEnd))) + for za0002 := range z.PauseEnd { + o = msgp.AppendTime(o, z.PauseEnd[za0002]) + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *GCStats) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "last_gc": + z.LastGC, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LastGC") + return + } + case "num_gc": + z.NumGC, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "NumGC") + return + } + case "pause_total": + z.PauseTotal, bts, err = msgp.ReadDurationBytes(bts) + if err != nil { + err = msgp.WrapError(err, "PauseTotal") + return + } + case "pause": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Pause") + return + } + if cap(z.Pause) >= int(zb0002) { + z.Pause = (z.Pause)[:zb0002] + } else { + z.Pause = make([]time.Duration, zb0002) + } + for za0001 := range z.Pause { + z.Pause[za0001], bts, err = msgp.ReadDurationBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Pause", za0001) + return + } + } + case "pause_end": + var zb0003 uint32 + zb0003, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "PauseEnd") + return + } + if cap(z.PauseEnd) >= int(zb0003) { + z.PauseEnd = (z.PauseEnd)[:zb0003] + } else { + z.PauseEnd = make([]time.Time, zb0003) + } + for za0002 := range z.PauseEnd { + z.PauseEnd[za0002], bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "PauseEnd", za0002) + return + } + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *GCStats) Msgsize() (s int) { + s = 1 + 8 + msgp.TimeSize + 7 + msgp.Int64Size + 12 + msgp.DurationSize + 6 + msgp.ArrayHeaderSize + (len(z.Pause) * (msgp.DurationSize)) + 10 + msgp.ArrayHeaderSize + (len(z.PauseEnd) * (msgp.TimeSize)) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *InfoMessage) 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 uint16 /* 13 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "mode": + z.Mode, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Mode") + return + } + zb0001Mask |= 0x1 + case "domain": + var zb0002 uint32 + zb0002, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "Domain") + return + } + if cap(z.Domain) >= int(zb0002) { + z.Domain = (z.Domain)[:zb0002] + } else { + z.Domain = make([]string, zb0002) + } + for za0001 := range z.Domain { + z.Domain[za0001], err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Domain", za0001) + return + } + } + zb0001Mask |= 0x2 + case "region": + z.Region, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Region") + return + } + zb0001Mask |= 0x4 + case "sqsARN": + var zb0003 uint32 + zb0003, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "SQSARN") + return + } + if cap(z.SQSARN) >= int(zb0003) { + z.SQSARN = (z.SQSARN)[:zb0003] + } else { + z.SQSARN = make([]string, zb0003) + } + for za0002 := range z.SQSARN { + z.SQSARN[za0002], err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "SQSARN", za0002) + return + } + } + zb0001Mask |= 0x8 + case "deploymentID": + z.DeploymentID, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "DeploymentID") + return + } + zb0001Mask |= 0x10 + case "buckets": + var zb0004 uint32 + zb0004, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "Buckets") + return + } + var zb0004Mask uint8 /* 1 bits */ + _ = zb0004Mask + for zb0004 > 0 { + zb0004-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, "Buckets") + return + } + switch msgp.UnsafeString(field) { + case "count": + z.Buckets.Count, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "Buckets", "Count") + return + } + case "error": + z.Buckets.Error, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Buckets", "Error") + return + } + zb0004Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, "Buckets") + return + } + } + } + // Clear omitted fields. + if zb0004Mask != 0x1 { + if (zb0004Mask & 0x1) == 0 { + z.Buckets.Error = "" + } + } + zb0001Mask |= 0x20 + case "objects": + var zb0005 uint32 + zb0005, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "Objects") + return + } + var zb0005Mask uint8 /* 1 bits */ + _ = zb0005Mask + for zb0005 > 0 { + zb0005-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, "Objects") + return + } + switch msgp.UnsafeString(field) { + case "count": + z.Objects.Count, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "Objects", "Count") + return + } + case "error": + z.Objects.Error, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Objects", "Error") + return + } + zb0005Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, "Objects") + return + } + } + } + // Clear omitted fields. + if zb0005Mask != 0x1 { + if (zb0005Mask & 0x1) == 0 { + z.Objects.Error = "" + } + } + zb0001Mask |= 0x40 + case "versions": + var zb0006 uint32 + zb0006, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "Versions") + return + } + var zb0006Mask uint8 /* 1 bits */ + _ = zb0006Mask + for zb0006 > 0 { + zb0006-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, "Versions") + return + } + switch msgp.UnsafeString(field) { + case "count": + z.Versions.Count, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "Versions", "Count") + return + } + case "error": + z.Versions.Error, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Versions", "Error") + return + } + zb0006Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, "Versions") + return + } + } + } + // Clear omitted fields. + if zb0006Mask != 0x1 { + if (zb0006Mask & 0x1) == 0 { + z.Versions.Error = "" + } + } + zb0001Mask |= 0x80 + case "deletemarkers": + var zb0007 uint32 + zb0007, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "DeleteMarkers") + return + } + var zb0007Mask uint8 /* 1 bits */ + _ = zb0007Mask + for zb0007 > 0 { + zb0007-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, "DeleteMarkers") + return + } + switch msgp.UnsafeString(field) { + case "count": + z.DeleteMarkers.Count, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "DeleteMarkers", "Count") + return + } + case "error": + z.DeleteMarkers.Error, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "DeleteMarkers", "Error") + return + } + zb0007Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, "DeleteMarkers") + return + } + } + } + // Clear omitted fields. + if zb0007Mask != 0x1 { + if (zb0007Mask & 0x1) == 0 { + z.DeleteMarkers.Error = "" + } + } + zb0001Mask |= 0x100 + case "usage": + var zb0008 uint32 + zb0008, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "Usage") + return + } + var zb0008Mask uint8 /* 1 bits */ + _ = zb0008Mask + for zb0008 > 0 { + zb0008-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, "Usage") + return + } + switch msgp.UnsafeString(field) { + case "size": + z.Usage.Size, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "Usage", "Size") + return + } + case "error": + z.Usage.Error, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Usage", "Error") + return + } + zb0008Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, "Usage") + return + } + } + } + // Clear omitted fields. + if zb0008Mask != 0x1 { + if (zb0008Mask & 0x1) == 0 { + z.Usage.Error = "" + } + } + zb0001Mask |= 0x200 + case "services": + err = z.Services.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Services") + return + } + zb0001Mask |= 0x400 + case "backend": + err = z.Backend.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Backend") + return + } + zb0001Mask |= 0x800 + case "servers": + var zb0009 uint32 + zb0009, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "Servers") + return + } + if cap(z.Servers) >= int(zb0009) { + z.Servers = (z.Servers)[:zb0009] + } else { + z.Servers = make([]ServerProperties, zb0009) + } + for za0003 := range z.Servers { + err = z.Servers[za0003].DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Servers", za0003) + return + } + } + zb0001Mask |= 0x1000 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1fff { + if (zb0001Mask & 0x1) == 0 { + z.Mode = "" + } + if (zb0001Mask & 0x2) == 0 { + z.Domain = nil + } + if (zb0001Mask & 0x4) == 0 { + z.Region = "" + } + if (zb0001Mask & 0x8) == 0 { + z.SQSARN = nil + } + if (zb0001Mask & 0x10) == 0 { + z.DeploymentID = "" + } + if (zb0001Mask & 0x20) == 0 { + z.Buckets = (Buckets{}) + } + if (zb0001Mask & 0x40) == 0 { + z.Objects = (Objects{}) + } + if (zb0001Mask & 0x80) == 0 { + z.Versions = (Versions{}) + } + if (zb0001Mask & 0x100) == 0 { + z.DeleteMarkers = (DeleteMarkers{}) + } + if (zb0001Mask & 0x200) == 0 { + z.Usage = (Usage{}) + } + if (zb0001Mask & 0x400) == 0 { + z.Services = Services{} + } + if (zb0001Mask & 0x800) == 0 { + z.Backend = ErasureBackend{} + } + if (zb0001Mask & 0x1000) == 0 { + z.Servers = nil + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *InfoMessage) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(13) + var zb0001Mask uint16 /* 13 bits */ + _ = zb0001Mask + if z.Mode == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.Domain == nil { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.Region == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.SQSARN == nil { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.DeploymentID == "" { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.Buckets == (Buckets{}) { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.Objects == (Objects{}) { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.Versions == (Versions{}) { + zb0001Len-- + zb0001Mask |= 0x80 + } + if z.DeleteMarkers == (DeleteMarkers{}) { + zb0001Len-- + zb0001Mask |= 0x100 + } + if z.Usage == (Usage{}) { + zb0001Len-- + zb0001Mask |= 0x200 + } + if z.Servers == nil { + zb0001Len-- + zb0001Mask |= 0x1000 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + if (zb0001Mask & 0x1) == 0 { // if not omitted + // write "mode" + err = en.Append(0xa4, 0x6d, 0x6f, 0x64, 0x65) + if err != nil { + return + } + err = en.WriteString(z.Mode) + if err != nil { + err = msgp.WrapError(err, "Mode") + return + } + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "domain" + err = en.Append(0xa6, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Domain))) + if err != nil { + err = msgp.WrapError(err, "Domain") + return + } + for za0001 := range z.Domain { + err = en.WriteString(z.Domain[za0001]) + if err != nil { + err = msgp.WrapError(err, "Domain", za0001) + return + } + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "region" + err = en.Append(0xa6, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e) + if err != nil { + return + } + err = en.WriteString(z.Region) + if err != nil { + err = msgp.WrapError(err, "Region") + return + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // write "sqsARN" + err = en.Append(0xa6, 0x73, 0x71, 0x73, 0x41, 0x52, 0x4e) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.SQSARN))) + if err != nil { + err = msgp.WrapError(err, "SQSARN") + return + } + for za0002 := range z.SQSARN { + err = en.WriteString(z.SQSARN[za0002]) + if err != nil { + err = msgp.WrapError(err, "SQSARN", za0002) + return + } + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // write "deploymentID" + err = en.Append(0xac, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x44) + if err != nil { + return + } + err = en.WriteString(z.DeploymentID) + if err != nil { + err = msgp.WrapError(err, "DeploymentID") + return + } + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // write "buckets" + err = en.Append(0xa7, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73) + if err != nil { + return + } + // check for omitted fields + zb0002Len := uint32(2) + var zb0002Mask uint8 /* 2 bits */ + _ = zb0002Mask + if z.Buckets.Error == "" { + zb0002Len-- + zb0002Mask |= 0x2 + } + // variable map header, size zb0002Len + err = en.Append(0x80 | uint8(zb0002Len)) + if err != nil { + return + } + // write "count" + err = en.Append(0xa5, 0x63, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteUint64(z.Buckets.Count) + if err != nil { + err = msgp.WrapError(err, "Buckets", "Count") + return + } + if (zb0002Mask & 0x2) == 0 { // if not omitted + // write "error" + err = en.Append(0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72) + if err != nil { + return + } + err = en.WriteString(z.Buckets.Error) + if err != nil { + err = msgp.WrapError(err, "Buckets", "Error") + return + } + } + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // write "objects" + err = en.Append(0xa7, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73) + if err != nil { + return + } + // check for omitted fields + zb0003Len := uint32(2) + var zb0003Mask uint8 /* 2 bits */ + _ = zb0003Mask + if z.Objects.Error == "" { + zb0003Len-- + zb0003Mask |= 0x2 + } + // variable map header, size zb0003Len + err = en.Append(0x80 | uint8(zb0003Len)) + if err != nil { + return + } + // write "count" + err = en.Append(0xa5, 0x63, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteUint64(z.Objects.Count) + if err != nil { + err = msgp.WrapError(err, "Objects", "Count") + return + } + if (zb0003Mask & 0x2) == 0 { // if not omitted + // write "error" + err = en.Append(0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72) + if err != nil { + return + } + err = en.WriteString(z.Objects.Error) + if err != nil { + err = msgp.WrapError(err, "Objects", "Error") + return + } + } + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // write "versions" + err = en.Append(0xa8, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73) + if err != nil { + return + } + // check for omitted fields + zb0004Len := uint32(2) + var zb0004Mask uint8 /* 2 bits */ + _ = zb0004Mask + if z.Versions.Error == "" { + zb0004Len-- + zb0004Mask |= 0x2 + } + // variable map header, size zb0004Len + err = en.Append(0x80 | uint8(zb0004Len)) + if err != nil { + return + } + // write "count" + err = en.Append(0xa5, 0x63, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteUint64(z.Versions.Count) + if err != nil { + err = msgp.WrapError(err, "Versions", "Count") + return + } + if (zb0004Mask & 0x2) == 0 { // if not omitted + // write "error" + err = en.Append(0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72) + if err != nil { + return + } + err = en.WriteString(z.Versions.Error) + if err != nil { + err = msgp.WrapError(err, "Versions", "Error") + return + } + } + } + if (zb0001Mask & 0x100) == 0 { // if not omitted + // write "deletemarkers" + err = en.Append(0xad, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x72, 0x73) + if err != nil { + return + } + // check for omitted fields + zb0005Len := uint32(2) + var zb0005Mask uint8 /* 2 bits */ + _ = zb0005Mask + if z.DeleteMarkers.Error == "" { + zb0005Len-- + zb0005Mask |= 0x2 + } + // variable map header, size zb0005Len + err = en.Append(0x80 | uint8(zb0005Len)) + if err != nil { + return + } + // write "count" + err = en.Append(0xa5, 0x63, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteUint64(z.DeleteMarkers.Count) + if err != nil { + err = msgp.WrapError(err, "DeleteMarkers", "Count") + return + } + if (zb0005Mask & 0x2) == 0 { // if not omitted + // write "error" + err = en.Append(0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72) + if err != nil { + return + } + err = en.WriteString(z.DeleteMarkers.Error) + if err != nil { + err = msgp.WrapError(err, "DeleteMarkers", "Error") + return + } + } + } + if (zb0001Mask & 0x200) == 0 { // if not omitted + // write "usage" + err = en.Append(0xa5, 0x75, 0x73, 0x61, 0x67, 0x65) + if err != nil { + return + } + // check for omitted fields + zb0006Len := uint32(2) + var zb0006Mask uint8 /* 2 bits */ + _ = zb0006Mask + if z.Usage.Error == "" { + zb0006Len-- + zb0006Mask |= 0x2 + } + // variable map header, size zb0006Len + err = en.Append(0x80 | uint8(zb0006Len)) + if err != nil { + return + } + // write "size" + err = en.Append(0xa4, 0x73, 0x69, 0x7a, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.Usage.Size) + if err != nil { + err = msgp.WrapError(err, "Usage", "Size") + return + } + if (zb0006Mask & 0x2) == 0 { // if not omitted + // write "error" + err = en.Append(0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72) + if err != nil { + return + } + err = en.WriteString(z.Usage.Error) + if err != nil { + err = msgp.WrapError(err, "Usage", "Error") + return + } + } + } + // write "services" + err = en.Append(0xa8, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73) + if err != nil { + return + } + err = z.Services.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Services") + return + } + // write "backend" + err = en.Append(0xa7, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64) + if err != nil { + return + } + err = z.Backend.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Backend") + return + } + if (zb0001Mask & 0x1000) == 0 { // if not omitted + // write "servers" + err = en.Append(0xa7, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Servers))) + if err != nil { + err = msgp.WrapError(err, "Servers") + return + } + for za0003 := range z.Servers { + err = z.Servers[za0003].EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Servers", za0003) + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *InfoMessage) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(13) + var zb0001Mask uint16 /* 13 bits */ + _ = zb0001Mask + if z.Mode == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.Domain == nil { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.Region == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.SQSARN == nil { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.DeploymentID == "" { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.Buckets == (Buckets{}) { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.Objects == (Objects{}) { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.Versions == (Versions{}) { + zb0001Len-- + zb0001Mask |= 0x80 + } + if z.DeleteMarkers == (DeleteMarkers{}) { + zb0001Len-- + zb0001Mask |= 0x100 + } + if z.Usage == (Usage{}) { + zb0001Len-- + zb0001Mask |= 0x200 + } + if z.Servers == nil { + zb0001Len-- + zb0001Mask |= 0x1000 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + if (zb0001Mask & 0x1) == 0 { // if not omitted + // string "mode" + o = append(o, 0xa4, 0x6d, 0x6f, 0x64, 0x65) + o = msgp.AppendString(o, z.Mode) + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "domain" + o = append(o, 0xa6, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e) + o = msgp.AppendArrayHeader(o, uint32(len(z.Domain))) + for za0001 := range z.Domain { + o = msgp.AppendString(o, z.Domain[za0001]) + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "region" + o = append(o, 0xa6, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e) + o = msgp.AppendString(o, z.Region) + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // string "sqsARN" + o = append(o, 0xa6, 0x73, 0x71, 0x73, 0x41, 0x52, 0x4e) + o = msgp.AppendArrayHeader(o, uint32(len(z.SQSARN))) + for za0002 := range z.SQSARN { + o = msgp.AppendString(o, z.SQSARN[za0002]) + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // string "deploymentID" + o = append(o, 0xac, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x44) + o = msgp.AppendString(o, z.DeploymentID) + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // string "buckets" + o = append(o, 0xa7, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73) + // check for omitted fields + zb0002Len := uint32(2) + var zb0002Mask uint8 /* 2 bits */ + _ = zb0002Mask + if z.Buckets.Error == "" { + zb0002Len-- + zb0002Mask |= 0x2 + } + // variable map header, size zb0002Len + o = append(o, 0x80|uint8(zb0002Len)) + // string "count" + o = append(o, 0xa5, 0x63, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendUint64(o, z.Buckets.Count) + if (zb0002Mask & 0x2) == 0 { // if not omitted + // string "error" + o = append(o, 0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72) + o = msgp.AppendString(o, z.Buckets.Error) + } + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // string "objects" + o = append(o, 0xa7, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73) + // check for omitted fields + zb0003Len := uint32(2) + var zb0003Mask uint8 /* 2 bits */ + _ = zb0003Mask + if z.Objects.Error == "" { + zb0003Len-- + zb0003Mask |= 0x2 + } + // variable map header, size zb0003Len + o = append(o, 0x80|uint8(zb0003Len)) + // string "count" + o = append(o, 0xa5, 0x63, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendUint64(o, z.Objects.Count) + if (zb0003Mask & 0x2) == 0 { // if not omitted + // string "error" + o = append(o, 0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72) + o = msgp.AppendString(o, z.Objects.Error) + } + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // string "versions" + o = append(o, 0xa8, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73) + // check for omitted fields + zb0004Len := uint32(2) + var zb0004Mask uint8 /* 2 bits */ + _ = zb0004Mask + if z.Versions.Error == "" { + zb0004Len-- + zb0004Mask |= 0x2 + } + // variable map header, size zb0004Len + o = append(o, 0x80|uint8(zb0004Len)) + // string "count" + o = append(o, 0xa5, 0x63, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendUint64(o, z.Versions.Count) + if (zb0004Mask & 0x2) == 0 { // if not omitted + // string "error" + o = append(o, 0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72) + o = msgp.AppendString(o, z.Versions.Error) + } + } + if (zb0001Mask & 0x100) == 0 { // if not omitted + // string "deletemarkers" + o = append(o, 0xad, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x72, 0x73) + // check for omitted fields + zb0005Len := uint32(2) + var zb0005Mask uint8 /* 2 bits */ + _ = zb0005Mask + if z.DeleteMarkers.Error == "" { + zb0005Len-- + zb0005Mask |= 0x2 + } + // variable map header, size zb0005Len + o = append(o, 0x80|uint8(zb0005Len)) + // string "count" + o = append(o, 0xa5, 0x63, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendUint64(o, z.DeleteMarkers.Count) + if (zb0005Mask & 0x2) == 0 { // if not omitted + // string "error" + o = append(o, 0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72) + o = msgp.AppendString(o, z.DeleteMarkers.Error) + } + } + if (zb0001Mask & 0x200) == 0 { // if not omitted + // string "usage" + o = append(o, 0xa5, 0x75, 0x73, 0x61, 0x67, 0x65) + // check for omitted fields + zb0006Len := uint32(2) + var zb0006Mask uint8 /* 2 bits */ + _ = zb0006Mask + if z.Usage.Error == "" { + zb0006Len-- + zb0006Mask |= 0x2 + } + // variable map header, size zb0006Len + o = append(o, 0x80|uint8(zb0006Len)) + // string "size" + o = append(o, 0xa4, 0x73, 0x69, 0x7a, 0x65) + o = msgp.AppendUint64(o, z.Usage.Size) + if (zb0006Mask & 0x2) == 0 { // if not omitted + // string "error" + o = append(o, 0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72) + o = msgp.AppendString(o, z.Usage.Error) + } + } + // string "services" + o = append(o, 0xa8, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73) + o, err = z.Services.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Services") + return + } + // string "backend" + o = append(o, 0xa7, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64) + o, err = z.Backend.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Backend") + return + } + if (zb0001Mask & 0x1000) == 0 { // if not omitted + // string "servers" + o = append(o, 0xa7, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.Servers))) + for za0003 := range z.Servers { + o, err = z.Servers[za0003].MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Servers", za0003) + return + } + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *InfoMessage) 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 uint16 /* 13 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 "mode": + z.Mode, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Mode") + return + } + zb0001Mask |= 0x1 + case "domain": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Domain") + return + } + if cap(z.Domain) >= int(zb0002) { + z.Domain = (z.Domain)[:zb0002] + } else { + z.Domain = make([]string, zb0002) + } + for za0001 := range z.Domain { + z.Domain[za0001], bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Domain", za0001) + return + } + } + zb0001Mask |= 0x2 + case "region": + z.Region, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Region") + return + } + zb0001Mask |= 0x4 + case "sqsARN": + var zb0003 uint32 + zb0003, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "SQSARN") + return + } + if cap(z.SQSARN) >= int(zb0003) { + z.SQSARN = (z.SQSARN)[:zb0003] + } else { + z.SQSARN = make([]string, zb0003) + } + for za0002 := range z.SQSARN { + z.SQSARN[za0002], bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "SQSARN", za0002) + return + } + } + zb0001Mask |= 0x8 + case "deploymentID": + z.DeploymentID, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "DeploymentID") + return + } + zb0001Mask |= 0x10 + case "buckets": + var zb0004 uint32 + zb0004, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Buckets") + return + } + var zb0004Mask uint8 /* 1 bits */ + _ = zb0004Mask + for zb0004 > 0 { + zb0004-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "Buckets") + return + } + switch msgp.UnsafeString(field) { + case "count": + z.Buckets.Count, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Buckets", "Count") + return + } + case "error": + z.Buckets.Error, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Buckets", "Error") + return + } + zb0004Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "Buckets") + return + } + } + } + // Clear omitted fields. + if zb0004Mask != 0x1 { + if (zb0004Mask & 0x1) == 0 { + z.Buckets.Error = "" + } + } + zb0001Mask |= 0x20 + case "objects": + var zb0005 uint32 + zb0005, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Objects") + return + } + var zb0005Mask uint8 /* 1 bits */ + _ = zb0005Mask + for zb0005 > 0 { + zb0005-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "Objects") + return + } + switch msgp.UnsafeString(field) { + case "count": + z.Objects.Count, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Objects", "Count") + return + } + case "error": + z.Objects.Error, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Objects", "Error") + return + } + zb0005Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "Objects") + return + } + } + } + // Clear omitted fields. + if zb0005Mask != 0x1 { + if (zb0005Mask & 0x1) == 0 { + z.Objects.Error = "" + } + } + zb0001Mask |= 0x40 + case "versions": + var zb0006 uint32 + zb0006, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Versions") + return + } + var zb0006Mask uint8 /* 1 bits */ + _ = zb0006Mask + for zb0006 > 0 { + zb0006-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "Versions") + return + } + switch msgp.UnsafeString(field) { + case "count": + z.Versions.Count, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Versions", "Count") + return + } + case "error": + z.Versions.Error, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Versions", "Error") + return + } + zb0006Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "Versions") + return + } + } + } + // Clear omitted fields. + if zb0006Mask != 0x1 { + if (zb0006Mask & 0x1) == 0 { + z.Versions.Error = "" + } + } + zb0001Mask |= 0x80 + case "deletemarkers": + var zb0007 uint32 + zb0007, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "DeleteMarkers") + return + } + var zb0007Mask uint8 /* 1 bits */ + _ = zb0007Mask + for zb0007 > 0 { + zb0007-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "DeleteMarkers") + return + } + switch msgp.UnsafeString(field) { + case "count": + z.DeleteMarkers.Count, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "DeleteMarkers", "Count") + return + } + case "error": + z.DeleteMarkers.Error, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "DeleteMarkers", "Error") + return + } + zb0007Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "DeleteMarkers") + return + } + } + } + // Clear omitted fields. + if zb0007Mask != 0x1 { + if (zb0007Mask & 0x1) == 0 { + z.DeleteMarkers.Error = "" + } + } + zb0001Mask |= 0x100 + case "usage": + var zb0008 uint32 + zb0008, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Usage") + return + } + var zb0008Mask uint8 /* 1 bits */ + _ = zb0008Mask + for zb0008 > 0 { + zb0008-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "Usage") + return + } + switch msgp.UnsafeString(field) { + case "size": + z.Usage.Size, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Usage", "Size") + return + } + case "error": + z.Usage.Error, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Usage", "Error") + return + } + zb0008Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "Usage") + return + } + } + } + // Clear omitted fields. + if zb0008Mask != 0x1 { + if (zb0008Mask & 0x1) == 0 { + z.Usage.Error = "" + } + } + zb0001Mask |= 0x200 + case "services": + bts, err = z.Services.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Services") + return + } + zb0001Mask |= 0x400 + case "backend": + bts, err = z.Backend.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Backend") + return + } + zb0001Mask |= 0x800 + case "servers": + var zb0009 uint32 + zb0009, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Servers") + return + } + if cap(z.Servers) >= int(zb0009) { + z.Servers = (z.Servers)[:zb0009] + } else { + z.Servers = make([]ServerProperties, zb0009) + } + for za0003 := range z.Servers { + bts, err = z.Servers[za0003].UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Servers", za0003) + return + } + } + zb0001Mask |= 0x1000 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1fff { + if (zb0001Mask & 0x1) == 0 { + z.Mode = "" + } + if (zb0001Mask & 0x2) == 0 { + z.Domain = nil + } + if (zb0001Mask & 0x4) == 0 { + z.Region = "" + } + if (zb0001Mask & 0x8) == 0 { + z.SQSARN = nil + } + if (zb0001Mask & 0x10) == 0 { + z.DeploymentID = "" + } + if (zb0001Mask & 0x20) == 0 { + z.Buckets = (Buckets{}) + } + if (zb0001Mask & 0x40) == 0 { + z.Objects = (Objects{}) + } + if (zb0001Mask & 0x80) == 0 { + z.Versions = (Versions{}) + } + if (zb0001Mask & 0x100) == 0 { + z.DeleteMarkers = (DeleteMarkers{}) + } + if (zb0001Mask & 0x200) == 0 { + z.Usage = (Usage{}) + } + if (zb0001Mask & 0x400) == 0 { + z.Services = Services{} + } + if (zb0001Mask & 0x800) == 0 { + z.Backend = ErasureBackend{} + } + if (zb0001Mask & 0x1000) == 0 { + z.Servers = nil + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *InfoMessage) Msgsize() (s int) { + s = 1 + 5 + msgp.StringPrefixSize + len(z.Mode) + 7 + msgp.ArrayHeaderSize + for za0001 := range z.Domain { + s += msgp.StringPrefixSize + len(z.Domain[za0001]) + } + s += 7 + msgp.StringPrefixSize + len(z.Region) + 7 + msgp.ArrayHeaderSize + for za0002 := range z.SQSARN { + s += msgp.StringPrefixSize + len(z.SQSARN[za0002]) + } + s += 13 + msgp.StringPrefixSize + len(z.DeploymentID) + 8 + 1 + 6 + msgp.Uint64Size + 6 + msgp.StringPrefixSize + len(z.Buckets.Error) + 8 + 1 + 6 + msgp.Uint64Size + 6 + msgp.StringPrefixSize + len(z.Objects.Error) + 9 + 1 + 6 + msgp.Uint64Size + 6 + msgp.StringPrefixSize + len(z.Versions.Error) + 14 + 1 + 6 + msgp.Uint64Size + 6 + msgp.StringPrefixSize + len(z.DeleteMarkers.Error) + 6 + 1 + 5 + msgp.Uint64Size + 6 + msgp.StringPrefixSize + len(z.Usage.Error) + 9 + z.Services.Msgsize() + 8 + z.Backend.Msgsize() + 8 + msgp.ArrayHeaderSize + for za0003 := range z.Servers { + s += z.Servers[za0003].Msgsize() + } + return +} + +// DecodeMsg implements msgp.Decodable +func (z *ItemState) DecodeMsg(dc *msgp.Reader) (err error) { + { + var zb0001 string + zb0001, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err) + return + } + (*z) = ItemState(zb0001) + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z ItemState) EncodeMsg(en *msgp.Writer) (err error) { + err = en.WriteString(string(z)) + if err != nil { + err = msgp.WrapError(err) + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z ItemState) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + o = msgp.AppendString(o, string(z)) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *ItemState) UnmarshalMsg(bts []byte) (o []byte, err error) { + { + var zb0001 string + zb0001, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + (*z) = ItemState(zb0001) + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z ItemState) Msgsize() (s int) { + s = msgp.StringPrefixSize + len(string(z)) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *KMS) 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 /* 5 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "status": + z.Status, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Status") + return + } + zb0001Mask |= 0x1 + case "encrypt": + z.Encrypt, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Encrypt") + return + } + zb0001Mask |= 0x2 + case "decrypt": + z.Decrypt, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Decrypt") + return + } + zb0001Mask |= 0x4 + case "endpoint": + z.Endpoint, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Endpoint") + return + } + zb0001Mask |= 0x8 + case "version": + z.Version, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Version") + return + } + zb0001Mask |= 0x10 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1f { + if (zb0001Mask & 0x1) == 0 { + z.Status = "" + } + if (zb0001Mask & 0x2) == 0 { + z.Encrypt = "" + } + if (zb0001Mask & 0x4) == 0 { + z.Decrypt = "" + } + if (zb0001Mask & 0x8) == 0 { + z.Endpoint = "" + } + if (zb0001Mask & 0x10) == 0 { + z.Version = "" + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *KMS) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(5) + var zb0001Mask uint8 /* 5 bits */ + _ = zb0001Mask + if z.Status == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.Encrypt == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.Decrypt == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.Endpoint == "" { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.Version == "" { + zb0001Len-- + zb0001Mask |= 0x10 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + if (zb0001Mask & 0x1) == 0 { // if not omitted + // write "status" + err = en.Append(0xa6, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73) + if err != nil { + return + } + err = en.WriteString(z.Status) + if err != nil { + err = msgp.WrapError(err, "Status") + return + } + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "encrypt" + err = en.Append(0xa7, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74) + if err != nil { + return + } + err = en.WriteString(z.Encrypt) + if err != nil { + err = msgp.WrapError(err, "Encrypt") + return + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "decrypt" + err = en.Append(0xa7, 0x64, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74) + if err != nil { + return + } + err = en.WriteString(z.Decrypt) + if err != nil { + err = msgp.WrapError(err, "Decrypt") + return + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // write "endpoint" + err = en.Append(0xa8, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteString(z.Endpoint) + if err != nil { + err = msgp.WrapError(err, "Endpoint") + return + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // 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 + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *KMS) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(5) + var zb0001Mask uint8 /* 5 bits */ + _ = zb0001Mask + if z.Status == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.Encrypt == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.Decrypt == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.Endpoint == "" { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.Version == "" { + zb0001Len-- + zb0001Mask |= 0x10 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + if (zb0001Mask & 0x1) == 0 { // if not omitted + // string "status" + o = append(o, 0xa6, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73) + o = msgp.AppendString(o, z.Status) + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "encrypt" + o = append(o, 0xa7, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74) + o = msgp.AppendString(o, z.Encrypt) + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "decrypt" + o = append(o, 0xa7, 0x64, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74) + o = msgp.AppendString(o, z.Decrypt) + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // string "endpoint" + o = append(o, 0xa8, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74) + o = msgp.AppendString(o, z.Endpoint) + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // string "version" + o = append(o, 0xa7, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e) + o = msgp.AppendString(o, z.Version) + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *KMS) 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 /* 5 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 "status": + z.Status, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Status") + return + } + zb0001Mask |= 0x1 + case "encrypt": + z.Encrypt, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Encrypt") + return + } + zb0001Mask |= 0x2 + case "decrypt": + z.Decrypt, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Decrypt") + return + } + zb0001Mask |= 0x4 + case "endpoint": + z.Endpoint, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Endpoint") + return + } + zb0001Mask |= 0x8 + case "version": + z.Version, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Version") + return + } + zb0001Mask |= 0x10 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1f { + if (zb0001Mask & 0x1) == 0 { + z.Status = "" + } + if (zb0001Mask & 0x2) == 0 { + z.Encrypt = "" + } + if (zb0001Mask & 0x4) == 0 { + z.Decrypt = "" + } + if (zb0001Mask & 0x8) == 0 { + z.Endpoint = "" + } + if (zb0001Mask & 0x10) == 0 { + z.Version = "" + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *KMS) Msgsize() (s int) { + s = 1 + 7 + msgp.StringPrefixSize + len(z.Status) + 8 + msgp.StringPrefixSize + len(z.Encrypt) + 8 + msgp.StringPrefixSize + len(z.Decrypt) + 9 + msgp.StringPrefixSize + len(z.Endpoint) + 8 + msgp.StringPrefixSize + len(z.Version) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *LDAP) 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 /* 1 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "status": + z.Status, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Status") + return + } + zb0001Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1 { + if (zb0001Mask & 0x1) == 0 { + z.Status = "" + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z LDAP) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(1) + var zb0001Mask uint8 /* 1 bits */ + _ = zb0001Mask + if z.Status == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + if (zb0001Mask & 0x1) == 0 { // if not omitted + // write "status" + err = en.Append(0xa6, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73) + if err != nil { + return + } + err = en.WriteString(z.Status) + if err != nil { + err = msgp.WrapError(err, "Status") + return + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z LDAP) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(1) + var zb0001Mask uint8 /* 1 bits */ + _ = zb0001Mask + if z.Status == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + if (zb0001Mask & 0x1) == 0 { // if not omitted + // string "status" + o = append(o, 0xa6, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73) + o = msgp.AppendString(o, z.Status) + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *LDAP) 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 /* 1 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 "status": + z.Status, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Status") + return + } + zb0001Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1 { + if (zb0001Mask & 0x1) == 0 { + z.Status = "" + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z LDAP) Msgsize() (s int) { + s = 1 + 7 + msgp.StringPrefixSize + len(z.Status) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *Logger) DecodeMsg(dc *msgp.Reader) (err error) { + var zb0003 uint32 + zb0003, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err) + return + } + if (*z) == nil { + (*z) = make(Logger, zb0003) + } else if len((*z)) > 0 { + for key := range *z { + delete((*z), key) + } + } + var field []byte + _ = field + for zb0003 > 0 { + zb0003-- + var zb0001 string + var zb0002 Status + zb0001, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0004 uint32 + zb0004, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, zb0001) + return + } + var zb0004Mask uint8 /* 1 bits */ + _ = zb0004Mask + for zb0004 > 0 { + zb0004-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, zb0001) + return + } + switch msgp.UnsafeString(field) { + case "status": + zb0002.Status, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, zb0001, "Status") + return + } + zb0004Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, zb0001) + return + } + } + } + // Clear omitted fields. + if zb0004Mask != 0x1 { + if (zb0004Mask & 0x1) == 0 { + zb0002.Status = "" + } + } + (*z)[zb0001] = zb0002 + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z Logger) EncodeMsg(en *msgp.Writer) (err error) { + err = en.WriteMapHeader(uint32(len(z))) + if err != nil { + err = msgp.WrapError(err) + return + } + for zb0005, zb0006 := range z { + err = en.WriteString(zb0005) + if err != nil { + err = msgp.WrapError(err) + return + } + // check for omitted fields + zb0001Len := uint32(1) + var zb0001Mask uint8 /* 1 bits */ + _ = zb0001Mask + if zb0006.Status == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + if (zb0001Mask & 0x1) == 0 { // if not omitted + // write "status" + err = en.Append(0xa6, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73) + if err != nil { + return + } + err = en.WriteString(zb0006.Status) + if err != nil { + err = msgp.WrapError(err, zb0005, "Status") + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z Logger) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + o = msgp.AppendMapHeader(o, uint32(len(z))) + for zb0005, zb0006 := range z { + o = msgp.AppendString(o, zb0005) + // check for omitted fields + zb0001Len := uint32(1) + var zb0001Mask uint8 /* 1 bits */ + _ = zb0001Mask + if zb0006.Status == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + if (zb0001Mask & 0x1) == 0 { // if not omitted + // string "status" + o = append(o, 0xa6, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73) + o = msgp.AppendString(o, zb0006.Status) + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *Logger) UnmarshalMsg(bts []byte) (o []byte, err error) { + var zb0003 uint32 + zb0003, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + if (*z) == nil { + (*z) = make(Logger, zb0003) + } else if len((*z)) > 0 { + for key := range *z { + delete((*z), key) + } + } + var field []byte + _ = field + for zb0003 > 0 { + var zb0001 string + var zb0002 Status + zb0003-- + zb0001, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0004 uint32 + zb0004, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, zb0001) + return + } + var zb0004Mask uint8 /* 1 bits */ + _ = zb0004Mask + for zb0004 > 0 { + zb0004-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, zb0001) + return + } + switch msgp.UnsafeString(field) { + case "status": + zb0002.Status, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, zb0001, "Status") + return + } + zb0004Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, zb0001) + return + } + } + } + // Clear omitted fields. + if zb0004Mask != 0x1 { + if (zb0004Mask & 0x1) == 0 { + zb0002.Status = "" + } + } + (*z)[zb0001] = zb0002 + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z Logger) Msgsize() (s int) { + s = msgp.MapHeaderSize + if z != nil { + for zb0005, zb0006 := range z { + _ = zb0006 + s += msgp.StringPrefixSize + len(zb0005) + 1 + 7 + msgp.StringPrefixSize + len(zb0006.Status) + } + } + return +} + +// DecodeMsg implements msgp.Decodable +func (z *MemStats) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "Alloc": + z.Alloc, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "Alloc") + return + } + case "TotalAlloc": + z.TotalAlloc, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "TotalAlloc") + return + } + case "Mallocs": + z.Mallocs, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "Mallocs") + return + } + case "Frees": + z.Frees, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "Frees") + return + } + case "HeapAlloc": + z.HeapAlloc, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "HeapAlloc") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *MemStats) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 5 + // write "Alloc" + err = en.Append(0x85, 0xa5, 0x41, 0x6c, 0x6c, 0x6f, 0x63) + if err != nil { + return + } + err = en.WriteUint64(z.Alloc) + if err != nil { + err = msgp.WrapError(err, "Alloc") + return + } + // write "TotalAlloc" + err = en.Append(0xaa, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x41, 0x6c, 0x6c, 0x6f, 0x63) + if err != nil { + return + } + err = en.WriteUint64(z.TotalAlloc) + if err != nil { + err = msgp.WrapError(err, "TotalAlloc") + return + } + // write "Mallocs" + err = en.Append(0xa7, 0x4d, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.Mallocs) + if err != nil { + err = msgp.WrapError(err, "Mallocs") + return + } + // write "Frees" + err = en.Append(0xa5, 0x46, 0x72, 0x65, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.Frees) + if err != nil { + err = msgp.WrapError(err, "Frees") + return + } + // write "HeapAlloc" + err = en.Append(0xa9, 0x48, 0x65, 0x61, 0x70, 0x41, 0x6c, 0x6c, 0x6f, 0x63) + if err != nil { + return + } + err = en.WriteUint64(z.HeapAlloc) + if err != nil { + err = msgp.WrapError(err, "HeapAlloc") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *MemStats) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 5 + // string "Alloc" + o = append(o, 0x85, 0xa5, 0x41, 0x6c, 0x6c, 0x6f, 0x63) + o = msgp.AppendUint64(o, z.Alloc) + // string "TotalAlloc" + o = append(o, 0xaa, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x41, 0x6c, 0x6c, 0x6f, 0x63) + o = msgp.AppendUint64(o, z.TotalAlloc) + // string "Mallocs" + o = append(o, 0xa7, 0x4d, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x73) + o = msgp.AppendUint64(o, z.Mallocs) + // string "Frees" + o = append(o, 0xa5, 0x46, 0x72, 0x65, 0x65, 0x73) + o = msgp.AppendUint64(o, z.Frees) + // string "HeapAlloc" + o = append(o, 0xa9, 0x48, 0x65, 0x61, 0x70, 0x41, 0x6c, 0x6c, 0x6f, 0x63) + o = msgp.AppendUint64(o, z.HeapAlloc) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *MemStats) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "Alloc": + z.Alloc, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Alloc") + return + } + case "TotalAlloc": + z.TotalAlloc, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "TotalAlloc") + return + } + case "Mallocs": + z.Mallocs, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Mallocs") + return + } + case "Frees": + z.Frees, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Frees") + return + } + case "HeapAlloc": + z.HeapAlloc, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "HeapAlloc") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *MemStats) Msgsize() (s int) { + s = 1 + 6 + msgp.Uint64Size + 11 + msgp.Uint64Size + 8 + msgp.Uint64Size + 6 + msgp.Uint64Size + 10 + msgp.Uint64Size + return +} + +// DecodeMsg implements msgp.Decodable +func (z *Objects) 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 /* 1 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "count": + z.Count, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "Count") + return + } + case "error": + z.Error, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Error") + return + } + zb0001Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1 { + if (zb0001Mask & 0x1) == 0 { + z.Error = "" + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z Objects) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(2) + var zb0001Mask uint8 /* 2 bits */ + _ = zb0001Mask + if z.Error == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + // write "count" + err = en.Append(0xa5, 0x63, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteUint64(z.Count) + if err != nil { + err = msgp.WrapError(err, "Count") + return + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "error" + err = en.Append(0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72) + if err != nil { + return + } + err = en.WriteString(z.Error) + if err != nil { + err = msgp.WrapError(err, "Error") + return + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z Objects) 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.Error == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + // string "count" + o = append(o, 0xa5, 0x63, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendUint64(o, z.Count) + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "error" + o = append(o, 0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72) + o = msgp.AppendString(o, z.Error) + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *Objects) 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 /* 1 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 "count": + z.Count, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Count") + return + } + case "error": + z.Error, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Error") + return + } + zb0001Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1 { + if (zb0001Mask & 0x1) == 0 { + z.Error = "" + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z Objects) Msgsize() (s int) { + s = 1 + 6 + msgp.Uint64Size + 6 + msgp.StringPrefixSize + len(z.Error) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *ServerInfoOpts) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "Metrics": + z.Metrics, err = dc.ReadBool() + if err != nil { + err = msgp.WrapError(err, "Metrics") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z ServerInfoOpts) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 1 + // write "Metrics" + err = en.Append(0x81, 0xa7, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73) + if err != nil { + return + } + err = en.WriteBool(z.Metrics) + if err != nil { + err = msgp.WrapError(err, "Metrics") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z ServerInfoOpts) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 1 + // string "Metrics" + o = append(o, 0x81, 0xa7, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73) + o = msgp.AppendBool(o, z.Metrics) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *ServerInfoOpts) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "Metrics": + z.Metrics, bts, err = msgp.ReadBoolBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Metrics") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z ServerInfoOpts) Msgsize() (s int) { + s = 1 + 8 + msgp.BoolSize + return +} + +// DecodeMsg implements msgp.Decodable +func (z *ServerProperties) 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 uint16 /* 15 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "state": + z.State, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "State") + return + } + zb0001Mask |= 0x1 + case "endpoint": + z.Endpoint, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Endpoint") + return + } + zb0001Mask |= 0x2 + case "scheme": + z.Scheme, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Scheme") + return + } + zb0001Mask |= 0x4 + case "uptime": + z.Uptime, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "Uptime") + return + } + zb0001Mask |= 0x8 + case "version": + z.Version, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Version") + return + } + zb0001Mask |= 0x10 + case "commitID": + z.CommitID, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "CommitID") + return + } + zb0001Mask |= 0x20 + case "network": + var zb0002 uint32 + zb0002, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "Network") + return + } + if z.Network == nil { + z.Network = make(map[string]string, zb0002) + } else if len(z.Network) > 0 { + for key := range z.Network { + delete(z.Network, key) + } + } + for zb0002 > 0 { + zb0002-- + var za0001 string + var za0002 string + za0001, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Network") + return + } + za0002, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Network", za0001) + return + } + z.Network[za0001] = za0002 + } + zb0001Mask |= 0x40 + case "drives": + var zb0003 uint32 + zb0003, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "Disks") + return + } + if cap(z.Disks) >= int(zb0003) { + z.Disks = (z.Disks)[:zb0003] + } else { + z.Disks = make([]Disk, zb0003) + } + for za0003 := range z.Disks { + err = z.Disks[za0003].DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Disks", za0003) + return + } + } + zb0001Mask |= 0x80 + case "poolNumber": + z.PoolNumber, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "PoolNumber") + return + } + zb0001Mask |= 0x100 + case "poolNumbers": + var zb0004 uint32 + zb0004, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "PoolNumbers") + return + } + if cap(z.PoolNumbers) >= int(zb0004) { + z.PoolNumbers = (z.PoolNumbers)[:zb0004] + } else { + z.PoolNumbers = make([]int, zb0004) + } + for za0004 := range z.PoolNumbers { + z.PoolNumbers[za0004], err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "PoolNumbers", za0004) + return + } + } + zb0001Mask |= 0x200 + case "mem_stats": + err = z.MemStats.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "MemStats") + return + } + case "go_max_procs": + z.GoMaxProcs, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "GoMaxProcs") + return + } + zb0001Mask |= 0x400 + case "num_cpu": + z.NumCPU, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "NumCPU") + return + } + zb0001Mask |= 0x800 + case "runtime_version": + z.RuntimeVersion, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "RuntimeVersion") + return + } + zb0001Mask |= 0x1000 + case "gc_stats": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "GCStats") + return + } + z.GCStats = nil + } else { + if z.GCStats == nil { + z.GCStats = new(GCStats) + } + err = z.GCStats.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "GCStats") + return + } + } + zb0001Mask |= 0x2000 + case "minio_env_vars": + var zb0005 uint32 + zb0005, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "MinioEnvVars") + return + } + if z.MinioEnvVars == nil { + z.MinioEnvVars = make(map[string]string, zb0005) + } else if len(z.MinioEnvVars) > 0 { + for key := range z.MinioEnvVars { + delete(z.MinioEnvVars, key) + } + } + for zb0005 > 0 { + zb0005-- + var za0005 string + var za0006 string + za0005, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "MinioEnvVars") + return + } + za0006, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "MinioEnvVars", za0005) + return + } + z.MinioEnvVars[za0005] = za0006 + } + zb0001Mask |= 0x4000 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x7fff { + if (zb0001Mask & 0x1) == 0 { + z.State = "" + } + if (zb0001Mask & 0x2) == 0 { + z.Endpoint = "" + } + if (zb0001Mask & 0x4) == 0 { + z.Scheme = "" + } + if (zb0001Mask & 0x8) == 0 { + z.Uptime = 0 + } + if (zb0001Mask & 0x10) == 0 { + z.Version = "" + } + if (zb0001Mask & 0x20) == 0 { + z.CommitID = "" + } + if (zb0001Mask & 0x40) == 0 { + z.Network = nil + } + if (zb0001Mask & 0x80) == 0 { + z.Disks = nil + } + if (zb0001Mask & 0x100) == 0 { + z.PoolNumber = 0 + } + if (zb0001Mask & 0x200) == 0 { + z.PoolNumbers = nil + } + if (zb0001Mask & 0x400) == 0 { + z.GoMaxProcs = 0 + } + if (zb0001Mask & 0x800) == 0 { + z.NumCPU = 0 + } + if (zb0001Mask & 0x1000) == 0 { + z.RuntimeVersion = "" + } + if (zb0001Mask & 0x2000) == 0 { + z.GCStats = nil + } + if (zb0001Mask & 0x4000) == 0 { + z.MinioEnvVars = nil + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *ServerProperties) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(16) + var zb0001Mask uint16 /* 16 bits */ + _ = zb0001Mask + if z.State == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.Endpoint == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.Scheme == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.Uptime == 0 { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.Version == "" { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.CommitID == "" { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.Network == nil { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.Disks == nil { + zb0001Len-- + zb0001Mask |= 0x80 + } + if z.PoolNumber == 0 { + zb0001Len-- + zb0001Mask |= 0x100 + } + if z.PoolNumbers == nil { + zb0001Len-- + zb0001Mask |= 0x200 + } + if z.GoMaxProcs == 0 { + zb0001Len-- + zb0001Mask |= 0x800 + } + if z.NumCPU == 0 { + zb0001Len-- + zb0001Mask |= 0x1000 + } + if z.RuntimeVersion == "" { + zb0001Len-- + zb0001Mask |= 0x2000 + } + if z.GCStats == nil { + zb0001Len-- + zb0001Mask |= 0x4000 + } + if z.MinioEnvVars == nil { + zb0001Len-- + zb0001Mask |= 0x8000 + } + // variable map header, size zb0001Len + err = en.WriteMapHeader(zb0001Len) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + if (zb0001Mask & 0x1) == 0 { // if not omitted + // write "state" + err = en.Append(0xa5, 0x73, 0x74, 0x61, 0x74, 0x65) + if err != nil { + return + } + err = en.WriteString(z.State) + if err != nil { + err = msgp.WrapError(err, "State") + return + } + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "endpoint" + err = en.Append(0xa8, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteString(z.Endpoint) + if err != nil { + err = msgp.WrapError(err, "Endpoint") + return + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "scheme" + err = en.Append(0xa6, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteString(z.Scheme) + if err != nil { + err = msgp.WrapError(err, "Scheme") + return + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // write "uptime" + err = en.Append(0xa6, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteInt64(z.Uptime) + if err != nil { + err = msgp.WrapError(err, "Uptime") + return + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // 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 + } + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // write "commitID" + err = en.Append(0xa8, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x44) + if err != nil { + return + } + err = en.WriteString(z.CommitID) + if err != nil { + err = msgp.WrapError(err, "CommitID") + return + } + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // write "network" + err = en.Append(0xa7, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.Network))) + if err != nil { + err = msgp.WrapError(err, "Network") + return + } + for za0001, za0002 := range z.Network { + err = en.WriteString(za0001) + if err != nil { + err = msgp.WrapError(err, "Network") + return + } + err = en.WriteString(za0002) + if err != nil { + err = msgp.WrapError(err, "Network", za0001) + return + } + } + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // write "drives" + err = en.Append(0xa6, 0x64, 0x72, 0x69, 0x76, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Disks))) + if err != nil { + err = msgp.WrapError(err, "Disks") + return + } + for za0003 := range z.Disks { + err = z.Disks[za0003].EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Disks", za0003) + return + } + } + } + if (zb0001Mask & 0x100) == 0 { // if not omitted + // write "poolNumber" + err = en.Append(0xaa, 0x70, 0x6f, 0x6f, 0x6c, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72) + if err != nil { + return + } + err = en.WriteInt(z.PoolNumber) + if err != nil { + err = msgp.WrapError(err, "PoolNumber") + return + } + } + if (zb0001Mask & 0x200) == 0 { // if not omitted + // write "poolNumbers" + err = en.Append(0xab, 0x70, 0x6f, 0x6f, 0x6c, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.PoolNumbers))) + if err != nil { + err = msgp.WrapError(err, "PoolNumbers") + return + } + for za0004 := range z.PoolNumbers { + err = en.WriteInt(z.PoolNumbers[za0004]) + if err != nil { + err = msgp.WrapError(err, "PoolNumbers", za0004) + return + } + } + } + // write "mem_stats" + err = en.Append(0xa9, 0x6d, 0x65, 0x6d, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73) + if err != nil { + return + } + err = z.MemStats.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "MemStats") + return + } + if (zb0001Mask & 0x800) == 0 { // if not omitted + // write "go_max_procs" + err = en.Append(0xac, 0x67, 0x6f, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x73) + if err != nil { + return + } + err = en.WriteInt(z.GoMaxProcs) + if err != nil { + err = msgp.WrapError(err, "GoMaxProcs") + return + } + } + if (zb0001Mask & 0x1000) == 0 { // if not omitted + // write "num_cpu" + err = en.Append(0xa7, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x70, 0x75) + if err != nil { + return + } + err = en.WriteInt(z.NumCPU) + if err != nil { + err = msgp.WrapError(err, "NumCPU") + return + } + } + if (zb0001Mask & 0x2000) == 0 { // if not omitted + // write "runtime_version" + err = en.Append(0xaf, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e) + if err != nil { + return + } + err = en.WriteString(z.RuntimeVersion) + if err != nil { + err = msgp.WrapError(err, "RuntimeVersion") + return + } + } + if (zb0001Mask & 0x4000) == 0 { // if not omitted + // write "gc_stats" + err = en.Append(0xa8, 0x67, 0x63, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73) + if err != nil { + return + } + if z.GCStats == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.GCStats.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "GCStats") + return + } + } + } + if (zb0001Mask & 0x8000) == 0 { // if not omitted + // write "minio_env_vars" + err = en.Append(0xae, 0x6d, 0x69, 0x6e, 0x69, 0x6f, 0x5f, 0x65, 0x6e, 0x76, 0x5f, 0x76, 0x61, 0x72, 0x73) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.MinioEnvVars))) + if err != nil { + err = msgp.WrapError(err, "MinioEnvVars") + return + } + for za0005, za0006 := range z.MinioEnvVars { + err = en.WriteString(za0005) + if err != nil { + err = msgp.WrapError(err, "MinioEnvVars") + return + } + err = en.WriteString(za0006) + if err != nil { + err = msgp.WrapError(err, "MinioEnvVars", za0005) + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *ServerProperties) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(16) + var zb0001Mask uint16 /* 16 bits */ + _ = zb0001Mask + if z.State == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.Endpoint == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.Scheme == "" { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.Uptime == 0 { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.Version == "" { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.CommitID == "" { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.Network == nil { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.Disks == nil { + zb0001Len-- + zb0001Mask |= 0x80 + } + if z.PoolNumber == 0 { + zb0001Len-- + zb0001Mask |= 0x100 + } + if z.PoolNumbers == nil { + zb0001Len-- + zb0001Mask |= 0x200 + } + if z.GoMaxProcs == 0 { + zb0001Len-- + zb0001Mask |= 0x800 + } + if z.NumCPU == 0 { + zb0001Len-- + zb0001Mask |= 0x1000 + } + if z.RuntimeVersion == "" { + zb0001Len-- + zb0001Mask |= 0x2000 + } + if z.GCStats == nil { + zb0001Len-- + zb0001Mask |= 0x4000 + } + if z.MinioEnvVars == nil { + zb0001Len-- + zb0001Mask |= 0x8000 + } + // variable map header, size zb0001Len + o = msgp.AppendMapHeader(o, zb0001Len) + if zb0001Len == 0 { + return + } + if (zb0001Mask & 0x1) == 0 { // if not omitted + // string "state" + o = append(o, 0xa5, 0x73, 0x74, 0x61, 0x74, 0x65) + o = msgp.AppendString(o, z.State) + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "endpoint" + o = append(o, 0xa8, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74) + o = msgp.AppendString(o, z.Endpoint) + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "scheme" + o = append(o, 0xa6, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65) + o = msgp.AppendString(o, z.Scheme) + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // string "uptime" + o = append(o, 0xa6, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65) + o = msgp.AppendInt64(o, z.Uptime) + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // string "version" + o = append(o, 0xa7, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e) + o = msgp.AppendString(o, z.Version) + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // string "commitID" + o = append(o, 0xa8, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x44) + o = msgp.AppendString(o, z.CommitID) + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // string "network" + o = append(o, 0xa7, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b) + o = msgp.AppendMapHeader(o, uint32(len(z.Network))) + for za0001, za0002 := range z.Network { + o = msgp.AppendString(o, za0001) + o = msgp.AppendString(o, za0002) + } + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // string "drives" + o = append(o, 0xa6, 0x64, 0x72, 0x69, 0x76, 0x65, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.Disks))) + for za0003 := range z.Disks { + o, err = z.Disks[za0003].MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Disks", za0003) + return + } + } + } + if (zb0001Mask & 0x100) == 0 { // if not omitted + // string "poolNumber" + o = append(o, 0xaa, 0x70, 0x6f, 0x6f, 0x6c, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72) + o = msgp.AppendInt(o, z.PoolNumber) + } + if (zb0001Mask & 0x200) == 0 { // if not omitted + // string "poolNumbers" + o = append(o, 0xab, 0x70, 0x6f, 0x6f, 0x6c, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.PoolNumbers))) + for za0004 := range z.PoolNumbers { + o = msgp.AppendInt(o, z.PoolNumbers[za0004]) + } + } + // string "mem_stats" + o = append(o, 0xa9, 0x6d, 0x65, 0x6d, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73) + o, err = z.MemStats.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "MemStats") + return + } + if (zb0001Mask & 0x800) == 0 { // if not omitted + // string "go_max_procs" + o = append(o, 0xac, 0x67, 0x6f, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x73) + o = msgp.AppendInt(o, z.GoMaxProcs) + } + if (zb0001Mask & 0x1000) == 0 { // if not omitted + // string "num_cpu" + o = append(o, 0xa7, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x70, 0x75) + o = msgp.AppendInt(o, z.NumCPU) + } + if (zb0001Mask & 0x2000) == 0 { // if not omitted + // string "runtime_version" + o = append(o, 0xaf, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e) + o = msgp.AppendString(o, z.RuntimeVersion) + } + if (zb0001Mask & 0x4000) == 0 { // if not omitted + // string "gc_stats" + o = append(o, 0xa8, 0x67, 0x63, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73) + if z.GCStats == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.GCStats.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "GCStats") + return + } + } + } + if (zb0001Mask & 0x8000) == 0 { // if not omitted + // string "minio_env_vars" + o = append(o, 0xae, 0x6d, 0x69, 0x6e, 0x69, 0x6f, 0x5f, 0x65, 0x6e, 0x76, 0x5f, 0x76, 0x61, 0x72, 0x73) + o = msgp.AppendMapHeader(o, uint32(len(z.MinioEnvVars))) + for za0005, za0006 := range z.MinioEnvVars { + o = msgp.AppendString(o, za0005) + o = msgp.AppendString(o, za0006) + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *ServerProperties) 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 uint16 /* 15 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 "state": + z.State, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "State") + return + } + zb0001Mask |= 0x1 + case "endpoint": + z.Endpoint, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Endpoint") + return + } + zb0001Mask |= 0x2 + case "scheme": + z.Scheme, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Scheme") + return + } + zb0001Mask |= 0x4 + case "uptime": + z.Uptime, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Uptime") + return + } + zb0001Mask |= 0x8 + case "version": + z.Version, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Version") + return + } + zb0001Mask |= 0x10 + case "commitID": + z.CommitID, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "CommitID") + return + } + zb0001Mask |= 0x20 + case "network": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Network") + return + } + if z.Network == nil { + z.Network = make(map[string]string, zb0002) + } else if len(z.Network) > 0 { + for key := range z.Network { + delete(z.Network, key) + } + } + for zb0002 > 0 { + var za0001 string + var za0002 string + zb0002-- + za0001, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Network") + return + } + za0002, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Network", za0001) + return + } + z.Network[za0001] = za0002 + } + zb0001Mask |= 0x40 + case "drives": + var zb0003 uint32 + zb0003, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Disks") + return + } + if cap(z.Disks) >= int(zb0003) { + z.Disks = (z.Disks)[:zb0003] + } else { + z.Disks = make([]Disk, zb0003) + } + for za0003 := range z.Disks { + bts, err = z.Disks[za0003].UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Disks", za0003) + return + } + } + zb0001Mask |= 0x80 + case "poolNumber": + z.PoolNumber, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "PoolNumber") + return + } + zb0001Mask |= 0x100 + case "poolNumbers": + var zb0004 uint32 + zb0004, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "PoolNumbers") + return + } + if cap(z.PoolNumbers) >= int(zb0004) { + z.PoolNumbers = (z.PoolNumbers)[:zb0004] + } else { + z.PoolNumbers = make([]int, zb0004) + } + for za0004 := range z.PoolNumbers { + z.PoolNumbers[za0004], bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "PoolNumbers", za0004) + return + } + } + zb0001Mask |= 0x200 + case "mem_stats": + bts, err = z.MemStats.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "MemStats") + return + } + case "go_max_procs": + z.GoMaxProcs, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "GoMaxProcs") + return + } + zb0001Mask |= 0x400 + case "num_cpu": + z.NumCPU, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "NumCPU") + return + } + zb0001Mask |= 0x800 + case "runtime_version": + z.RuntimeVersion, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "RuntimeVersion") + return + } + zb0001Mask |= 0x1000 + case "gc_stats": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.GCStats = nil + } else { + if z.GCStats == nil { + z.GCStats = new(GCStats) + } + bts, err = z.GCStats.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "GCStats") + return + } + } + zb0001Mask |= 0x2000 + case "minio_env_vars": + var zb0005 uint32 + zb0005, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "MinioEnvVars") + return + } + if z.MinioEnvVars == nil { + z.MinioEnvVars = make(map[string]string, zb0005) + } else if len(z.MinioEnvVars) > 0 { + for key := range z.MinioEnvVars { + delete(z.MinioEnvVars, key) + } + } + for zb0005 > 0 { + var za0005 string + var za0006 string + zb0005-- + za0005, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "MinioEnvVars") + return + } + za0006, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "MinioEnvVars", za0005) + return + } + z.MinioEnvVars[za0005] = za0006 + } + zb0001Mask |= 0x4000 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x7fff { + if (zb0001Mask & 0x1) == 0 { + z.State = "" + } + if (zb0001Mask & 0x2) == 0 { + z.Endpoint = "" + } + if (zb0001Mask & 0x4) == 0 { + z.Scheme = "" + } + if (zb0001Mask & 0x8) == 0 { + z.Uptime = 0 + } + if (zb0001Mask & 0x10) == 0 { + z.Version = "" + } + if (zb0001Mask & 0x20) == 0 { + z.CommitID = "" + } + if (zb0001Mask & 0x40) == 0 { + z.Network = nil + } + if (zb0001Mask & 0x80) == 0 { + z.Disks = nil + } + if (zb0001Mask & 0x100) == 0 { + z.PoolNumber = 0 + } + if (zb0001Mask & 0x200) == 0 { + z.PoolNumbers = nil + } + if (zb0001Mask & 0x400) == 0 { + z.GoMaxProcs = 0 + } + if (zb0001Mask & 0x800) == 0 { + z.NumCPU = 0 + } + if (zb0001Mask & 0x1000) == 0 { + z.RuntimeVersion = "" + } + if (zb0001Mask & 0x2000) == 0 { + z.GCStats = nil + } + if (zb0001Mask & 0x4000) == 0 { + z.MinioEnvVars = nil + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *ServerProperties) Msgsize() (s int) { + s = 3 + 6 + msgp.StringPrefixSize + len(z.State) + 9 + msgp.StringPrefixSize + len(z.Endpoint) + 7 + msgp.StringPrefixSize + len(z.Scheme) + 7 + msgp.Int64Size + 8 + msgp.StringPrefixSize + len(z.Version) + 9 + msgp.StringPrefixSize + len(z.CommitID) + 8 + msgp.MapHeaderSize + if z.Network != nil { + for za0001, za0002 := range z.Network { + _ = za0002 + s += msgp.StringPrefixSize + len(za0001) + msgp.StringPrefixSize + len(za0002) + } + } + s += 7 + msgp.ArrayHeaderSize + for za0003 := range z.Disks { + s += z.Disks[za0003].Msgsize() + } + s += 11 + msgp.IntSize + 12 + msgp.ArrayHeaderSize + (len(z.PoolNumbers) * (msgp.IntSize)) + 10 + z.MemStats.Msgsize() + 13 + msgp.IntSize + 8 + msgp.IntSize + 16 + msgp.StringPrefixSize + len(z.RuntimeVersion) + 9 + if z.GCStats == nil { + s += msgp.NilSize + } else { + s += z.GCStats.Msgsize() + } + s += 15 + msgp.MapHeaderSize + if z.MinioEnvVars != nil { + for za0005, za0006 := range z.MinioEnvVars { + _ = za0006 + s += msgp.StringPrefixSize + len(za0005) + msgp.StringPrefixSize + len(za0006) + } + } + return +} + +// DecodeMsg implements msgp.Decodable +func (z *Services) 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 /* 6 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "kms": + err = z.KMS.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "KMS") + return + } + zb0001Mask |= 0x1 + case "kmsStatus": + var zb0002 uint32 + zb0002, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "KMSStatus") + return + } + if cap(z.KMSStatus) >= int(zb0002) { + z.KMSStatus = (z.KMSStatus)[:zb0002] + } else { + z.KMSStatus = make([]KMS, zb0002) + } + for za0001 := range z.KMSStatus { + err = z.KMSStatus[za0001].DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "KMSStatus", za0001) + return + } + } + zb0001Mask |= 0x2 + case "ldap": + var zb0003 uint32 + zb0003, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "LDAP") + return + } + var zb0003Mask uint8 /* 1 bits */ + _ = zb0003Mask + for zb0003 > 0 { + zb0003-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, "LDAP") + return + } + switch msgp.UnsafeString(field) { + case "status": + z.LDAP.Status, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "LDAP", "Status") + return + } + zb0003Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, "LDAP") + return + } + } + } + // Clear omitted fields. + if zb0003Mask != 0x1 { + if (zb0003Mask & 0x1) == 0 { + z.LDAP.Status = "" + } + } + zb0001Mask |= 0x4 + case "logger": + var zb0004 uint32 + zb0004, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "Logger") + return + } + if cap(z.Logger) >= int(zb0004) { + z.Logger = (z.Logger)[:zb0004] + } else { + z.Logger = make([]Logger, zb0004) + } + for za0002 := range z.Logger { + var zb0005 uint32 + zb0005, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "Logger", za0002) + return + } + if z.Logger[za0002] == nil { + z.Logger[za0002] = make(Logger, zb0005) + } else if len(z.Logger[za0002]) > 0 { + for key := range z.Logger[za0002] { + delete(z.Logger[za0002], key) + } + } + for zb0005 > 0 { + zb0005-- + var za0003 string + var za0004 Status + za0003, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Logger", za0002) + return + } + var zb0006 uint32 + zb0006, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "Logger", za0002, za0003) + return + } + var zb0006Mask uint8 /* 1 bits */ + _ = zb0006Mask + for zb0006 > 0 { + zb0006-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, "Logger", za0002, za0003) + return + } + switch msgp.UnsafeString(field) { + case "status": + za0004.Status, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Logger", za0002, za0003, "Status") + return + } + zb0006Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, "Logger", za0002, za0003) + return + } + } + } + // Clear omitted fields. + if zb0006Mask != 0x1 { + if (zb0006Mask & 0x1) == 0 { + za0004.Status = "" + } + } + z.Logger[za0002][za0003] = za0004 + } + } + zb0001Mask |= 0x8 + case "audit": + var zb0007 uint32 + zb0007, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "Audit") + return + } + if cap(z.Audit) >= int(zb0007) { + z.Audit = (z.Audit)[:zb0007] + } else { + z.Audit = make([]Audit, zb0007) + } + for za0005 := range z.Audit { + var zb0008 uint32 + zb0008, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "Audit", za0005) + return + } + if z.Audit[za0005] == nil { + z.Audit[za0005] = make(Audit, zb0008) + } else if len(z.Audit[za0005]) > 0 { + for key := range z.Audit[za0005] { + delete(z.Audit[za0005], key) + } + } + for zb0008 > 0 { + zb0008-- + var za0006 string + var za0007 Status + za0006, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Audit", za0005) + return + } + var zb0009 uint32 + zb0009, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "Audit", za0005, za0006) + return + } + var zb0009Mask uint8 /* 1 bits */ + _ = zb0009Mask + for zb0009 > 0 { + zb0009-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, "Audit", za0005, za0006) + return + } + switch msgp.UnsafeString(field) { + case "status": + za0007.Status, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Audit", za0005, za0006, "Status") + return + } + zb0009Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, "Audit", za0005, za0006) + return + } + } + } + // Clear omitted fields. + if zb0009Mask != 0x1 { + if (zb0009Mask & 0x1) == 0 { + za0007.Status = "" + } + } + z.Audit[za0005][za0006] = za0007 + } + } + zb0001Mask |= 0x10 + case "notifications": + var zb0010 uint32 + zb0010, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "Notifications") + return + } + if cap(z.Notifications) >= int(zb0010) { + z.Notifications = (z.Notifications)[:zb0010] + } else { + z.Notifications = make([]map[string][]TargetIDStatus, zb0010) + } + for za0008 := range z.Notifications { + var zb0011 uint32 + zb0011, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "Notifications", za0008) + return + } + if z.Notifications[za0008] == nil { + z.Notifications[za0008] = make(map[string][]TargetIDStatus, zb0011) + } else if len(z.Notifications[za0008]) > 0 { + for key := range z.Notifications[za0008] { + delete(z.Notifications[za0008], key) + } + } + for zb0011 > 0 { + zb0011-- + var za0009 string + var za0010 []TargetIDStatus + za0009, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Notifications", za0008) + return + } + var zb0012 uint32 + zb0012, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "Notifications", za0008, za0009) + return + } + if cap(za0010) >= int(zb0012) { + za0010 = (za0010)[:zb0012] + } else { + za0010 = make([]TargetIDStatus, zb0012) + } + for za0011 := range za0010 { + var zb0013 uint32 + zb0013, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "Notifications", za0008, za0009, za0011) + return + } + if za0010[za0011] == nil { + za0010[za0011] = make(TargetIDStatus, zb0013) + } else if len(za0010[za0011]) > 0 { + for key := range za0010[za0011] { + delete(za0010[za0011], key) + } + } + for zb0013 > 0 { + zb0013-- + var za0012 string + var za0013 Status + za0012, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Notifications", za0008, za0009, za0011) + return + } + var zb0014 uint32 + zb0014, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "Notifications", za0008, za0009, za0011, za0012) + return + } + var zb0014Mask uint8 /* 1 bits */ + _ = zb0014Mask + for zb0014 > 0 { + zb0014-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, "Notifications", za0008, za0009, za0011, za0012) + return + } + switch msgp.UnsafeString(field) { + case "status": + za0013.Status, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Notifications", za0008, za0009, za0011, za0012, "Status") + return + } + zb0014Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, "Notifications", za0008, za0009, za0011, za0012) + return + } + } + } + // Clear omitted fields. + if zb0014Mask != 0x1 { + if (zb0014Mask & 0x1) == 0 { + za0013.Status = "" + } + } + za0010[za0011][za0012] = za0013 + } + } + z.Notifications[za0008][za0009] = za0010 + } + } + zb0001Mask |= 0x20 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x3f { + if (zb0001Mask & 0x1) == 0 { + z.KMS = KMS{} + } + if (zb0001Mask & 0x2) == 0 { + z.KMSStatus = nil + } + if (zb0001Mask & 0x4) == 0 { + z.LDAP = (LDAP{}) + } + if (zb0001Mask & 0x8) == 0 { + z.Logger = nil + } + if (zb0001Mask & 0x10) == 0 { + z.Audit = nil + } + if (zb0001Mask & 0x20) == 0 { + z.Notifications = nil + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *Services) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(6) + var zb0001Mask uint8 /* 6 bits */ + _ = zb0001Mask + if z.KMSStatus == nil { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.LDAP == (LDAP{}) { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.Logger == nil { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.Audit == nil { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.Notifications == nil { + zb0001Len-- + zb0001Mask |= 0x20 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + // write "kms" + err = en.Append(0xa3, 0x6b, 0x6d, 0x73) + if err != nil { + return + } + err = z.KMS.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "KMS") + return + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "kmsStatus" + err = en.Append(0xa9, 0x6b, 0x6d, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.KMSStatus))) + if err != nil { + err = msgp.WrapError(err, "KMSStatus") + return + } + for za0001 := range z.KMSStatus { + err = z.KMSStatus[za0001].EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "KMSStatus", za0001) + return + } + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "ldap" + err = en.Append(0xa4, 0x6c, 0x64, 0x61, 0x70) + if err != nil { + return + } + // check for omitted fields + zb0002Len := uint32(1) + var zb0002Mask uint8 /* 1 bits */ + _ = zb0002Mask + if z.LDAP.Status == "" { + zb0002Len-- + zb0002Mask |= 0x1 + } + // variable map header, size zb0002Len + err = en.Append(0x80 | uint8(zb0002Len)) + if err != nil { + return + } + if (zb0002Mask & 0x1) == 0 { // if not omitted + // write "status" + err = en.Append(0xa6, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73) + if err != nil { + return + } + err = en.WriteString(z.LDAP.Status) + if err != nil { + err = msgp.WrapError(err, "LDAP", "Status") + return + } + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // write "logger" + err = en.Append(0xa6, 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x72) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Logger))) + if err != nil { + err = msgp.WrapError(err, "Logger") + return + } + for za0002 := range z.Logger { + err = en.WriteMapHeader(uint32(len(z.Logger[za0002]))) + if err != nil { + err = msgp.WrapError(err, "Logger", za0002) + return + } + for za0003, za0004 := range z.Logger[za0002] { + err = en.WriteString(za0003) + if err != nil { + err = msgp.WrapError(err, "Logger", za0002) + return + } + // check for omitted fields + zb0003Len := uint32(1) + var zb0003Mask uint8 /* 1 bits */ + _ = zb0003Mask + if za0004.Status == "" { + zb0003Len-- + zb0003Mask |= 0x1 + } + // variable map header, size zb0003Len + err = en.Append(0x80 | uint8(zb0003Len)) + if err != nil { + return + } + if zb0003Len == 0 { + return + } + if (zb0003Mask & 0x1) == 0 { // if not omitted + // write "status" + err = en.Append(0xa6, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73) + if err != nil { + return + } + err = en.WriteString(za0004.Status) + if err != nil { + err = msgp.WrapError(err, "Logger", za0002, za0003, "Status") + return + } + } + } + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // write "audit" + err = en.Append(0xa5, 0x61, 0x75, 0x64, 0x69, 0x74) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Audit))) + if err != nil { + err = msgp.WrapError(err, "Audit") + return + } + for za0005 := range z.Audit { + err = en.WriteMapHeader(uint32(len(z.Audit[za0005]))) + if err != nil { + err = msgp.WrapError(err, "Audit", za0005) + return + } + for za0006, za0007 := range z.Audit[za0005] { + err = en.WriteString(za0006) + if err != nil { + err = msgp.WrapError(err, "Audit", za0005) + return + } + // check for omitted fields + zb0004Len := uint32(1) + var zb0004Mask uint8 /* 1 bits */ + _ = zb0004Mask + if za0007.Status == "" { + zb0004Len-- + zb0004Mask |= 0x1 + } + // variable map header, size zb0004Len + err = en.Append(0x80 | uint8(zb0004Len)) + if err != nil { + return + } + if zb0004Len == 0 { + return + } + if (zb0004Mask & 0x1) == 0 { // if not omitted + // write "status" + err = en.Append(0xa6, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73) + if err != nil { + return + } + err = en.WriteString(za0007.Status) + if err != nil { + err = msgp.WrapError(err, "Audit", za0005, za0006, "Status") + return + } + } + } + } + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // write "notifications" + err = en.Append(0xad, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Notifications))) + if err != nil { + err = msgp.WrapError(err, "Notifications") + return + } + for za0008 := range z.Notifications { + err = en.WriteMapHeader(uint32(len(z.Notifications[za0008]))) + if err != nil { + err = msgp.WrapError(err, "Notifications", za0008) + return + } + for za0009, za0010 := range z.Notifications[za0008] { + err = en.WriteString(za0009) + if err != nil { + err = msgp.WrapError(err, "Notifications", za0008) + return + } + err = en.WriteArrayHeader(uint32(len(za0010))) + if err != nil { + err = msgp.WrapError(err, "Notifications", za0008, za0009) + return + } + for za0011 := range za0010 { + err = en.WriteMapHeader(uint32(len(za0010[za0011]))) + if err != nil { + err = msgp.WrapError(err, "Notifications", za0008, za0009, za0011) + return + } + for za0012, za0013 := range za0010[za0011] { + err = en.WriteString(za0012) + if err != nil { + err = msgp.WrapError(err, "Notifications", za0008, za0009, za0011) + return + } + // check for omitted fields + zb0005Len := uint32(1) + var zb0005Mask uint8 /* 1 bits */ + _ = zb0005Mask + if za0013.Status == "" { + zb0005Len-- + zb0005Mask |= 0x1 + } + // variable map header, size zb0005Len + err = en.Append(0x80 | uint8(zb0005Len)) + if err != nil { + return + } + if zb0005Len == 0 { + return + } + if (zb0005Mask & 0x1) == 0 { // if not omitted + // write "status" + err = en.Append(0xa6, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73) + if err != nil { + return + } + err = en.WriteString(za0013.Status) + if err != nil { + err = msgp.WrapError(err, "Notifications", za0008, za0009, za0011, za0012, "Status") + return + } + } + } + } + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *Services) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(6) + var zb0001Mask uint8 /* 6 bits */ + _ = zb0001Mask + if z.KMSStatus == nil { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.LDAP == (LDAP{}) { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.Logger == nil { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.Audit == nil { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.Notifications == nil { + zb0001Len-- + zb0001Mask |= 0x20 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + // string "kms" + o = append(o, 0xa3, 0x6b, 0x6d, 0x73) + o, err = z.KMS.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "KMS") + return + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "kmsStatus" + o = append(o, 0xa9, 0x6b, 0x6d, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.KMSStatus))) + for za0001 := range z.KMSStatus { + o, err = z.KMSStatus[za0001].MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "KMSStatus", za0001) + return + } + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "ldap" + o = append(o, 0xa4, 0x6c, 0x64, 0x61, 0x70) + // check for omitted fields + zb0002Len := uint32(1) + var zb0002Mask uint8 /* 1 bits */ + _ = zb0002Mask + if z.LDAP.Status == "" { + zb0002Len-- + zb0002Mask |= 0x1 + } + // variable map header, size zb0002Len + o = append(o, 0x80|uint8(zb0002Len)) + if (zb0002Mask & 0x1) == 0 { // if not omitted + // string "status" + o = append(o, 0xa6, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73) + o = msgp.AppendString(o, z.LDAP.Status) + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // string "logger" + o = append(o, 0xa6, 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x72) + o = msgp.AppendArrayHeader(o, uint32(len(z.Logger))) + for za0002 := range z.Logger { + o = msgp.AppendMapHeader(o, uint32(len(z.Logger[za0002]))) + for za0003, za0004 := range z.Logger[za0002] { + o = msgp.AppendString(o, za0003) + // check for omitted fields + zb0003Len := uint32(1) + var zb0003Mask uint8 /* 1 bits */ + _ = zb0003Mask + if za0004.Status == "" { + zb0003Len-- + zb0003Mask |= 0x1 + } + // variable map header, size zb0003Len + o = append(o, 0x80|uint8(zb0003Len)) + if zb0003Len == 0 { + return + } + if (zb0003Mask & 0x1) == 0 { // if not omitted + // string "status" + o = append(o, 0xa6, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73) + o = msgp.AppendString(o, za0004.Status) + } + } + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // string "audit" + o = append(o, 0xa5, 0x61, 0x75, 0x64, 0x69, 0x74) + o = msgp.AppendArrayHeader(o, uint32(len(z.Audit))) + for za0005 := range z.Audit { + o = msgp.AppendMapHeader(o, uint32(len(z.Audit[za0005]))) + for za0006, za0007 := range z.Audit[za0005] { + o = msgp.AppendString(o, za0006) + // check for omitted fields + zb0004Len := uint32(1) + var zb0004Mask uint8 /* 1 bits */ + _ = zb0004Mask + if za0007.Status == "" { + zb0004Len-- + zb0004Mask |= 0x1 + } + // variable map header, size zb0004Len + o = append(o, 0x80|uint8(zb0004Len)) + if zb0004Len == 0 { + return + } + if (zb0004Mask & 0x1) == 0 { // if not omitted + // string "status" + o = append(o, 0xa6, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73) + o = msgp.AppendString(o, za0007.Status) + } + } + } + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // string "notifications" + o = append(o, 0xad, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.Notifications))) + for za0008 := range z.Notifications { + o = msgp.AppendMapHeader(o, uint32(len(z.Notifications[za0008]))) + for za0009, za0010 := range z.Notifications[za0008] { + o = msgp.AppendString(o, za0009) + o = msgp.AppendArrayHeader(o, uint32(len(za0010))) + for za0011 := range za0010 { + o = msgp.AppendMapHeader(o, uint32(len(za0010[za0011]))) + for za0012, za0013 := range za0010[za0011] { + o = msgp.AppendString(o, za0012) + // check for omitted fields + zb0005Len := uint32(1) + var zb0005Mask uint8 /* 1 bits */ + _ = zb0005Mask + if za0013.Status == "" { + zb0005Len-- + zb0005Mask |= 0x1 + } + // variable map header, size zb0005Len + o = append(o, 0x80|uint8(zb0005Len)) + if zb0005Len == 0 { + return + } + if (zb0005Mask & 0x1) == 0 { // if not omitted + // string "status" + o = append(o, 0xa6, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73) + o = msgp.AppendString(o, za0013.Status) + } + } + } + } + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *Services) 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 /* 6 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 "kms": + bts, err = z.KMS.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "KMS") + return + } + zb0001Mask |= 0x1 + case "kmsStatus": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "KMSStatus") + return + } + if cap(z.KMSStatus) >= int(zb0002) { + z.KMSStatus = (z.KMSStatus)[:zb0002] + } else { + z.KMSStatus = make([]KMS, zb0002) + } + for za0001 := range z.KMSStatus { + bts, err = z.KMSStatus[za0001].UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "KMSStatus", za0001) + return + } + } + zb0001Mask |= 0x2 + case "ldap": + var zb0003 uint32 + zb0003, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LDAP") + return + } + var zb0003Mask uint8 /* 1 bits */ + _ = zb0003Mask + for zb0003 > 0 { + zb0003-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "LDAP") + return + } + switch msgp.UnsafeString(field) { + case "status": + z.LDAP.Status, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LDAP", "Status") + return + } + zb0003Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "LDAP") + return + } + } + } + // Clear omitted fields. + if zb0003Mask != 0x1 { + if (zb0003Mask & 0x1) == 0 { + z.LDAP.Status = "" + } + } + zb0001Mask |= 0x4 + case "logger": + var zb0004 uint32 + zb0004, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Logger") + return + } + if cap(z.Logger) >= int(zb0004) { + z.Logger = (z.Logger)[:zb0004] + } else { + z.Logger = make([]Logger, zb0004) + } + for za0002 := range z.Logger { + var zb0005 uint32 + zb0005, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Logger", za0002) + return + } + if z.Logger[za0002] == nil { + z.Logger[za0002] = make(Logger, zb0005) + } else if len(z.Logger[za0002]) > 0 { + for key := range z.Logger[za0002] { + delete(z.Logger[za0002], key) + } + } + for zb0005 > 0 { + var za0003 string + var za0004 Status + zb0005-- + za0003, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Logger", za0002) + return + } + var zb0006 uint32 + zb0006, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Logger", za0002, za0003) + return + } + var zb0006Mask uint8 /* 1 bits */ + _ = zb0006Mask + for zb0006 > 0 { + zb0006-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "Logger", za0002, za0003) + return + } + switch msgp.UnsafeString(field) { + case "status": + za0004.Status, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Logger", za0002, za0003, "Status") + return + } + zb0006Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "Logger", za0002, za0003) + return + } + } + } + // Clear omitted fields. + if zb0006Mask != 0x1 { + if (zb0006Mask & 0x1) == 0 { + za0004.Status = "" + } + } + z.Logger[za0002][za0003] = za0004 + } + } + zb0001Mask |= 0x8 + case "audit": + var zb0007 uint32 + zb0007, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Audit") + return + } + if cap(z.Audit) >= int(zb0007) { + z.Audit = (z.Audit)[:zb0007] + } else { + z.Audit = make([]Audit, zb0007) + } + for za0005 := range z.Audit { + var zb0008 uint32 + zb0008, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Audit", za0005) + return + } + if z.Audit[za0005] == nil { + z.Audit[za0005] = make(Audit, zb0008) + } else if len(z.Audit[za0005]) > 0 { + for key := range z.Audit[za0005] { + delete(z.Audit[za0005], key) + } + } + for zb0008 > 0 { + var za0006 string + var za0007 Status + zb0008-- + za0006, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Audit", za0005) + return + } + var zb0009 uint32 + zb0009, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Audit", za0005, za0006) + return + } + var zb0009Mask uint8 /* 1 bits */ + _ = zb0009Mask + for zb0009 > 0 { + zb0009-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "Audit", za0005, za0006) + return + } + switch msgp.UnsafeString(field) { + case "status": + za0007.Status, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Audit", za0005, za0006, "Status") + return + } + zb0009Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "Audit", za0005, za0006) + return + } + } + } + // Clear omitted fields. + if zb0009Mask != 0x1 { + if (zb0009Mask & 0x1) == 0 { + za0007.Status = "" + } + } + z.Audit[za0005][za0006] = za0007 + } + } + zb0001Mask |= 0x10 + case "notifications": + var zb0010 uint32 + zb0010, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Notifications") + return + } + if cap(z.Notifications) >= int(zb0010) { + z.Notifications = (z.Notifications)[:zb0010] + } else { + z.Notifications = make([]map[string][]TargetIDStatus, zb0010) + } + for za0008 := range z.Notifications { + var zb0011 uint32 + zb0011, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Notifications", za0008) + return + } + if z.Notifications[za0008] == nil { + z.Notifications[za0008] = make(map[string][]TargetIDStatus, zb0011) + } else if len(z.Notifications[za0008]) > 0 { + for key := range z.Notifications[za0008] { + delete(z.Notifications[za0008], key) + } + } + for zb0011 > 0 { + var za0009 string + var za0010 []TargetIDStatus + zb0011-- + za0009, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Notifications", za0008) + return + } + var zb0012 uint32 + zb0012, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Notifications", za0008, za0009) + return + } + if cap(za0010) >= int(zb0012) { + za0010 = (za0010)[:zb0012] + } else { + za0010 = make([]TargetIDStatus, zb0012) + } + for za0011 := range za0010 { + var zb0013 uint32 + zb0013, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Notifications", za0008, za0009, za0011) + return + } + if za0010[za0011] == nil { + za0010[za0011] = make(TargetIDStatus, zb0013) + } else if len(za0010[za0011]) > 0 { + for key := range za0010[za0011] { + delete(za0010[za0011], key) + } + } + for zb0013 > 0 { + var za0012 string + var za0013 Status + zb0013-- + za0012, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Notifications", za0008, za0009, za0011) + return + } + var zb0014 uint32 + zb0014, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Notifications", za0008, za0009, za0011, za0012) + return + } + var zb0014Mask uint8 /* 1 bits */ + _ = zb0014Mask + for zb0014 > 0 { + zb0014-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "Notifications", za0008, za0009, za0011, za0012) + return + } + switch msgp.UnsafeString(field) { + case "status": + za0013.Status, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Notifications", za0008, za0009, za0011, za0012, "Status") + return + } + zb0014Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "Notifications", za0008, za0009, za0011, za0012) + return + } + } + } + // Clear omitted fields. + if zb0014Mask != 0x1 { + if (zb0014Mask & 0x1) == 0 { + za0013.Status = "" + } + } + za0010[za0011][za0012] = za0013 + } + } + z.Notifications[za0008][za0009] = za0010 + } + } + zb0001Mask |= 0x20 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x3f { + if (zb0001Mask & 0x1) == 0 { + z.KMS = KMS{} + } + if (zb0001Mask & 0x2) == 0 { + z.KMSStatus = nil + } + if (zb0001Mask & 0x4) == 0 { + z.LDAP = (LDAP{}) + } + if (zb0001Mask & 0x8) == 0 { + z.Logger = nil + } + if (zb0001Mask & 0x10) == 0 { + z.Audit = nil + } + if (zb0001Mask & 0x20) == 0 { + z.Notifications = nil + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *Services) Msgsize() (s int) { + s = 1 + 4 + z.KMS.Msgsize() + 10 + msgp.ArrayHeaderSize + for za0001 := range z.KMSStatus { + s += z.KMSStatus[za0001].Msgsize() + } + s += 5 + 1 + 7 + msgp.StringPrefixSize + len(z.LDAP.Status) + 7 + msgp.ArrayHeaderSize + for za0002 := range z.Logger { + s += msgp.MapHeaderSize + if z.Logger[za0002] != nil { + for za0003, za0004 := range z.Logger[za0002] { + _ = za0004 + s += msgp.StringPrefixSize + len(za0003) + 1 + 7 + msgp.StringPrefixSize + len(za0004.Status) + } + } + } + s += 6 + msgp.ArrayHeaderSize + for za0005 := range z.Audit { + s += msgp.MapHeaderSize + if z.Audit[za0005] != nil { + for za0006, za0007 := range z.Audit[za0005] { + _ = za0007 + s += msgp.StringPrefixSize + len(za0006) + 1 + 7 + msgp.StringPrefixSize + len(za0007.Status) + } + } + } + s += 14 + msgp.ArrayHeaderSize + for za0008 := range z.Notifications { + s += msgp.MapHeaderSize + if z.Notifications[za0008] != nil { + for za0009, za0010 := range z.Notifications[za0008] { + _ = za0010 + s += msgp.StringPrefixSize + len(za0009) + msgp.ArrayHeaderSize + for za0011 := range za0010 { + s += msgp.MapHeaderSize + if za0010[za0011] != nil { + for za0012, za0013 := range za0010[za0011] { + _ = za0013 + s += msgp.StringPrefixSize + len(za0012) + 1 + 7 + msgp.StringPrefixSize + len(za0013.Status) + } + } + } + } + } + } + return +} + +// DecodeMsg implements msgp.Decodable +func (z *Status) 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 /* 1 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "status": + z.Status, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Status") + return + } + zb0001Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1 { + if (zb0001Mask & 0x1) == 0 { + z.Status = "" + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z Status) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(1) + var zb0001Mask uint8 /* 1 bits */ + _ = zb0001Mask + if z.Status == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + if (zb0001Mask & 0x1) == 0 { // if not omitted + // write "status" + err = en.Append(0xa6, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73) + if err != nil { + return + } + err = en.WriteString(z.Status) + if err != nil { + err = msgp.WrapError(err, "Status") + return + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z Status) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(1) + var zb0001Mask uint8 /* 1 bits */ + _ = zb0001Mask + if z.Status == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + if (zb0001Mask & 0x1) == 0 { // if not omitted + // string "status" + o = append(o, 0xa6, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73) + o = msgp.AppendString(o, z.Status) + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *Status) 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 /* 1 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 "status": + z.Status, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Status") + return + } + zb0001Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1 { + if (zb0001Mask & 0x1) == 0 { + z.Status = "" + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z Status) Msgsize() (s int) { + s = 1 + 7 + msgp.StringPrefixSize + len(z.Status) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *StorageInfo) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "Disks": + var zb0002 uint32 + zb0002, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "Disks") + return + } + if cap(z.Disks) >= int(zb0002) { + z.Disks = (z.Disks)[:zb0002] + } else { + z.Disks = make([]Disk, zb0002) + } + for za0001 := range z.Disks { + err = z.Disks[za0001].DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Disks", za0001) + return + } + } + case "Backend": + err = z.Backend.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Backend") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *StorageInfo) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 2 + // write "Disks" + err = en.Append(0x82, 0xa5, 0x44, 0x69, 0x73, 0x6b, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Disks))) + if err != nil { + err = msgp.WrapError(err, "Disks") + return + } + for za0001 := range z.Disks { + err = z.Disks[za0001].EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Disks", za0001) + return + } + } + // write "Backend" + err = en.Append(0xa7, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64) + if err != nil { + return + } + err = z.Backend.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Backend") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *StorageInfo) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 2 + // string "Disks" + o = append(o, 0x82, 0xa5, 0x44, 0x69, 0x73, 0x6b, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.Disks))) + for za0001 := range z.Disks { + o, err = z.Disks[za0001].MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Disks", za0001) + return + } + } + // string "Backend" + o = append(o, 0xa7, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64) + o, err = z.Backend.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Backend") + return + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *StorageInfo) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "Disks": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Disks") + return + } + if cap(z.Disks) >= int(zb0002) { + z.Disks = (z.Disks)[:zb0002] + } else { + z.Disks = make([]Disk, zb0002) + } + for za0001 := range z.Disks { + bts, err = z.Disks[za0001].UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Disks", za0001) + return + } + } + case "Backend": + bts, err = z.Backend.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Backend") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *StorageInfo) Msgsize() (s int) { + s = 1 + 6 + msgp.ArrayHeaderSize + for za0001 := range z.Disks { + s += z.Disks[za0001].Msgsize() + } + s += 8 + z.Backend.Msgsize() + return +} + +// DecodeMsg implements msgp.Decodable +func (z *TargetIDStatus) DecodeMsg(dc *msgp.Reader) (err error) { + var zb0003 uint32 + zb0003, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err) + return + } + if (*z) == nil { + (*z) = make(TargetIDStatus, zb0003) + } else if len((*z)) > 0 { + for key := range *z { + delete((*z), key) + } + } + var field []byte + _ = field + for zb0003 > 0 { + zb0003-- + var zb0001 string + var zb0002 Status + zb0001, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0004 uint32 + zb0004, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, zb0001) + return + } + var zb0004Mask uint8 /* 1 bits */ + _ = zb0004Mask + for zb0004 > 0 { + zb0004-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, zb0001) + return + } + switch msgp.UnsafeString(field) { + case "status": + zb0002.Status, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, zb0001, "Status") + return + } + zb0004Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, zb0001) + return + } + } + } + // Clear omitted fields. + if zb0004Mask != 0x1 { + if (zb0004Mask & 0x1) == 0 { + zb0002.Status = "" + } + } + (*z)[zb0001] = zb0002 + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z TargetIDStatus) EncodeMsg(en *msgp.Writer) (err error) { + err = en.WriteMapHeader(uint32(len(z))) + if err != nil { + err = msgp.WrapError(err) + return + } + for zb0005, zb0006 := range z { + err = en.WriteString(zb0005) + if err != nil { + err = msgp.WrapError(err) + return + } + // check for omitted fields + zb0001Len := uint32(1) + var zb0001Mask uint8 /* 1 bits */ + _ = zb0001Mask + if zb0006.Status == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + if (zb0001Mask & 0x1) == 0 { // if not omitted + // write "status" + err = en.Append(0xa6, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73) + if err != nil { + return + } + err = en.WriteString(zb0006.Status) + if err != nil { + err = msgp.WrapError(err, zb0005, "Status") + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z TargetIDStatus) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + o = msgp.AppendMapHeader(o, uint32(len(z))) + for zb0005, zb0006 := range z { + o = msgp.AppendString(o, zb0005) + // check for omitted fields + zb0001Len := uint32(1) + var zb0001Mask uint8 /* 1 bits */ + _ = zb0001Mask + if zb0006.Status == "" { + zb0001Len-- + zb0001Mask |= 0x1 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + if (zb0001Mask & 0x1) == 0 { // if not omitted + // string "status" + o = append(o, 0xa6, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73) + o = msgp.AppendString(o, zb0006.Status) + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *TargetIDStatus) UnmarshalMsg(bts []byte) (o []byte, err error) { + var zb0003 uint32 + zb0003, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + if (*z) == nil { + (*z) = make(TargetIDStatus, zb0003) + } else if len((*z)) > 0 { + for key := range *z { + delete((*z), key) + } + } + var field []byte + _ = field + for zb0003 > 0 { + var zb0001 string + var zb0002 Status + zb0003-- + zb0001, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + var zb0004 uint32 + zb0004, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, zb0001) + return + } + var zb0004Mask uint8 /* 1 bits */ + _ = zb0004Mask + for zb0004 > 0 { + zb0004-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, zb0001) + return + } + switch msgp.UnsafeString(field) { + case "status": + zb0002.Status, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, zb0001, "Status") + return + } + zb0004Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, zb0001) + return + } + } + } + // Clear omitted fields. + if zb0004Mask != 0x1 { + if (zb0004Mask & 0x1) == 0 { + zb0002.Status = "" + } + } + (*z)[zb0001] = zb0002 + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z TargetIDStatus) Msgsize() (s int) { + s = msgp.MapHeaderSize + if z != nil { + for zb0005, zb0006 := range z { + _ = zb0006 + s += msgp.StringPrefixSize + len(zb0005) + 1 + 7 + msgp.StringPrefixSize + len(zb0006.Status) + } + } + return +} + +// DecodeMsg implements msgp.Decodable +func (z *TierStats) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "totalSize": + z.TotalSize, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "TotalSize") + return + } + case "numVersions": + z.NumVersions, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "NumVersions") + return + } + case "numObjects": + z.NumObjects, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "NumObjects") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z TierStats) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 3 + // write "totalSize" + err = en.Append(0x83, 0xa9, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.TotalSize) + if err != nil { + err = msgp.WrapError(err, "TotalSize") + return + } + // write "numVersions" + err = en.Append(0xab, 0x6e, 0x75, 0x6d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73) + if err != nil { + return + } + err = en.WriteInt(z.NumVersions) + if err != nil { + err = msgp.WrapError(err, "NumVersions") + return + } + // write "numObjects" + err = en.Append(0xaa, 0x6e, 0x75, 0x6d, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteInt(z.NumObjects) + if err != nil { + err = msgp.WrapError(err, "NumObjects") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z TierStats) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 3 + // string "totalSize" + o = append(o, 0x83, 0xa9, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65) + o = msgp.AppendUint64(o, z.TotalSize) + // string "numVersions" + o = append(o, 0xab, 0x6e, 0x75, 0x6d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73) + o = msgp.AppendInt(o, z.NumVersions) + // string "numObjects" + o = append(o, 0xaa, 0x6e, 0x75, 0x6d, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73) + o = msgp.AppendInt(o, z.NumObjects) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *TierStats) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "totalSize": + z.TotalSize, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "TotalSize") + return + } + case "numVersions": + z.NumVersions, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "NumVersions") + return + } + case "numObjects": + z.NumObjects, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "NumObjects") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z TierStats) Msgsize() (s int) { + s = 1 + 10 + msgp.Uint64Size + 12 + msgp.IntSize + 11 + msgp.IntSize + return +} + +// DecodeMsg implements msgp.Decodable +func (z *Usage) 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 /* 1 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "size": + z.Size, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "Size") + return + } + case "error": + z.Error, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Error") + return + } + zb0001Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1 { + if (zb0001Mask & 0x1) == 0 { + z.Error = "" + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z Usage) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(2) + var zb0001Mask uint8 /* 2 bits */ + _ = zb0001Mask + if z.Error == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + // write "size" + err = en.Append(0xa4, 0x73, 0x69, 0x7a, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.Size) + if err != nil { + err = msgp.WrapError(err, "Size") + return + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "error" + err = en.Append(0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72) + if err != nil { + return + } + err = en.WriteString(z.Error) + if err != nil { + err = msgp.WrapError(err, "Error") + return + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z Usage) 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.Error == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + // string "size" + o = append(o, 0xa4, 0x73, 0x69, 0x7a, 0x65) + o = msgp.AppendUint64(o, z.Size) + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "error" + o = append(o, 0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72) + o = msgp.AppendString(o, z.Error) + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *Usage) 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 /* 1 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 "size": + z.Size, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Size") + return + } + case "error": + z.Error, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Error") + return + } + zb0001Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1 { + if (zb0001Mask & 0x1) == 0 { + z.Error = "" + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z Usage) Msgsize() (s int) { + s = 1 + 5 + msgp.Uint64Size + 6 + msgp.StringPrefixSize + len(z.Error) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *Versions) 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 /* 1 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "count": + z.Count, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "Count") + return + } + case "error": + z.Error, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Error") + return + } + zb0001Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1 { + if (zb0001Mask & 0x1) == 0 { + z.Error = "" + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z Versions) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(2) + var zb0001Mask uint8 /* 2 bits */ + _ = zb0001Mask + if z.Error == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + // write "count" + err = en.Append(0xa5, 0x63, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteUint64(z.Count) + if err != nil { + err = msgp.WrapError(err, "Count") + return + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "error" + err = en.Append(0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72) + if err != nil { + return + } + err = en.WriteString(z.Error) + if err != nil { + err = msgp.WrapError(err, "Error") + return + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z Versions) 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.Error == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + // string "count" + o = append(o, 0xa5, 0x63, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendUint64(o, z.Count) + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "error" + o = append(o, 0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72) + o = msgp.AppendString(o, z.Error) + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *Versions) 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 /* 1 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 "count": + z.Count, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Count") + return + } + case "error": + z.Error, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Error") + return + } + zb0001Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1 { + if (zb0001Mask & 0x1) == 0 { + z.Error = "" + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z Versions) Msgsize() (s int) { + s = 1 + 6 + msgp.Uint64Size + 6 + msgp.StringPrefixSize + len(z.Error) + return +} diff --git a/info-commands_gen_test.go b/info-commands_gen_test.go new file mode 100644 index 0000000..9ce7a3b --- /dev/null +++ b/info-commands_gen_test.go @@ -0,0 +1,3287 @@ +package madmin + +// Code generated by github.com/tinylib/msgp DO NOT EDIT. + +import ( + "bytes" + "testing" + + "github.com/tinylib/msgp/msgp" +) + +func TestMarshalUnmarshalAudit(t *testing.T) { + v := Audit{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgAudit(b *testing.B) { + v := Audit{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgAudit(b *testing.B) { + v := Audit{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalAudit(b *testing.B) { + v := Audit{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeAudit(t *testing.T) { + v := Audit{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeAudit Msgsize() is inaccurate") + } + + vn := Audit{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeAudit(b *testing.B) { + v := Audit{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeAudit(b *testing.B) { + v := Audit{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalBackendDisks(t *testing.T) { + v := BackendDisks{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgBackendDisks(b *testing.B) { + v := BackendDisks{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgBackendDisks(b *testing.B) { + v := BackendDisks{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalBackendDisks(b *testing.B) { + v := BackendDisks{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeBackendDisks(t *testing.T) { + v := BackendDisks{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeBackendDisks Msgsize() is inaccurate") + } + + vn := BackendDisks{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeBackendDisks(b *testing.B) { + v := BackendDisks{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeBackendDisks(b *testing.B) { + v := BackendDisks{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalBackendInfo(t *testing.T) { + v := BackendInfo{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgBackendInfo(b *testing.B) { + v := BackendInfo{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgBackendInfo(b *testing.B) { + v := BackendInfo{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalBackendInfo(b *testing.B) { + v := BackendInfo{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeBackendInfo(t *testing.T) { + v := BackendInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeBackendInfo Msgsize() is inaccurate") + } + + vn := BackendInfo{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeBackendInfo(b *testing.B) { + v := BackendInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeBackendInfo(b *testing.B) { + v := BackendInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalBucketUsageInfo(t *testing.T) { + v := BucketUsageInfo{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgBucketUsageInfo(b *testing.B) { + v := BucketUsageInfo{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgBucketUsageInfo(b *testing.B) { + v := BucketUsageInfo{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalBucketUsageInfo(b *testing.B) { + v := BucketUsageInfo{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeBucketUsageInfo(t *testing.T) { + v := BucketUsageInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeBucketUsageInfo Msgsize() is inaccurate") + } + + vn := BucketUsageInfo{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeBucketUsageInfo(b *testing.B) { + v := BucketUsageInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeBucketUsageInfo(b *testing.B) { + v := BucketUsageInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalBuckets(t *testing.T) { + v := Buckets{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgBuckets(b *testing.B) { + v := Buckets{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgBuckets(b *testing.B) { + v := Buckets{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalBuckets(b *testing.B) { + v := Buckets{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeBuckets(t *testing.T) { + v := Buckets{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeBuckets Msgsize() is inaccurate") + } + + vn := Buckets{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeBuckets(b *testing.B) { + v := Buckets{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeBuckets(b *testing.B) { + v := Buckets{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalCacheStats(t *testing.T) { + v := CacheStats{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgCacheStats(b *testing.B) { + v := CacheStats{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgCacheStats(b *testing.B) { + v := CacheStats{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalCacheStats(b *testing.B) { + v := CacheStats{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeCacheStats(t *testing.T) { + v := CacheStats{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeCacheStats Msgsize() is inaccurate") + } + + vn := CacheStats{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeCacheStats(b *testing.B) { + v := CacheStats{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeCacheStats(b *testing.B) { + v := CacheStats{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalDataUsageInfo(t *testing.T) { + v := DataUsageInfo{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgDataUsageInfo(b *testing.B) { + v := DataUsageInfo{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgDataUsageInfo(b *testing.B) { + v := DataUsageInfo{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalDataUsageInfo(b *testing.B) { + v := DataUsageInfo{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeDataUsageInfo(t *testing.T) { + v := DataUsageInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeDataUsageInfo Msgsize() is inaccurate") + } + + vn := DataUsageInfo{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeDataUsageInfo(b *testing.B) { + v := DataUsageInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeDataUsageInfo(b *testing.B) { + v := DataUsageInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalDeleteMarkers(t *testing.T) { + v := DeleteMarkers{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgDeleteMarkers(b *testing.B) { + v := DeleteMarkers{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgDeleteMarkers(b *testing.B) { + v := DeleteMarkers{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalDeleteMarkers(b *testing.B) { + v := DeleteMarkers{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeDeleteMarkers(t *testing.T) { + v := DeleteMarkers{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeDeleteMarkers Msgsize() is inaccurate") + } + + vn := DeleteMarkers{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeDeleteMarkers(b *testing.B) { + v := DeleteMarkers{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeDeleteMarkers(b *testing.B) { + v := DeleteMarkers{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalDisk(t *testing.T) { + v := Disk{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgDisk(b *testing.B) { + v := Disk{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgDisk(b *testing.B) { + v := Disk{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalDisk(b *testing.B) { + v := Disk{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeDisk(t *testing.T) { + v := Disk{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeDisk Msgsize() is inaccurate") + } + + vn := Disk{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeDisk(b *testing.B) { + v := Disk{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeDisk(b *testing.B) { + v := Disk{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalDiskMetrics(t *testing.T) { + v := DiskMetrics{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgDiskMetrics(b *testing.B) { + v := DiskMetrics{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgDiskMetrics(b *testing.B) { + v := DiskMetrics{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalDiskMetrics(b *testing.B) { + v := DiskMetrics{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeDiskMetrics(t *testing.T) { + v := DiskMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeDiskMetrics Msgsize() is inaccurate") + } + + vn := DiskMetrics{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeDiskMetrics(b *testing.B) { + v := DiskMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeDiskMetrics(b *testing.B) { + v := DiskMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalErasureBackend(t *testing.T) { + v := ErasureBackend{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgErasureBackend(b *testing.B) { + v := ErasureBackend{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgErasureBackend(b *testing.B) { + v := ErasureBackend{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalErasureBackend(b *testing.B) { + v := ErasureBackend{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeErasureBackend(t *testing.T) { + v := ErasureBackend{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeErasureBackend Msgsize() is inaccurate") + } + + vn := ErasureBackend{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeErasureBackend(b *testing.B) { + v := ErasureBackend{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeErasureBackend(b *testing.B) { + v := ErasureBackend{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalErasureSetInfo(t *testing.T) { + v := ErasureSetInfo{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgErasureSetInfo(b *testing.B) { + v := ErasureSetInfo{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgErasureSetInfo(b *testing.B) { + v := ErasureSetInfo{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalErasureSetInfo(b *testing.B) { + v := ErasureSetInfo{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeErasureSetInfo(t *testing.T) { + v := ErasureSetInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeErasureSetInfo Msgsize() is inaccurate") + } + + vn := ErasureSetInfo{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeErasureSetInfo(b *testing.B) { + v := ErasureSetInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeErasureSetInfo(b *testing.B) { + v := ErasureSetInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalFSBackend(t *testing.T) { + v := FSBackend{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgFSBackend(b *testing.B) { + v := FSBackend{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgFSBackend(b *testing.B) { + v := FSBackend{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalFSBackend(b *testing.B) { + v := FSBackend{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeFSBackend(t *testing.T) { + v := FSBackend{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeFSBackend Msgsize() is inaccurate") + } + + vn := FSBackend{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeFSBackend(b *testing.B) { + v := FSBackend{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeFSBackend(b *testing.B) { + v := FSBackend{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalGCStats(t *testing.T) { + v := GCStats{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgGCStats(b *testing.B) { + v := GCStats{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgGCStats(b *testing.B) { + v := GCStats{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalGCStats(b *testing.B) { + v := GCStats{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeGCStats(t *testing.T) { + v := GCStats{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeGCStats Msgsize() is inaccurate") + } + + vn := GCStats{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeGCStats(b *testing.B) { + v := GCStats{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeGCStats(b *testing.B) { + v := GCStats{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalInfoMessage(t *testing.T) { + v := InfoMessage{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgInfoMessage(b *testing.B) { + v := InfoMessage{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgInfoMessage(b *testing.B) { + v := InfoMessage{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalInfoMessage(b *testing.B) { + v := InfoMessage{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeInfoMessage(t *testing.T) { + v := InfoMessage{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeInfoMessage Msgsize() is inaccurate") + } + + vn := InfoMessage{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeInfoMessage(b *testing.B) { + v := InfoMessage{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeInfoMessage(b *testing.B) { + v := InfoMessage{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalKMS(t *testing.T) { + v := KMS{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgKMS(b *testing.B) { + v := KMS{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgKMS(b *testing.B) { + v := KMS{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalKMS(b *testing.B) { + v := KMS{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeKMS(t *testing.T) { + v := KMS{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeKMS Msgsize() is inaccurate") + } + + vn := KMS{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeKMS(b *testing.B) { + v := KMS{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeKMS(b *testing.B) { + v := KMS{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalLDAP(t *testing.T) { + v := LDAP{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgLDAP(b *testing.B) { + v := LDAP{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgLDAP(b *testing.B) { + v := LDAP{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalLDAP(b *testing.B) { + v := LDAP{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeLDAP(t *testing.T) { + v := LDAP{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeLDAP Msgsize() is inaccurate") + } + + vn := LDAP{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeLDAP(b *testing.B) { + v := LDAP{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeLDAP(b *testing.B) { + v := LDAP{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalLogger(t *testing.T) { + v := Logger{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgLogger(b *testing.B) { + v := Logger{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgLogger(b *testing.B) { + v := Logger{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalLogger(b *testing.B) { + v := Logger{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeLogger(t *testing.T) { + v := Logger{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeLogger Msgsize() is inaccurate") + } + + vn := Logger{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeLogger(b *testing.B) { + v := Logger{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeLogger(b *testing.B) { + v := Logger{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalMemStats(t *testing.T) { + v := MemStats{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgMemStats(b *testing.B) { + v := MemStats{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgMemStats(b *testing.B) { + v := MemStats{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalMemStats(b *testing.B) { + v := MemStats{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeMemStats(t *testing.T) { + v := MemStats{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeMemStats Msgsize() is inaccurate") + } + + vn := MemStats{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeMemStats(b *testing.B) { + v := MemStats{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeMemStats(b *testing.B) { + v := MemStats{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalObjects(t *testing.T) { + v := Objects{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgObjects(b *testing.B) { + v := Objects{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgObjects(b *testing.B) { + v := Objects{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalObjects(b *testing.B) { + v := Objects{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeObjects(t *testing.T) { + v := Objects{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeObjects Msgsize() is inaccurate") + } + + vn := Objects{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeObjects(b *testing.B) { + v := Objects{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeObjects(b *testing.B) { + v := Objects{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalServerInfoOpts(t *testing.T) { + v := ServerInfoOpts{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgServerInfoOpts(b *testing.B) { + v := ServerInfoOpts{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgServerInfoOpts(b *testing.B) { + v := ServerInfoOpts{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalServerInfoOpts(b *testing.B) { + v := ServerInfoOpts{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeServerInfoOpts(t *testing.T) { + v := ServerInfoOpts{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeServerInfoOpts Msgsize() is inaccurate") + } + + vn := ServerInfoOpts{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeServerInfoOpts(b *testing.B) { + v := ServerInfoOpts{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeServerInfoOpts(b *testing.B) { + v := ServerInfoOpts{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalServerProperties(t *testing.T) { + v := ServerProperties{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgServerProperties(b *testing.B) { + v := ServerProperties{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgServerProperties(b *testing.B) { + v := ServerProperties{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalServerProperties(b *testing.B) { + v := ServerProperties{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeServerProperties(t *testing.T) { + v := ServerProperties{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeServerProperties Msgsize() is inaccurate") + } + + vn := ServerProperties{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeServerProperties(b *testing.B) { + v := ServerProperties{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeServerProperties(b *testing.B) { + v := ServerProperties{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalServices(t *testing.T) { + v := Services{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgServices(b *testing.B) { + v := Services{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgServices(b *testing.B) { + v := Services{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalServices(b *testing.B) { + v := Services{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeServices(t *testing.T) { + v := Services{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeServices Msgsize() is inaccurate") + } + + vn := Services{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeServices(b *testing.B) { + v := Services{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeServices(b *testing.B) { + v := Services{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalStatus(t *testing.T) { + v := Status{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgStatus(b *testing.B) { + v := Status{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgStatus(b *testing.B) { + v := Status{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalStatus(b *testing.B) { + v := Status{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeStatus(t *testing.T) { + v := Status{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeStatus Msgsize() is inaccurate") + } + + vn := Status{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeStatus(b *testing.B) { + v := Status{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeStatus(b *testing.B) { + v := Status{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalStorageInfo(t *testing.T) { + v := StorageInfo{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgStorageInfo(b *testing.B) { + v := StorageInfo{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgStorageInfo(b *testing.B) { + v := StorageInfo{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalStorageInfo(b *testing.B) { + v := StorageInfo{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeStorageInfo(t *testing.T) { + v := StorageInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeStorageInfo Msgsize() is inaccurate") + } + + vn := StorageInfo{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeStorageInfo(b *testing.B) { + v := StorageInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeStorageInfo(b *testing.B) { + v := StorageInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalTargetIDStatus(t *testing.T) { + v := TargetIDStatus{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgTargetIDStatus(b *testing.B) { + v := TargetIDStatus{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgTargetIDStatus(b *testing.B) { + v := TargetIDStatus{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalTargetIDStatus(b *testing.B) { + v := TargetIDStatus{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeTargetIDStatus(t *testing.T) { + v := TargetIDStatus{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeTargetIDStatus Msgsize() is inaccurate") + } + + vn := TargetIDStatus{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeTargetIDStatus(b *testing.B) { + v := TargetIDStatus{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeTargetIDStatus(b *testing.B) { + v := TargetIDStatus{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalTierStats(t *testing.T) { + v := TierStats{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgTierStats(b *testing.B) { + v := TierStats{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgTierStats(b *testing.B) { + v := TierStats{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalTierStats(b *testing.B) { + v := TierStats{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeTierStats(t *testing.T) { + v := TierStats{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeTierStats Msgsize() is inaccurate") + } + + vn := TierStats{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeTierStats(b *testing.B) { + v := TierStats{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeTierStats(b *testing.B) { + v := TierStats{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalUsage(t *testing.T) { + v := Usage{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgUsage(b *testing.B) { + v := Usage{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgUsage(b *testing.B) { + v := Usage{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalUsage(b *testing.B) { + v := Usage{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeUsage(t *testing.T) { + v := Usage{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeUsage Msgsize() is inaccurate") + } + + vn := Usage{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeUsage(b *testing.B) { + v := Usage{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeUsage(b *testing.B) { + v := Usage{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalVersions(t *testing.T) { + v := Versions{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgVersions(b *testing.B) { + v := Versions{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgVersions(b *testing.B) { + v := Versions{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalVersions(b *testing.B) { + v := Versions{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeVersions(t *testing.T) { + v := Versions{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeVersions Msgsize() is inaccurate") + } + + vn := Versions{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeVersions(b *testing.B) { + v := Versions{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeVersions(b *testing.B) { + v := Versions{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} diff --git a/metrics.go b/metrics.go index fc459ec..9fa8a9c 100644 --- a/metrics.go +++ b/metrics.go @@ -37,6 +37,10 @@ import ( "github.com/shirou/gopsutil/v3/load" ) +//msgp:clearomitted +//msgp:tag json +//go:generate msgp + // MetricType is a bitfield representation of different metric types. type MetricType uint32 @@ -262,36 +266,6 @@ type ScannerMetrics struct { ActivePaths []string `json:"active,omitempty"` } -// TimedAction contains a number of actions and their accumulated duration in nanoseconds. -type TimedAction struct { - Count uint64 `json:"count"` - AccTime uint64 `json:"acc_time_ns"` - Bytes uint64 `json:"bytes,omitempty"` -} - -// Avg returns the average time spent on the action. -func (t TimedAction) Avg() time.Duration { - if t.Count == 0 { - return 0 - } - return time.Duration(t.AccTime / t.Count) -} - -// AvgBytes returns the average time spent on the action. -func (t TimedAction) AvgBytes() uint64 { - if t.Count == 0 { - return 0 - } - return t.Bytes / t.Count -} - -// Merge other into t. -func (t *TimedAction) Merge(other TimedAction) { - t.Count += other.Count - t.AccTime += other.AccTime - t.Bytes += other.Bytes -} - // Merge other into 's'. func (s *ScannerMetrics) Merge(other *ScannerMetrics) { if other == nil { @@ -612,6 +586,8 @@ type NetMetrics struct { NetStats procfs.NetDevLine `json:"netstats"` } +//msgp:replace procfs.NetDevLine with:procfsNetDevLine + // Merge other into 'o'. func (n *NetMetrics) Merge(other *NetMetrics) { if other == nil { @@ -639,6 +615,24 @@ func (n *NetMetrics) Merge(other *NetMetrics) { n.NetStats.TxCompressed += other.NetStats.TxCompressed } +// MemInfo contains system's RAM and swap information. +type MemInfo struct { + NodeCommon + + Total uint64 `json:"total,omitempty"` + Used uint64 `json:"used,omitempty"` + Free uint64 `json:"free,omitempty"` + Available uint64 `json:"available,omitempty"` + Shared uint64 `json:"shared,omitempty"` + Cache uint64 `json:"cache,omitempty"` + Buffers uint64 `json:"buffer,omitempty"` + SwapSpaceTotal uint64 `json:"swap_space_total,omitempty"` + SwapSpaceFree uint64 `json:"swap_space_free,omitempty"` + // Limit will store cgroup limit if configured and + // less than Total, otherwise same as Total + Limit uint64 `json:"limit,omitempty"` +} + type MemMetrics struct { // Time these metrics were collected CollectedAt time.Time `json:"collected"` @@ -660,6 +654,9 @@ func (m *MemMetrics) Merge(other *MemMetrics) { m.Info.Limit += other.Info.Limit } +//msgp:replace cpu.TimesStat with:cpuTimesStat +//msgp:replace load.AvgStat with:loadAvgStat + type CPUMetrics struct { // Time these metrics were collected CollectedAt time.Time `json:"collected"` diff --git a/metrics_gen.go b/metrics_gen.go new file mode 100644 index 0000000..246c6cd --- /dev/null +++ b/metrics_gen.go @@ -0,0 +1,8457 @@ +package madmin + +// Code generated by github.com/tinylib/msgp DO NOT EDIT. + +import ( + "time" + + "github.com/shirou/gopsutil/v3/cpu" + "github.com/shirou/gopsutil/v3/load" + "github.com/tinylib/msgp/msgp" +) + +// DecodeMsg implements msgp.Decodable +func (z *BatchJobMetrics) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "collected": + z.CollectedAt, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + case "Jobs": + var zb0002 uint32 + zb0002, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "Jobs") + return + } + if z.Jobs == nil { + z.Jobs = make(map[string]JobMetric, zb0002) + } else if len(z.Jobs) > 0 { + for key := range z.Jobs { + delete(z.Jobs, key) + } + } + for zb0002 > 0 { + zb0002-- + var za0001 string + var za0002 JobMetric + za0001, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Jobs") + return + } + err = za0002.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Jobs", za0001) + return + } + z.Jobs[za0001] = za0002 + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *BatchJobMetrics) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 2 + // write "collected" + err = en.Append(0x82, 0xa9, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteTime(z.CollectedAt) + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + // write "Jobs" + err = en.Append(0xa4, 0x4a, 0x6f, 0x62, 0x73) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.Jobs))) + if err != nil { + err = msgp.WrapError(err, "Jobs") + return + } + for za0001, za0002 := range z.Jobs { + err = en.WriteString(za0001) + if err != nil { + err = msgp.WrapError(err, "Jobs") + return + } + err = za0002.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Jobs", za0001) + return + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *BatchJobMetrics) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 2 + // string "collected" + o = append(o, 0x82, 0xa9, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64) + o = msgp.AppendTime(o, z.CollectedAt) + // string "Jobs" + o = append(o, 0xa4, 0x4a, 0x6f, 0x62, 0x73) + o = msgp.AppendMapHeader(o, uint32(len(z.Jobs))) + for za0001, za0002 := range z.Jobs { + o = msgp.AppendString(o, za0001) + o, err = za0002.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Jobs", za0001) + return + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *BatchJobMetrics) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "collected": + z.CollectedAt, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + case "Jobs": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Jobs") + return + } + if z.Jobs == nil { + z.Jobs = make(map[string]JobMetric, zb0002) + } else if len(z.Jobs) > 0 { + for key := range z.Jobs { + delete(z.Jobs, key) + } + } + for zb0002 > 0 { + var za0001 string + var za0002 JobMetric + zb0002-- + za0001, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Jobs") + return + } + bts, err = za0002.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Jobs", za0001) + return + } + z.Jobs[za0001] = za0002 + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *BatchJobMetrics) Msgsize() (s int) { + s = 1 + 10 + msgp.TimeSize + 5 + msgp.MapHeaderSize + if z.Jobs != nil { + for za0001, za0002 := range z.Jobs { + _ = za0002 + s += msgp.StringPrefixSize + len(za0001) + za0002.Msgsize() + } + } + return +} + +// DecodeMsg implements msgp.Decodable +func (z *CPUMetrics) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "collected": + z.CollectedAt, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + case "timesStat": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "TimesStat") + return + } + z.TimesStat = nil + } else { + if z.TimesStat == nil { + z.TimesStat = new(cpu.TimesStat) + } + err = (*cpuTimesStat)(z.TimesStat).DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "TimesStat") + return + } + } + case "loadStat": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "LoadStat") + return + } + z.LoadStat = nil + } else { + if z.LoadStat == nil { + z.LoadStat = new(load.AvgStat) + } + err = (*loadAvgStat)(z.LoadStat).DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "LoadStat") + return + } + } + case "cpuCount": + z.CPUCount, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "CPUCount") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *CPUMetrics) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 4 + // write "collected" + err = en.Append(0x84, 0xa9, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteTime(z.CollectedAt) + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + // write "timesStat" + err = en.Append(0xa9, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x53, 0x74, 0x61, 0x74) + if err != nil { + return + } + if z.TimesStat == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = (*cpuTimesStat)(z.TimesStat).EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "TimesStat") + return + } + } + // write "loadStat" + err = en.Append(0xa8, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74) + if err != nil { + return + } + if z.LoadStat == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = (*loadAvgStat)(z.LoadStat).EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "LoadStat") + return + } + } + // write "cpuCount" + err = en.Append(0xa8, 0x63, 0x70, 0x75, 0x43, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteInt(z.CPUCount) + if err != nil { + err = msgp.WrapError(err, "CPUCount") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *CPUMetrics) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 4 + // string "collected" + o = append(o, 0x84, 0xa9, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64) + o = msgp.AppendTime(o, z.CollectedAt) + // string "timesStat" + o = append(o, 0xa9, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x53, 0x74, 0x61, 0x74) + if z.TimesStat == nil { + o = msgp.AppendNil(o) + } else { + o, err = (*cpuTimesStat)(z.TimesStat).MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "TimesStat") + return + } + } + // string "loadStat" + o = append(o, 0xa8, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x61, 0x74) + if z.LoadStat == nil { + o = msgp.AppendNil(o) + } else { + o, err = (*loadAvgStat)(z.LoadStat).MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "LoadStat") + return + } + } + // string "cpuCount" + o = append(o, 0xa8, 0x63, 0x70, 0x75, 0x43, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendInt(o, z.CPUCount) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *CPUMetrics) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "collected": + z.CollectedAt, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + case "timesStat": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.TimesStat = nil + } else { + if z.TimesStat == nil { + z.TimesStat = new(cpu.TimesStat) + } + bts, err = (*cpuTimesStat)(z.TimesStat).UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "TimesStat") + return + } + } + case "loadStat": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.LoadStat = nil + } else { + if z.LoadStat == nil { + z.LoadStat = new(load.AvgStat) + } + bts, err = (*loadAvgStat)(z.LoadStat).UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "LoadStat") + return + } + } + case "cpuCount": + z.CPUCount, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "CPUCount") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *CPUMetrics) Msgsize() (s int) { + s = 1 + 10 + msgp.TimeSize + 10 + if z.TimesStat == nil { + s += msgp.NilSize + } else { + s += (*cpuTimesStat)(z.TimesStat).Msgsize() + } + s += 9 + if z.LoadStat == nil { + s += msgp.NilSize + } else { + s += (*loadAvgStat)(z.LoadStat).Msgsize() + } + s += 9 + msgp.IntSize + return +} + +// DecodeMsg implements msgp.Decodable +func (z *DiskIOStats) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "read_ios": + z.ReadIOs, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ReadIOs") + return + } + case "read_merges": + z.ReadMerges, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ReadMerges") + return + } + case "read_sectors": + z.ReadSectors, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ReadSectors") + return + } + case "read_ticks": + z.ReadTicks, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ReadTicks") + return + } + case "write_ios": + z.WriteIOs, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "WriteIOs") + return + } + case "write_merges": + z.WriteMerges, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "WriteMerges") + return + } + case "wrte_sectors": + z.WriteSectors, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "WriteSectors") + return + } + case "write_ticks": + z.WriteTicks, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "WriteTicks") + return + } + case "current_ios": + z.CurrentIOs, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "CurrentIOs") + return + } + case "total_ticks": + z.TotalTicks, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "TotalTicks") + return + } + case "req_ticks": + z.ReqTicks, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "ReqTicks") + return + } + case "discard_ios": + z.DiscardIOs, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "DiscardIOs") + return + } + case "discard_merges": + z.DiscardMerges, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "DiscardMerges") + return + } + case "discard_secotrs": + z.DiscardSectors, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "DiscardSectors") + return + } + case "discard_ticks": + z.DiscardTicks, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "DiscardTicks") + return + } + case "flush_ios": + z.FlushIOs, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "FlushIOs") + return + } + case "flush_ticks": + z.FlushTicks, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "FlushTicks") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *DiskIOStats) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 17 + // write "read_ios" + err = en.Append(0xde, 0x0, 0x11, 0xa8, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x69, 0x6f, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.ReadIOs) + if err != nil { + err = msgp.WrapError(err, "ReadIOs") + return + } + // write "read_merges" + err = en.Append(0xab, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.ReadMerges) + if err != nil { + err = msgp.WrapError(err, "ReadMerges") + return + } + // write "read_sectors" + err = en.Append(0xac, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x73, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.ReadSectors) + if err != nil { + err = msgp.WrapError(err, "ReadSectors") + return + } + // write "read_ticks" + err = en.Append(0xaa, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.ReadTicks) + if err != nil { + err = msgp.WrapError(err, "ReadTicks") + return + } + // write "write_ios" + err = en.Append(0xa9, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x69, 0x6f, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.WriteIOs) + if err != nil { + err = msgp.WrapError(err, "WriteIOs") + return + } + // write "write_merges" + err = en.Append(0xac, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.WriteMerges) + if err != nil { + err = msgp.WrapError(err, "WriteMerges") + return + } + // write "wrte_sectors" + err = en.Append(0xac, 0x77, 0x72, 0x74, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.WriteSectors) + if err != nil { + err = msgp.WrapError(err, "WriteSectors") + return + } + // write "write_ticks" + err = en.Append(0xab, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.WriteTicks) + if err != nil { + err = msgp.WrapError(err, "WriteTicks") + return + } + // write "current_ios" + err = en.Append(0xab, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x6f, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.CurrentIOs) + if err != nil { + err = msgp.WrapError(err, "CurrentIOs") + return + } + // write "total_ticks" + err = en.Append(0xab, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.TotalTicks) + if err != nil { + err = msgp.WrapError(err, "TotalTicks") + return + } + // write "req_ticks" + err = en.Append(0xa9, 0x72, 0x65, 0x71, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.ReqTicks) + if err != nil { + err = msgp.WrapError(err, "ReqTicks") + return + } + // write "discard_ios" + err = en.Append(0xab, 0x64, 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x6f, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.DiscardIOs) + if err != nil { + err = msgp.WrapError(err, "DiscardIOs") + return + } + // write "discard_merges" + err = en.Append(0xae, 0x64, 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.DiscardMerges) + if err != nil { + err = msgp.WrapError(err, "DiscardMerges") + return + } + // write "discard_secotrs" + err = en.Append(0xaf, 0x64, 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x74, 0x72, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.DiscardSectors) + if err != nil { + err = msgp.WrapError(err, "DiscardSectors") + return + } + // write "discard_ticks" + err = en.Append(0xad, 0x64, 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.DiscardTicks) + if err != nil { + err = msgp.WrapError(err, "DiscardTicks") + return + } + // write "flush_ios" + err = en.Append(0xa9, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x5f, 0x69, 0x6f, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.FlushIOs) + if err != nil { + err = msgp.WrapError(err, "FlushIOs") + return + } + // write "flush_ticks" + err = en.Append(0xab, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.FlushTicks) + if err != nil { + err = msgp.WrapError(err, "FlushTicks") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *DiskIOStats) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 17 + // string "read_ios" + o = append(o, 0xde, 0x0, 0x11, 0xa8, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x69, 0x6f, 0x73) + o = msgp.AppendUint64(o, z.ReadIOs) + // string "read_merges" + o = append(o, 0xab, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x73) + o = msgp.AppendUint64(o, z.ReadMerges) + // string "read_sectors" + o = append(o, 0xac, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x73, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73) + o = msgp.AppendUint64(o, z.ReadSectors) + // string "read_ticks" + o = append(o, 0xaa, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73) + o = msgp.AppendUint64(o, z.ReadTicks) + // string "write_ios" + o = append(o, 0xa9, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x69, 0x6f, 0x73) + o = msgp.AppendUint64(o, z.WriteIOs) + // string "write_merges" + o = append(o, 0xac, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x73) + o = msgp.AppendUint64(o, z.WriteMerges) + // string "wrte_sectors" + o = append(o, 0xac, 0x77, 0x72, 0x74, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73) + o = msgp.AppendUint64(o, z.WriteSectors) + // string "write_ticks" + o = append(o, 0xab, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73) + o = msgp.AppendUint64(o, z.WriteTicks) + // string "current_ios" + o = append(o, 0xab, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x6f, 0x73) + o = msgp.AppendUint64(o, z.CurrentIOs) + // string "total_ticks" + o = append(o, 0xab, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73) + o = msgp.AppendUint64(o, z.TotalTicks) + // string "req_ticks" + o = append(o, 0xa9, 0x72, 0x65, 0x71, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73) + o = msgp.AppendUint64(o, z.ReqTicks) + // string "discard_ios" + o = append(o, 0xab, 0x64, 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x69, 0x6f, 0x73) + o = msgp.AppendUint64(o, z.DiscardIOs) + // string "discard_merges" + o = append(o, 0xae, 0x64, 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x73) + o = msgp.AppendUint64(o, z.DiscardMerges) + // string "discard_secotrs" + o = append(o, 0xaf, 0x64, 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x74, 0x72, 0x73) + o = msgp.AppendUint64(o, z.DiscardSectors) + // string "discard_ticks" + o = append(o, 0xad, 0x64, 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73) + o = msgp.AppendUint64(o, z.DiscardTicks) + // string "flush_ios" + o = append(o, 0xa9, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x5f, 0x69, 0x6f, 0x73) + o = msgp.AppendUint64(o, z.FlushIOs) + // string "flush_ticks" + o = append(o, 0xab, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73) + o = msgp.AppendUint64(o, z.FlushTicks) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *DiskIOStats) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "read_ios": + z.ReadIOs, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ReadIOs") + return + } + case "read_merges": + z.ReadMerges, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ReadMerges") + return + } + case "read_sectors": + z.ReadSectors, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ReadSectors") + return + } + case "read_ticks": + z.ReadTicks, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ReadTicks") + return + } + case "write_ios": + z.WriteIOs, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "WriteIOs") + return + } + case "write_merges": + z.WriteMerges, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "WriteMerges") + return + } + case "wrte_sectors": + z.WriteSectors, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "WriteSectors") + return + } + case "write_ticks": + z.WriteTicks, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "WriteTicks") + return + } + case "current_ios": + z.CurrentIOs, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "CurrentIOs") + return + } + case "total_ticks": + z.TotalTicks, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "TotalTicks") + return + } + case "req_ticks": + z.ReqTicks, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ReqTicks") + return + } + case "discard_ios": + z.DiscardIOs, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "DiscardIOs") + return + } + case "discard_merges": + z.DiscardMerges, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "DiscardMerges") + return + } + case "discard_secotrs": + z.DiscardSectors, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "DiscardSectors") + return + } + case "discard_ticks": + z.DiscardTicks, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "DiscardTicks") + return + } + case "flush_ios": + z.FlushIOs, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "FlushIOs") + return + } + case "flush_ticks": + z.FlushTicks, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "FlushTicks") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *DiskIOStats) Msgsize() (s int) { + s = 3 + 9 + msgp.Uint64Size + 12 + msgp.Uint64Size + 13 + msgp.Uint64Size + 11 + msgp.Uint64Size + 10 + msgp.Uint64Size + 13 + msgp.Uint64Size + 13 + msgp.Uint64Size + 12 + msgp.Uint64Size + 12 + msgp.Uint64Size + 12 + msgp.Uint64Size + 10 + msgp.Uint64Size + 12 + msgp.Uint64Size + 15 + msgp.Uint64Size + 16 + msgp.Uint64Size + 14 + msgp.Uint64Size + 10 + msgp.Uint64Size + 12 + msgp.Uint64Size + return +} + +// DecodeMsg implements msgp.Decodable +func (z *DiskMetric) 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 /* 4 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "collected": + z.CollectedAt, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + case "n_disks": + z.NDisks, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "NDisks") + return + } + case "offline": + z.Offline, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "Offline") + return + } + zb0001Mask |= 0x1 + case "healing": + z.Healing, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "Healing") + return + } + zb0001Mask |= 0x2 + case "life_time_ops": + var zb0002 uint32 + zb0002, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps") + return + } + if z.LifeTimeOps == nil { + z.LifeTimeOps = make(map[string]uint64, zb0002) + } else if len(z.LifeTimeOps) > 0 { + for key := range z.LifeTimeOps { + delete(z.LifeTimeOps, key) + } + } + for zb0002 > 0 { + zb0002-- + var za0001 string + var za0002 uint64 + za0001, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps") + return + } + za0002, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps", za0001) + return + } + z.LifeTimeOps[za0001] = za0002 + } + zb0001Mask |= 0x4 + case "last_minute": + var zb0003 uint32 + zb0003, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "LastMinute") + return + } + var zb0003Mask uint8 /* 1 bits */ + _ = zb0003Mask + for zb0003 > 0 { + zb0003-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, "LastMinute") + return + } + switch msgp.UnsafeString(field) { + case "operations": + var zb0004 uint32 + zb0004, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Operations") + return + } + if z.LastMinute.Operations == nil { + z.LastMinute.Operations = make(map[string]TimedAction, zb0004) + } else if len(z.LastMinute.Operations) > 0 { + for key := range z.LastMinute.Operations { + delete(z.LastMinute.Operations, key) + } + } + for zb0004 > 0 { + zb0004-- + var za0003 string + var za0004 TimedAction + za0003, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Operations") + return + } + err = za0004.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Operations", za0003) + return + } + z.LastMinute.Operations[za0003] = za0004 + } + zb0003Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, "LastMinute") + return + } + } + } + // Clear omitted fields. + if zb0003Mask != 0x1 { + if (zb0003Mask & 0x1) == 0 { + z.LastMinute.Operations = nil + } + } + case "iostats": + err = z.IOStats.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "IOStats") + return + } + zb0001Mask |= 0x8 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0xf { + if (zb0001Mask & 0x1) == 0 { + z.Offline = 0 + } + if (zb0001Mask & 0x2) == 0 { + z.Healing = 0 + } + if (zb0001Mask & 0x4) == 0 { + z.LifeTimeOps = nil + } + if (zb0001Mask & 0x8) == 0 { + z.IOStats = DiskIOStats{} + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *DiskMetric) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(7) + var zb0001Mask uint8 /* 7 bits */ + _ = zb0001Mask + if z.Offline == 0 { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.Healing == 0 { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.LifeTimeOps == nil { + zb0001Len-- + zb0001Mask |= 0x10 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + // write "collected" + err = en.Append(0xa9, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteTime(z.CollectedAt) + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + // write "n_disks" + err = en.Append(0xa7, 0x6e, 0x5f, 0x64, 0x69, 0x73, 0x6b, 0x73) + if err != nil { + return + } + err = en.WriteInt(z.NDisks) + if err != nil { + err = msgp.WrapError(err, "NDisks") + return + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "offline" + err = en.Append(0xa7, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65) + if err != nil { + return + } + err = en.WriteInt(z.Offline) + if err != nil { + err = msgp.WrapError(err, "Offline") + return + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // write "healing" + err = en.Append(0xa7, 0x68, 0x65, 0x61, 0x6c, 0x69, 0x6e, 0x67) + if err != nil { + return + } + err = en.WriteInt(z.Healing) + if err != nil { + err = msgp.WrapError(err, "Healing") + return + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // write "life_time_ops" + err = en.Append(0xad, 0x6c, 0x69, 0x66, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6f, 0x70, 0x73) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.LifeTimeOps))) + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps") + return + } + for za0001, za0002 := range z.LifeTimeOps { + err = en.WriteString(za0001) + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps") + return + } + err = en.WriteUint64(za0002) + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps", za0001) + return + } + } + } + // write "last_minute" + err = en.Append(0xab, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65) + if err != nil { + return + } + // check for omitted fields + zb0002Len := uint32(1) + var zb0002Mask uint8 /* 1 bits */ + _ = zb0002Mask + if z.LastMinute.Operations == nil { + zb0002Len-- + zb0002Mask |= 0x1 + } + // variable map header, size zb0002Len + err = en.Append(0x80 | uint8(zb0002Len)) + if err != nil { + return + } + if (zb0002Mask & 0x1) == 0 { // if not omitted + // write "operations" + err = en.Append(0xaa, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.LastMinute.Operations))) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Operations") + return + } + for za0003, za0004 := range z.LastMinute.Operations { + err = en.WriteString(za0003) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Operations") + return + } + err = za0004.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Operations", za0003) + return + } + } + } + // write "iostats" + err = en.Append(0xa7, 0x69, 0x6f, 0x73, 0x74, 0x61, 0x74, 0x73) + if err != nil { + return + } + err = z.IOStats.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "IOStats") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *DiskMetric) 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.Offline == 0 { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.Healing == 0 { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.LifeTimeOps == nil { + zb0001Len-- + zb0001Mask |= 0x10 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + // string "collected" + o = append(o, 0xa9, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64) + o = msgp.AppendTime(o, z.CollectedAt) + // string "n_disks" + o = append(o, 0xa7, 0x6e, 0x5f, 0x64, 0x69, 0x73, 0x6b, 0x73) + o = msgp.AppendInt(o, z.NDisks) + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "offline" + o = append(o, 0xa7, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65) + o = msgp.AppendInt(o, z.Offline) + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // string "healing" + o = append(o, 0xa7, 0x68, 0x65, 0x61, 0x6c, 0x69, 0x6e, 0x67) + o = msgp.AppendInt(o, z.Healing) + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // string "life_time_ops" + o = append(o, 0xad, 0x6c, 0x69, 0x66, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6f, 0x70, 0x73) + o = msgp.AppendMapHeader(o, uint32(len(z.LifeTimeOps))) + for za0001, za0002 := range z.LifeTimeOps { + o = msgp.AppendString(o, za0001) + o = msgp.AppendUint64(o, za0002) + } + } + // string "last_minute" + o = append(o, 0xab, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65) + // check for omitted fields + zb0002Len := uint32(1) + var zb0002Mask uint8 /* 1 bits */ + _ = zb0002Mask + if z.LastMinute.Operations == nil { + zb0002Len-- + zb0002Mask |= 0x1 + } + // variable map header, size zb0002Len + o = append(o, 0x80|uint8(zb0002Len)) + if (zb0002Mask & 0x1) == 0 { // if not omitted + // string "operations" + o = append(o, 0xaa, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73) + o = msgp.AppendMapHeader(o, uint32(len(z.LastMinute.Operations))) + for za0003, za0004 := range z.LastMinute.Operations { + o = msgp.AppendString(o, za0003) + o, err = za0004.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Operations", za0003) + return + } + } + } + // string "iostats" + o = append(o, 0xa7, 0x69, 0x6f, 0x73, 0x74, 0x61, 0x74, 0x73) + o, err = z.IOStats.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "IOStats") + return + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *DiskMetric) 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 /* 4 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 "collected": + z.CollectedAt, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + case "n_disks": + z.NDisks, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "NDisks") + return + } + case "offline": + z.Offline, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Offline") + return + } + zb0001Mask |= 0x1 + case "healing": + z.Healing, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Healing") + return + } + zb0001Mask |= 0x2 + case "life_time_ops": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps") + return + } + if z.LifeTimeOps == nil { + z.LifeTimeOps = make(map[string]uint64, zb0002) + } else if len(z.LifeTimeOps) > 0 { + for key := range z.LifeTimeOps { + delete(z.LifeTimeOps, key) + } + } + for zb0002 > 0 { + var za0001 string + var za0002 uint64 + zb0002-- + za0001, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps") + return + } + za0002, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps", za0001) + return + } + z.LifeTimeOps[za0001] = za0002 + } + zb0001Mask |= 0x4 + case "last_minute": + var zb0003 uint32 + zb0003, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LastMinute") + return + } + var zb0003Mask uint8 /* 1 bits */ + _ = zb0003Mask + for zb0003 > 0 { + zb0003-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "LastMinute") + return + } + switch msgp.UnsafeString(field) { + case "operations": + var zb0004 uint32 + zb0004, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Operations") + return + } + if z.LastMinute.Operations == nil { + z.LastMinute.Operations = make(map[string]TimedAction, zb0004) + } else if len(z.LastMinute.Operations) > 0 { + for key := range z.LastMinute.Operations { + delete(z.LastMinute.Operations, key) + } + } + for zb0004 > 0 { + var za0003 string + var za0004 TimedAction + zb0004-- + za0003, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Operations") + return + } + bts, err = za0004.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Operations", za0003) + return + } + z.LastMinute.Operations[za0003] = za0004 + } + zb0003Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "LastMinute") + return + } + } + } + // Clear omitted fields. + if zb0003Mask != 0x1 { + if (zb0003Mask & 0x1) == 0 { + z.LastMinute.Operations = nil + } + } + case "iostats": + bts, err = z.IOStats.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "IOStats") + return + } + zb0001Mask |= 0x8 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0xf { + if (zb0001Mask & 0x1) == 0 { + z.Offline = 0 + } + if (zb0001Mask & 0x2) == 0 { + z.Healing = 0 + } + if (zb0001Mask & 0x4) == 0 { + z.LifeTimeOps = nil + } + if (zb0001Mask & 0x8) == 0 { + z.IOStats = DiskIOStats{} + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *DiskMetric) Msgsize() (s int) { + s = 1 + 10 + msgp.TimeSize + 8 + msgp.IntSize + 8 + msgp.IntSize + 8 + msgp.IntSize + 14 + msgp.MapHeaderSize + if z.LifeTimeOps != nil { + for za0001, za0002 := range z.LifeTimeOps { + _ = za0002 + s += msgp.StringPrefixSize + len(za0001) + msgp.Uint64Size + } + } + s += 12 + 1 + 11 + msgp.MapHeaderSize + if z.LastMinute.Operations != nil { + for za0003, za0004 := range z.LastMinute.Operations { + _ = za0004 + s += msgp.StringPrefixSize + len(za0003) + za0004.Msgsize() + } + } + s += 8 + z.IOStats.Msgsize() + return +} + +// DecodeMsg implements msgp.Decodable +func (z *ExpirationInfo) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "lastBucket": + z.Bucket, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Bucket") + return + } + case "lastObject": + z.Object, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Object") + return + } + case "objects": + z.Objects, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "Objects") + return + } + case "objectsFailed": + z.ObjectsFailed, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "ObjectsFailed") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *ExpirationInfo) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 4 + // write "lastBucket" + err = en.Append(0x84, 0xaa, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74) + if err != nil { + return + } + err = en.WriteString(z.Bucket) + if err != nil { + err = msgp.WrapError(err, "Bucket") + return + } + // write "lastObject" + err = en.Append(0xaa, 0x6c, 0x61, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74) + if err != nil { + return + } + err = en.WriteString(z.Object) + if err != nil { + err = msgp.WrapError(err, "Object") + return + } + // write "objects" + err = en.Append(0xa7, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteInt64(z.Objects) + if err != nil { + err = msgp.WrapError(err, "Objects") + return + } + // write "objectsFailed" + err = en.Append(0xad, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteInt64(z.ObjectsFailed) + if err != nil { + err = msgp.WrapError(err, "ObjectsFailed") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *ExpirationInfo) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 4 + // string "lastBucket" + o = append(o, 0x84, 0xaa, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74) + o = msgp.AppendString(o, z.Bucket) + // string "lastObject" + o = append(o, 0xaa, 0x6c, 0x61, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74) + o = msgp.AppendString(o, z.Object) + // string "objects" + o = append(o, 0xa7, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73) + o = msgp.AppendInt64(o, z.Objects) + // string "objectsFailed" + o = append(o, 0xad, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64) + o = msgp.AppendInt64(o, z.ObjectsFailed) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *ExpirationInfo) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "lastBucket": + z.Bucket, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Bucket") + return + } + case "lastObject": + z.Object, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Object") + return + } + case "objects": + z.Objects, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Objects") + return + } + case "objectsFailed": + z.ObjectsFailed, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ObjectsFailed") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *ExpirationInfo) Msgsize() (s int) { + s = 1 + 11 + msgp.StringPrefixSize + len(z.Bucket) + 11 + msgp.StringPrefixSize + len(z.Object) + 8 + msgp.Int64Size + 14 + msgp.Int64Size + return +} + +// DecodeMsg implements msgp.Decodable +func (z *JobMetric) 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 /* 3 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "jobID": + z.JobID, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "JobID") + return + } + case "jobType": + z.JobType, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "JobType") + return + } + case "startTime": + z.StartTime, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "StartTime") + return + } + case "lastUpdate": + z.LastUpdate, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "LastUpdate") + return + } + case "retryAttempts": + z.RetryAttempts, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "RetryAttempts") + return + } + case "complete": + z.Complete, err = dc.ReadBool() + if err != nil { + err = msgp.WrapError(err, "Complete") + return + } + case "failed": + z.Failed, err = dc.ReadBool() + if err != nil { + err = msgp.WrapError(err, "Failed") + return + } + case "replicate": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "Replicate") + return + } + z.Replicate = nil + } else { + if z.Replicate == nil { + z.Replicate = new(ReplicateInfo) + } + err = z.Replicate.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Replicate") + return + } + } + zb0001Mask |= 0x1 + case "rotation": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "KeyRotate") + return + } + z.KeyRotate = nil + } else { + if z.KeyRotate == nil { + z.KeyRotate = new(KeyRotationInfo) + } + err = z.KeyRotate.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "KeyRotate") + return + } + } + zb0001Mask |= 0x2 + case "expired": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "Expired") + return + } + z.Expired = nil + } else { + if z.Expired == nil { + z.Expired = new(ExpirationInfo) + } + err = z.Expired.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Expired") + return + } + } + zb0001Mask |= 0x4 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x7 { + if (zb0001Mask & 0x1) == 0 { + z.Replicate = nil + } + if (zb0001Mask & 0x2) == 0 { + z.KeyRotate = nil + } + if (zb0001Mask & 0x4) == 0 { + z.Expired = nil + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *JobMetric) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(10) + var zb0001Mask uint16 /* 10 bits */ + _ = zb0001Mask + if z.Replicate == nil { + zb0001Len-- + zb0001Mask |= 0x80 + } + if z.KeyRotate == nil { + zb0001Len-- + zb0001Mask |= 0x100 + } + if z.Expired == nil { + zb0001Len-- + zb0001Mask |= 0x200 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + // write "jobID" + err = en.Append(0xa5, 0x6a, 0x6f, 0x62, 0x49, 0x44) + if err != nil { + return + } + err = en.WriteString(z.JobID) + if err != nil { + err = msgp.WrapError(err, "JobID") + return + } + // write "jobType" + err = en.Append(0xa7, 0x6a, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65) + if err != nil { + return + } + err = en.WriteString(z.JobType) + if err != nil { + err = msgp.WrapError(err, "JobType") + return + } + // write "startTime" + err = en.Append(0xa9, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteTime(z.StartTime) + if err != nil { + err = msgp.WrapError(err, "StartTime") + return + } + // write "lastUpdate" + err = en.Append(0xaa, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65) + if err != nil { + return + } + err = en.WriteTime(z.LastUpdate) + if err != nil { + err = msgp.WrapError(err, "LastUpdate") + return + } + // write "retryAttempts" + err = en.Append(0xad, 0x72, 0x65, 0x74, 0x72, 0x79, 0x41, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteInt(z.RetryAttempts) + if err != nil { + err = msgp.WrapError(err, "RetryAttempts") + return + } + // write "complete" + err = en.Append(0xa8, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65) + if err != nil { + return + } + err = en.WriteBool(z.Complete) + if err != nil { + err = msgp.WrapError(err, "Complete") + return + } + // write "failed" + err = en.Append(0xa6, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteBool(z.Failed) + if err != nil { + err = msgp.WrapError(err, "Failed") + return + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // write "replicate" + err = en.Append(0xa9, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65) + if err != nil { + return + } + if z.Replicate == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.Replicate.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Replicate") + return + } + } + } + if (zb0001Mask & 0x100) == 0 { // if not omitted + // write "rotation" + err = en.Append(0xa8, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e) + if err != nil { + return + } + if z.KeyRotate == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.KeyRotate.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "KeyRotate") + return + } + } + } + if (zb0001Mask & 0x200) == 0 { // if not omitted + // write "expired" + err = en.Append(0xa7, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64) + if err != nil { + return + } + if z.Expired == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.Expired.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Expired") + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *JobMetric) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(10) + var zb0001Mask uint16 /* 10 bits */ + _ = zb0001Mask + if z.Replicate == nil { + zb0001Len-- + zb0001Mask |= 0x80 + } + if z.KeyRotate == nil { + zb0001Len-- + zb0001Mask |= 0x100 + } + if z.Expired == nil { + zb0001Len-- + zb0001Mask |= 0x200 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + // string "jobID" + o = append(o, 0xa5, 0x6a, 0x6f, 0x62, 0x49, 0x44) + o = msgp.AppendString(o, z.JobID) + // string "jobType" + o = append(o, 0xa7, 0x6a, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65) + o = msgp.AppendString(o, z.JobType) + // string "startTime" + o = append(o, 0xa9, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65) + o = msgp.AppendTime(o, z.StartTime) + // string "lastUpdate" + o = append(o, 0xaa, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65) + o = msgp.AppendTime(o, z.LastUpdate) + // string "retryAttempts" + o = append(o, 0xad, 0x72, 0x65, 0x74, 0x72, 0x79, 0x41, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x73) + o = msgp.AppendInt(o, z.RetryAttempts) + // string "complete" + o = append(o, 0xa8, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65) + o = msgp.AppendBool(o, z.Complete) + // string "failed" + o = append(o, 0xa6, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64) + o = msgp.AppendBool(o, z.Failed) + if (zb0001Mask & 0x80) == 0 { // if not omitted + // string "replicate" + o = append(o, 0xa9, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65) + if z.Replicate == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.Replicate.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Replicate") + return + } + } + } + if (zb0001Mask & 0x100) == 0 { // if not omitted + // string "rotation" + o = append(o, 0xa8, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e) + if z.KeyRotate == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.KeyRotate.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "KeyRotate") + return + } + } + } + if (zb0001Mask & 0x200) == 0 { // if not omitted + // string "expired" + o = append(o, 0xa7, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64) + if z.Expired == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.Expired.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Expired") + return + } + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *JobMetric) 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 /* 3 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 "jobID": + z.JobID, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "JobID") + return + } + case "jobType": + z.JobType, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "JobType") + return + } + case "startTime": + z.StartTime, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "StartTime") + return + } + case "lastUpdate": + z.LastUpdate, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LastUpdate") + return + } + case "retryAttempts": + z.RetryAttempts, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "RetryAttempts") + return + } + case "complete": + z.Complete, bts, err = msgp.ReadBoolBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Complete") + return + } + case "failed": + z.Failed, bts, err = msgp.ReadBoolBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Failed") + return + } + case "replicate": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.Replicate = nil + } else { + if z.Replicate == nil { + z.Replicate = new(ReplicateInfo) + } + bts, err = z.Replicate.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Replicate") + return + } + } + zb0001Mask |= 0x1 + case "rotation": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.KeyRotate = nil + } else { + if z.KeyRotate == nil { + z.KeyRotate = new(KeyRotationInfo) + } + bts, err = z.KeyRotate.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "KeyRotate") + return + } + } + zb0001Mask |= 0x2 + case "expired": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.Expired = nil + } else { + if z.Expired == nil { + z.Expired = new(ExpirationInfo) + } + bts, err = z.Expired.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Expired") + return + } + } + zb0001Mask |= 0x4 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x7 { + if (zb0001Mask & 0x1) == 0 { + z.Replicate = nil + } + if (zb0001Mask & 0x2) == 0 { + z.KeyRotate = nil + } + if (zb0001Mask & 0x4) == 0 { + z.Expired = nil + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *JobMetric) Msgsize() (s int) { + s = 1 + 6 + msgp.StringPrefixSize + len(z.JobID) + 8 + msgp.StringPrefixSize + len(z.JobType) + 10 + msgp.TimeSize + 11 + msgp.TimeSize + 14 + msgp.IntSize + 9 + msgp.BoolSize + 7 + msgp.BoolSize + 10 + if z.Replicate == nil { + s += msgp.NilSize + } else { + s += z.Replicate.Msgsize() + } + s += 9 + if z.KeyRotate == nil { + s += msgp.NilSize + } else { + s += z.KeyRotate.Msgsize() + } + s += 8 + if z.Expired == nil { + s += msgp.NilSize + } else { + s += z.Expired.Msgsize() + } + return +} + +// DecodeMsg implements msgp.Decodable +func (z *KeyRotationInfo) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "lastBucket": + z.Bucket, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Bucket") + return + } + case "lastObject": + z.Object, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Object") + return + } + case "objects": + z.Objects, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "Objects") + return + } + case "objectsFailed": + z.ObjectsFailed, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "ObjectsFailed") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *KeyRotationInfo) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 4 + // write "lastBucket" + err = en.Append(0x84, 0xaa, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74) + if err != nil { + return + } + err = en.WriteString(z.Bucket) + if err != nil { + err = msgp.WrapError(err, "Bucket") + return + } + // write "lastObject" + err = en.Append(0xaa, 0x6c, 0x61, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74) + if err != nil { + return + } + err = en.WriteString(z.Object) + if err != nil { + err = msgp.WrapError(err, "Object") + return + } + // write "objects" + err = en.Append(0xa7, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteInt64(z.Objects) + if err != nil { + err = msgp.WrapError(err, "Objects") + return + } + // write "objectsFailed" + err = en.Append(0xad, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteInt64(z.ObjectsFailed) + if err != nil { + err = msgp.WrapError(err, "ObjectsFailed") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *KeyRotationInfo) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 4 + // string "lastBucket" + o = append(o, 0x84, 0xaa, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74) + o = msgp.AppendString(o, z.Bucket) + // string "lastObject" + o = append(o, 0xaa, 0x6c, 0x61, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74) + o = msgp.AppendString(o, z.Object) + // string "objects" + o = append(o, 0xa7, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73) + o = msgp.AppendInt64(o, z.Objects) + // string "objectsFailed" + o = append(o, 0xad, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64) + o = msgp.AppendInt64(o, z.ObjectsFailed) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *KeyRotationInfo) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "lastBucket": + z.Bucket, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Bucket") + return + } + case "lastObject": + z.Object, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Object") + return + } + case "objects": + z.Objects, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Objects") + return + } + case "objectsFailed": + z.ObjectsFailed, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ObjectsFailed") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *KeyRotationInfo) Msgsize() (s int) { + s = 1 + 11 + msgp.StringPrefixSize + len(z.Bucket) + 11 + msgp.StringPrefixSize + len(z.Object) + 8 + msgp.Int64Size + 14 + msgp.Int64Size + return +} + +// DecodeMsg implements msgp.Decodable +func (z *MemInfo) 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 uint16 /* 10 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "NodeCommon": + err = z.NodeCommon.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "NodeCommon") + return + } + case "total": + z.Total, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "Total") + return + } + zb0001Mask |= 0x1 + case "used": + z.Used, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "Used") + return + } + zb0001Mask |= 0x2 + case "free": + z.Free, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "Free") + return + } + zb0001Mask |= 0x4 + case "available": + z.Available, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "Available") + return + } + zb0001Mask |= 0x8 + case "shared": + z.Shared, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "Shared") + return + } + zb0001Mask |= 0x10 + case "cache": + z.Cache, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "Cache") + return + } + zb0001Mask |= 0x20 + case "buffer": + z.Buffers, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "Buffers") + return + } + zb0001Mask |= 0x40 + case "swap_space_total": + z.SwapSpaceTotal, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "SwapSpaceTotal") + return + } + zb0001Mask |= 0x80 + case "swap_space_free": + z.SwapSpaceFree, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "SwapSpaceFree") + return + } + zb0001Mask |= 0x100 + case "limit": + z.Limit, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "Limit") + return + } + zb0001Mask |= 0x200 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x3ff { + if (zb0001Mask & 0x1) == 0 { + z.Total = 0 + } + if (zb0001Mask & 0x2) == 0 { + z.Used = 0 + } + if (zb0001Mask & 0x4) == 0 { + z.Free = 0 + } + if (zb0001Mask & 0x8) == 0 { + z.Available = 0 + } + if (zb0001Mask & 0x10) == 0 { + z.Shared = 0 + } + if (zb0001Mask & 0x20) == 0 { + z.Cache = 0 + } + if (zb0001Mask & 0x40) == 0 { + z.Buffers = 0 + } + if (zb0001Mask & 0x80) == 0 { + z.SwapSpaceTotal = 0 + } + if (zb0001Mask & 0x100) == 0 { + z.SwapSpaceFree = 0 + } + if (zb0001Mask & 0x200) == 0 { + z.Limit = 0 + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *MemInfo) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(11) + var zb0001Mask uint16 /* 11 bits */ + _ = zb0001Mask + if z.Total == 0 { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.Used == 0 { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.Free == 0 { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.Available == 0 { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.Shared == 0 { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.Cache == 0 { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.Buffers == 0 { + zb0001Len-- + zb0001Mask |= 0x80 + } + if z.SwapSpaceTotal == 0 { + zb0001Len-- + zb0001Mask |= 0x100 + } + if z.SwapSpaceFree == 0 { + zb0001Len-- + zb0001Mask |= 0x200 + } + if z.Limit == 0 { + zb0001Len-- + zb0001Mask |= 0x400 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + // write "NodeCommon" + err = en.Append(0xaa, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e) + if err != nil { + return + } + err = z.NodeCommon.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "NodeCommon") + return + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "total" + err = en.Append(0xa5, 0x74, 0x6f, 0x74, 0x61, 0x6c) + if err != nil { + return + } + err = en.WriteUint64(z.Total) + if err != nil { + err = msgp.WrapError(err, "Total") + return + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "used" + err = en.Append(0xa4, 0x75, 0x73, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteUint64(z.Used) + if err != nil { + err = msgp.WrapError(err, "Used") + return + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // write "free" + err = en.Append(0xa4, 0x66, 0x72, 0x65, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.Free) + if err != nil { + err = msgp.WrapError(err, "Free") + return + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // write "available" + err = en.Append(0xa9, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.Available) + if err != nil { + err = msgp.WrapError(err, "Available") + return + } + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // write "shared" + err = en.Append(0xa6, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteUint64(z.Shared) + if err != nil { + err = msgp.WrapError(err, "Shared") + return + } + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // write "cache" + err = en.Append(0xa5, 0x63, 0x61, 0x63, 0x68, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.Cache) + if err != nil { + err = msgp.WrapError(err, "Cache") + return + } + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // write "buffer" + err = en.Append(0xa6, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72) + if err != nil { + return + } + err = en.WriteUint64(z.Buffers) + if err != nil { + err = msgp.WrapError(err, "Buffers") + return + } + } + if (zb0001Mask & 0x100) == 0 { // if not omitted + // write "swap_space_total" + err = en.Append(0xb0, 0x73, 0x77, 0x61, 0x70, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c) + if err != nil { + return + } + err = en.WriteUint64(z.SwapSpaceTotal) + if err != nil { + err = msgp.WrapError(err, "SwapSpaceTotal") + return + } + } + if (zb0001Mask & 0x200) == 0 { // if not omitted + // write "swap_space_free" + err = en.Append(0xaf, 0x73, 0x77, 0x61, 0x70, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x66, 0x72, 0x65, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.SwapSpaceFree) + if err != nil { + err = msgp.WrapError(err, "SwapSpaceFree") + return + } + } + if (zb0001Mask & 0x400) == 0 { // if not omitted + // write "limit" + err = en.Append(0xa5, 0x6c, 0x69, 0x6d, 0x69, 0x74) + if err != nil { + return + } + err = en.WriteUint64(z.Limit) + if err != nil { + err = msgp.WrapError(err, "Limit") + return + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *MemInfo) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(11) + var zb0001Mask uint16 /* 11 bits */ + _ = zb0001Mask + if z.Total == 0 { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.Used == 0 { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.Free == 0 { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.Available == 0 { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.Shared == 0 { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.Cache == 0 { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.Buffers == 0 { + zb0001Len-- + zb0001Mask |= 0x80 + } + if z.SwapSpaceTotal == 0 { + zb0001Len-- + zb0001Mask |= 0x100 + } + if z.SwapSpaceFree == 0 { + zb0001Len-- + zb0001Mask |= 0x200 + } + if z.Limit == 0 { + zb0001Len-- + zb0001Mask |= 0x400 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + // string "NodeCommon" + o = append(o, 0xaa, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e) + o, err = z.NodeCommon.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "NodeCommon") + return + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "total" + o = append(o, 0xa5, 0x74, 0x6f, 0x74, 0x61, 0x6c) + o = msgp.AppendUint64(o, z.Total) + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "used" + o = append(o, 0xa4, 0x75, 0x73, 0x65, 0x64) + o = msgp.AppendUint64(o, z.Used) + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // string "free" + o = append(o, 0xa4, 0x66, 0x72, 0x65, 0x65) + o = msgp.AppendUint64(o, z.Free) + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // string "available" + o = append(o, 0xa9, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65) + o = msgp.AppendUint64(o, z.Available) + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // string "shared" + o = append(o, 0xa6, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64) + o = msgp.AppendUint64(o, z.Shared) + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // string "cache" + o = append(o, 0xa5, 0x63, 0x61, 0x63, 0x68, 0x65) + o = msgp.AppendUint64(o, z.Cache) + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // string "buffer" + o = append(o, 0xa6, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72) + o = msgp.AppendUint64(o, z.Buffers) + } + if (zb0001Mask & 0x100) == 0 { // if not omitted + // string "swap_space_total" + o = append(o, 0xb0, 0x73, 0x77, 0x61, 0x70, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c) + o = msgp.AppendUint64(o, z.SwapSpaceTotal) + } + if (zb0001Mask & 0x200) == 0 { // if not omitted + // string "swap_space_free" + o = append(o, 0xaf, 0x73, 0x77, 0x61, 0x70, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x66, 0x72, 0x65, 0x65) + o = msgp.AppendUint64(o, z.SwapSpaceFree) + } + if (zb0001Mask & 0x400) == 0 { // if not omitted + // string "limit" + o = append(o, 0xa5, 0x6c, 0x69, 0x6d, 0x69, 0x74) + o = msgp.AppendUint64(o, z.Limit) + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *MemInfo) 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 uint16 /* 10 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 "NodeCommon": + bts, err = z.NodeCommon.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "NodeCommon") + return + } + case "total": + z.Total, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Total") + return + } + zb0001Mask |= 0x1 + case "used": + z.Used, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Used") + return + } + zb0001Mask |= 0x2 + case "free": + z.Free, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Free") + return + } + zb0001Mask |= 0x4 + case "available": + z.Available, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Available") + return + } + zb0001Mask |= 0x8 + case "shared": + z.Shared, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Shared") + return + } + zb0001Mask |= 0x10 + case "cache": + z.Cache, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Cache") + return + } + zb0001Mask |= 0x20 + case "buffer": + z.Buffers, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Buffers") + return + } + zb0001Mask |= 0x40 + case "swap_space_total": + z.SwapSpaceTotal, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "SwapSpaceTotal") + return + } + zb0001Mask |= 0x80 + case "swap_space_free": + z.SwapSpaceFree, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "SwapSpaceFree") + return + } + zb0001Mask |= 0x100 + case "limit": + z.Limit, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Limit") + return + } + zb0001Mask |= 0x200 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x3ff { + if (zb0001Mask & 0x1) == 0 { + z.Total = 0 + } + if (zb0001Mask & 0x2) == 0 { + z.Used = 0 + } + if (zb0001Mask & 0x4) == 0 { + z.Free = 0 + } + if (zb0001Mask & 0x8) == 0 { + z.Available = 0 + } + if (zb0001Mask & 0x10) == 0 { + z.Shared = 0 + } + if (zb0001Mask & 0x20) == 0 { + z.Cache = 0 + } + if (zb0001Mask & 0x40) == 0 { + z.Buffers = 0 + } + if (zb0001Mask & 0x80) == 0 { + z.SwapSpaceTotal = 0 + } + if (zb0001Mask & 0x100) == 0 { + z.SwapSpaceFree = 0 + } + if (zb0001Mask & 0x200) == 0 { + z.Limit = 0 + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *MemInfo) Msgsize() (s int) { + s = 1 + 11 + z.NodeCommon.Msgsize() + 6 + msgp.Uint64Size + 5 + msgp.Uint64Size + 5 + msgp.Uint64Size + 10 + msgp.Uint64Size + 7 + msgp.Uint64Size + 6 + msgp.Uint64Size + 7 + msgp.Uint64Size + 17 + msgp.Uint64Size + 16 + msgp.Uint64Size + 6 + msgp.Uint64Size + return +} + +// DecodeMsg implements msgp.Decodable +func (z *MemMetrics) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "collected": + z.CollectedAt, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + case "memInfo": + err = z.Info.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Info") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *MemMetrics) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 2 + // write "collected" + err = en.Append(0x82, 0xa9, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteTime(z.CollectedAt) + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + // write "memInfo" + err = en.Append(0xa7, 0x6d, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f) + if err != nil { + return + } + err = z.Info.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Info") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *MemMetrics) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 2 + // string "collected" + o = append(o, 0x82, 0xa9, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64) + o = msgp.AppendTime(o, z.CollectedAt) + // string "memInfo" + o = append(o, 0xa7, 0x6d, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f) + o, err = z.Info.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Info") + return + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *MemMetrics) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "collected": + z.CollectedAt, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + case "memInfo": + bts, err = z.Info.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Info") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *MemMetrics) Msgsize() (s int) { + s = 1 + 10 + msgp.TimeSize + 8 + z.Info.Msgsize() + return +} + +// DecodeMsg implements msgp.Decodable +func (z *MetricType) DecodeMsg(dc *msgp.Reader) (err error) { + { + var zb0001 uint32 + zb0001, err = dc.ReadUint32() + if err != nil { + err = msgp.WrapError(err) + return + } + (*z) = MetricType(zb0001) + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z MetricType) EncodeMsg(en *msgp.Writer) (err error) { + err = en.WriteUint32(uint32(z)) + if err != nil { + err = msgp.WrapError(err) + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z MetricType) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + o = msgp.AppendUint32(o, uint32(z)) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *MetricType) UnmarshalMsg(bts []byte) (o []byte, err error) { + { + var zb0001 uint32 + zb0001, bts, err = msgp.ReadUint32Bytes(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + (*z) = MetricType(zb0001) + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z MetricType) Msgsize() (s int) { + s = msgp.Uint32Size + return +} + +// DecodeMsg implements msgp.Decodable +func (z *Metrics) 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 uint16 /* 9 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "scanner": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "Scanner") + return + } + z.Scanner = nil + } else { + if z.Scanner == nil { + z.Scanner = new(ScannerMetrics) + } + err = z.Scanner.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Scanner") + return + } + } + zb0001Mask |= 0x1 + case "disk": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "Disk") + return + } + z.Disk = nil + } else { + if z.Disk == nil { + z.Disk = new(DiskMetric) + } + err = z.Disk.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Disk") + return + } + } + zb0001Mask |= 0x2 + case "os": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "OS") + return + } + z.OS = nil + } else { + if z.OS == nil { + z.OS = new(OSMetrics) + } + err = z.OS.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "OS") + return + } + } + zb0001Mask |= 0x4 + case "batchJobs": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "BatchJobs") + return + } + z.BatchJobs = nil + } else { + if z.BatchJobs == nil { + z.BatchJobs = new(BatchJobMetrics) + } + err = z.BatchJobs.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "BatchJobs") + return + } + } + zb0001Mask |= 0x8 + case "siteResync": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "SiteResync") + return + } + z.SiteResync = nil + } else { + if z.SiteResync == nil { + z.SiteResync = new(SiteResyncMetrics) + } + err = z.SiteResync.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "SiteResync") + return + } + } + zb0001Mask |= 0x10 + case "net": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "Net") + return + } + z.Net = nil + } else { + if z.Net == nil { + z.Net = new(NetMetrics) + } + var zb0002 uint32 + zb0002, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "Net") + return + } + for zb0002 > 0 { + zb0002-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, "Net") + return + } + switch msgp.UnsafeString(field) { + case "collected": + z.Net.CollectedAt, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "Net", "CollectedAt") + return + } + case "interfaceName": + z.Net.InterfaceName, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Net", "InterfaceName") + return + } + case "netstats": + err = (*procfsNetDevLine)(&z.Net.NetStats).DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Net", "NetStats") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, "Net") + return + } + } + } + } + zb0001Mask |= 0x20 + case "mem": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "Mem") + return + } + z.Mem = nil + } else { + if z.Mem == nil { + z.Mem = new(MemMetrics) + } + var zb0003 uint32 + zb0003, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "Mem") + return + } + for zb0003 > 0 { + zb0003-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, "Mem") + return + } + switch msgp.UnsafeString(field) { + case "collected": + z.Mem.CollectedAt, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "Mem", "CollectedAt") + return + } + case "memInfo": + err = z.Mem.Info.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Mem", "Info") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, "Mem") + return + } + } + } + } + zb0001Mask |= 0x40 + case "cpu": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "CPU") + return + } + z.CPU = nil + } else { + if z.CPU == nil { + z.CPU = new(CPUMetrics) + } + err = z.CPU.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "CPU") + return + } + } + zb0001Mask |= 0x80 + case "rpc": + if dc.IsNil() { + err = dc.ReadNil() + if err != nil { + err = msgp.WrapError(err, "RPC") + return + } + z.RPC = nil + } else { + if z.RPC == nil { + z.RPC = new(RPCMetrics) + } + err = z.RPC.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "RPC") + return + } + } + zb0001Mask |= 0x100 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1ff { + if (zb0001Mask & 0x1) == 0 { + z.Scanner = nil + } + if (zb0001Mask & 0x2) == 0 { + z.Disk = nil + } + if (zb0001Mask & 0x4) == 0 { + z.OS = nil + } + if (zb0001Mask & 0x8) == 0 { + z.BatchJobs = nil + } + if (zb0001Mask & 0x10) == 0 { + z.SiteResync = nil + } + if (zb0001Mask & 0x20) == 0 { + z.Net = nil + } + if (zb0001Mask & 0x40) == 0 { + z.Mem = nil + } + if (zb0001Mask & 0x80) == 0 { + z.CPU = nil + } + if (zb0001Mask & 0x100) == 0 { + z.RPC = nil + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *Metrics) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(9) + var zb0001Mask uint16 /* 9 bits */ + _ = zb0001Mask + if z.Scanner == nil { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.Disk == nil { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.OS == nil { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.BatchJobs == nil { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.SiteResync == nil { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.Net == nil { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.Mem == nil { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.CPU == nil { + zb0001Len-- + zb0001Mask |= 0x80 + } + if z.RPC == nil { + zb0001Len-- + zb0001Mask |= 0x100 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + if (zb0001Mask & 0x1) == 0 { // if not omitted + // write "scanner" + err = en.Append(0xa7, 0x73, 0x63, 0x61, 0x6e, 0x6e, 0x65, 0x72) + if err != nil { + return + } + if z.Scanner == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.Scanner.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Scanner") + return + } + } + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "disk" + err = en.Append(0xa4, 0x64, 0x69, 0x73, 0x6b) + if err != nil { + return + } + if z.Disk == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.Disk.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Disk") + return + } + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "os" + err = en.Append(0xa2, 0x6f, 0x73) + if err != nil { + return + } + if z.OS == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.OS.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "OS") + return + } + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // write "batchJobs" + err = en.Append(0xa9, 0x62, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x73) + if err != nil { + return + } + if z.BatchJobs == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.BatchJobs.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "BatchJobs") + return + } + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // write "siteResync" + err = en.Append(0xaa, 0x73, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x79, 0x6e, 0x63) + if err != nil { + return + } + if z.SiteResync == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.SiteResync.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "SiteResync") + return + } + } + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // write "net" + err = en.Append(0xa3, 0x6e, 0x65, 0x74) + if err != nil { + return + } + if z.Net == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + // map header, size 3 + // write "collected" + err = en.Append(0x83, 0xa9, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteTime(z.Net.CollectedAt) + if err != nil { + err = msgp.WrapError(err, "Net", "CollectedAt") + return + } + // write "interfaceName" + err = en.Append(0xad, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteString(z.Net.InterfaceName) + if err != nil { + err = msgp.WrapError(err, "Net", "InterfaceName") + return + } + // write "netstats" + err = en.Append(0xa8, 0x6e, 0x65, 0x74, 0x73, 0x74, 0x61, 0x74, 0x73) + if err != nil { + return + } + err = (*procfsNetDevLine)(&z.Net.NetStats).EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Net", "NetStats") + return + } + } + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // write "mem" + err = en.Append(0xa3, 0x6d, 0x65, 0x6d) + if err != nil { + return + } + if z.Mem == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + // map header, size 2 + // write "collected" + err = en.Append(0x82, 0xa9, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteTime(z.Mem.CollectedAt) + if err != nil { + err = msgp.WrapError(err, "Mem", "CollectedAt") + return + } + // write "memInfo" + err = en.Append(0xa7, 0x6d, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f) + if err != nil { + return + } + err = z.Mem.Info.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Mem", "Info") + return + } + } + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // write "cpu" + err = en.Append(0xa3, 0x63, 0x70, 0x75) + if err != nil { + return + } + if z.CPU == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.CPU.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "CPU") + return + } + } + } + if (zb0001Mask & 0x100) == 0 { // if not omitted + // write "rpc" + err = en.Append(0xa3, 0x72, 0x70, 0x63) + if err != nil { + return + } + if z.RPC == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.RPC.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "RPC") + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *Metrics) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(9) + var zb0001Mask uint16 /* 9 bits */ + _ = zb0001Mask + if z.Scanner == nil { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.Disk == nil { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.OS == nil { + zb0001Len-- + zb0001Mask |= 0x4 + } + if z.BatchJobs == nil { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.SiteResync == nil { + zb0001Len-- + zb0001Mask |= 0x10 + } + if z.Net == nil { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.Mem == nil { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.CPU == nil { + zb0001Len-- + zb0001Mask |= 0x80 + } + if z.RPC == nil { + zb0001Len-- + zb0001Mask |= 0x100 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + if (zb0001Mask & 0x1) == 0 { // if not omitted + // string "scanner" + o = append(o, 0xa7, 0x73, 0x63, 0x61, 0x6e, 0x6e, 0x65, 0x72) + if z.Scanner == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.Scanner.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Scanner") + return + } + } + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "disk" + o = append(o, 0xa4, 0x64, 0x69, 0x73, 0x6b) + if z.Disk == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.Disk.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Disk") + return + } + } + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "os" + o = append(o, 0xa2, 0x6f, 0x73) + if z.OS == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.OS.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "OS") + return + } + } + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // string "batchJobs" + o = append(o, 0xa9, 0x62, 0x61, 0x74, 0x63, 0x68, 0x4a, 0x6f, 0x62, 0x73) + if z.BatchJobs == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.BatchJobs.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "BatchJobs") + return + } + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // string "siteResync" + o = append(o, 0xaa, 0x73, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x79, 0x6e, 0x63) + if z.SiteResync == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.SiteResync.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "SiteResync") + return + } + } + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // string "net" + o = append(o, 0xa3, 0x6e, 0x65, 0x74) + if z.Net == nil { + o = msgp.AppendNil(o) + } else { + // map header, size 3 + // string "collected" + o = append(o, 0x83, 0xa9, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64) + o = msgp.AppendTime(o, z.Net.CollectedAt) + // string "interfaceName" + o = append(o, 0xad, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65) + o = msgp.AppendString(o, z.Net.InterfaceName) + // string "netstats" + o = append(o, 0xa8, 0x6e, 0x65, 0x74, 0x73, 0x74, 0x61, 0x74, 0x73) + o, err = (*procfsNetDevLine)(&z.Net.NetStats).MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Net", "NetStats") + return + } + } + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // string "mem" + o = append(o, 0xa3, 0x6d, 0x65, 0x6d) + if z.Mem == nil { + o = msgp.AppendNil(o) + } else { + // map header, size 2 + // string "collected" + o = append(o, 0x82, 0xa9, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64) + o = msgp.AppendTime(o, z.Mem.CollectedAt) + // string "memInfo" + o = append(o, 0xa7, 0x6d, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f) + o, err = z.Mem.Info.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Mem", "Info") + return + } + } + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // string "cpu" + o = append(o, 0xa3, 0x63, 0x70, 0x75) + if z.CPU == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.CPU.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "CPU") + return + } + } + } + if (zb0001Mask & 0x100) == 0 { // if not omitted + // string "rpc" + o = append(o, 0xa3, 0x72, 0x70, 0x63) + if z.RPC == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.RPC.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "RPC") + return + } + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *Metrics) 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 uint16 /* 9 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 "scanner": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.Scanner = nil + } else { + if z.Scanner == nil { + z.Scanner = new(ScannerMetrics) + } + bts, err = z.Scanner.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Scanner") + return + } + } + zb0001Mask |= 0x1 + case "disk": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.Disk = nil + } else { + if z.Disk == nil { + z.Disk = new(DiskMetric) + } + bts, err = z.Disk.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Disk") + return + } + } + zb0001Mask |= 0x2 + case "os": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.OS = nil + } else { + if z.OS == nil { + z.OS = new(OSMetrics) + } + bts, err = z.OS.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "OS") + return + } + } + zb0001Mask |= 0x4 + case "batchJobs": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.BatchJobs = nil + } else { + if z.BatchJobs == nil { + z.BatchJobs = new(BatchJobMetrics) + } + bts, err = z.BatchJobs.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "BatchJobs") + return + } + } + zb0001Mask |= 0x8 + case "siteResync": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.SiteResync = nil + } else { + if z.SiteResync == nil { + z.SiteResync = new(SiteResyncMetrics) + } + bts, err = z.SiteResync.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "SiteResync") + return + } + } + zb0001Mask |= 0x10 + case "net": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.Net = nil + } else { + if z.Net == nil { + z.Net = new(NetMetrics) + } + var zb0002 uint32 + zb0002, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Net") + return + } + for zb0002 > 0 { + zb0002-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "Net") + return + } + switch msgp.UnsafeString(field) { + case "collected": + z.Net.CollectedAt, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Net", "CollectedAt") + return + } + case "interfaceName": + z.Net.InterfaceName, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Net", "InterfaceName") + return + } + case "netstats": + bts, err = (*procfsNetDevLine)(&z.Net.NetStats).UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Net", "NetStats") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "Net") + return + } + } + } + } + zb0001Mask |= 0x20 + case "mem": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.Mem = nil + } else { + if z.Mem == nil { + z.Mem = new(MemMetrics) + } + var zb0003 uint32 + zb0003, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Mem") + return + } + for zb0003 > 0 { + zb0003-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "Mem") + return + } + switch msgp.UnsafeString(field) { + case "collected": + z.Mem.CollectedAt, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Mem", "CollectedAt") + return + } + case "memInfo": + bts, err = z.Mem.Info.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Mem", "Info") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "Mem") + return + } + } + } + } + zb0001Mask |= 0x40 + case "cpu": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.CPU = nil + } else { + if z.CPU == nil { + z.CPU = new(CPUMetrics) + } + bts, err = z.CPU.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "CPU") + return + } + } + zb0001Mask |= 0x80 + case "rpc": + if msgp.IsNil(bts) { + bts, err = msgp.ReadNilBytes(bts) + if err != nil { + return + } + z.RPC = nil + } else { + if z.RPC == nil { + z.RPC = new(RPCMetrics) + } + bts, err = z.RPC.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "RPC") + return + } + } + zb0001Mask |= 0x100 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1ff { + if (zb0001Mask & 0x1) == 0 { + z.Scanner = nil + } + if (zb0001Mask & 0x2) == 0 { + z.Disk = nil + } + if (zb0001Mask & 0x4) == 0 { + z.OS = nil + } + if (zb0001Mask & 0x8) == 0 { + z.BatchJobs = nil + } + if (zb0001Mask & 0x10) == 0 { + z.SiteResync = nil + } + if (zb0001Mask & 0x20) == 0 { + z.Net = nil + } + if (zb0001Mask & 0x40) == 0 { + z.Mem = nil + } + if (zb0001Mask & 0x80) == 0 { + z.CPU = nil + } + if (zb0001Mask & 0x100) == 0 { + z.RPC = nil + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *Metrics) Msgsize() (s int) { + s = 1 + 8 + if z.Scanner == nil { + s += msgp.NilSize + } else { + s += z.Scanner.Msgsize() + } + s += 5 + if z.Disk == nil { + s += msgp.NilSize + } else { + s += z.Disk.Msgsize() + } + s += 3 + if z.OS == nil { + s += msgp.NilSize + } else { + s += z.OS.Msgsize() + } + s += 10 + if z.BatchJobs == nil { + s += msgp.NilSize + } else { + s += z.BatchJobs.Msgsize() + } + s += 11 + if z.SiteResync == nil { + s += msgp.NilSize + } else { + s += z.SiteResync.Msgsize() + } + s += 4 + if z.Net == nil { + s += msgp.NilSize + } else { + s += 1 + 10 + msgp.TimeSize + 14 + msgp.StringPrefixSize + len(z.Net.InterfaceName) + 9 + (*procfsNetDevLine)(&z.Net.NetStats).Msgsize() + } + s += 4 + if z.Mem == nil { + s += msgp.NilSize + } else { + s += 1 + 10 + msgp.TimeSize + 8 + z.Mem.Info.Msgsize() + } + s += 4 + if z.CPU == nil { + s += msgp.NilSize + } else { + s += z.CPU.Msgsize() + } + s += 4 + if z.RPC == nil { + s += msgp.NilSize + } else { + s += z.RPC.Msgsize() + } + return +} + +// DecodeMsg implements msgp.Decodable +func (z *MetricsOptions) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "Type": + { + var zb0002 uint32 + zb0002, err = dc.ReadUint32() + if err != nil { + err = msgp.WrapError(err, "Type") + return + } + z.Type = MetricType(zb0002) + } + case "N": + z.N, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "N") + return + } + case "Interval": + z.Interval, err = dc.ReadDuration() + if err != nil { + err = msgp.WrapError(err, "Interval") + return + } + case "Hosts": + var zb0003 uint32 + zb0003, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "Hosts") + return + } + if cap(z.Hosts) >= int(zb0003) { + z.Hosts = (z.Hosts)[:zb0003] + } else { + z.Hosts = make([]string, zb0003) + } + for za0001 := range z.Hosts { + z.Hosts[za0001], err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Hosts", za0001) + return + } + } + case "ByHost": + z.ByHost, err = dc.ReadBool() + if err != nil { + err = msgp.WrapError(err, "ByHost") + return + } + case "Disks": + var zb0004 uint32 + zb0004, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "Disks") + return + } + if cap(z.Disks) >= int(zb0004) { + z.Disks = (z.Disks)[:zb0004] + } else { + z.Disks = make([]string, zb0004) + } + for za0002 := range z.Disks { + z.Disks[za0002], err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Disks", za0002) + return + } + } + case "ByDisk": + z.ByDisk, err = dc.ReadBool() + if err != nil { + err = msgp.WrapError(err, "ByDisk") + return + } + case "ByJobID": + z.ByJobID, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "ByJobID") + return + } + case "ByDepID": + z.ByDepID, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "ByDepID") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *MetricsOptions) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 9 + // write "Type" + err = en.Append(0x89, 0xa4, 0x54, 0x79, 0x70, 0x65) + if err != nil { + return + } + err = en.WriteUint32(uint32(z.Type)) + if err != nil { + err = msgp.WrapError(err, "Type") + return + } + // write "N" + err = en.Append(0xa1, 0x4e) + if err != nil { + return + } + err = en.WriteInt(z.N) + if err != nil { + err = msgp.WrapError(err, "N") + return + } + // write "Interval" + err = en.Append(0xa8, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c) + if err != nil { + return + } + err = en.WriteDuration(z.Interval) + if err != nil { + err = msgp.WrapError(err, "Interval") + return + } + // write "Hosts" + err = en.Append(0xa5, 0x48, 0x6f, 0x73, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Hosts))) + if err != nil { + err = msgp.WrapError(err, "Hosts") + return + } + for za0001 := range z.Hosts { + err = en.WriteString(z.Hosts[za0001]) + if err != nil { + err = msgp.WrapError(err, "Hosts", za0001) + return + } + } + // write "ByHost" + err = en.Append(0xa6, 0x42, 0x79, 0x48, 0x6f, 0x73, 0x74) + if err != nil { + return + } + err = en.WriteBool(z.ByHost) + if err != nil { + err = msgp.WrapError(err, "ByHost") + return + } + // write "Disks" + err = en.Append(0xa5, 0x44, 0x69, 0x73, 0x6b, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Disks))) + if err != nil { + err = msgp.WrapError(err, "Disks") + return + } + for za0002 := range z.Disks { + err = en.WriteString(z.Disks[za0002]) + if err != nil { + err = msgp.WrapError(err, "Disks", za0002) + return + } + } + // write "ByDisk" + err = en.Append(0xa6, 0x42, 0x79, 0x44, 0x69, 0x73, 0x6b) + if err != nil { + return + } + err = en.WriteBool(z.ByDisk) + if err != nil { + err = msgp.WrapError(err, "ByDisk") + return + } + // write "ByJobID" + err = en.Append(0xa7, 0x42, 0x79, 0x4a, 0x6f, 0x62, 0x49, 0x44) + if err != nil { + return + } + err = en.WriteString(z.ByJobID) + if err != nil { + err = msgp.WrapError(err, "ByJobID") + return + } + // write "ByDepID" + err = en.Append(0xa7, 0x42, 0x79, 0x44, 0x65, 0x70, 0x49, 0x44) + if err != nil { + return + } + err = en.WriteString(z.ByDepID) + if err != nil { + err = msgp.WrapError(err, "ByDepID") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *MetricsOptions) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 9 + // string "Type" + o = append(o, 0x89, 0xa4, 0x54, 0x79, 0x70, 0x65) + o = msgp.AppendUint32(o, uint32(z.Type)) + // string "N" + o = append(o, 0xa1, 0x4e) + o = msgp.AppendInt(o, z.N) + // string "Interval" + o = append(o, 0xa8, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c) + o = msgp.AppendDuration(o, z.Interval) + // string "Hosts" + o = append(o, 0xa5, 0x48, 0x6f, 0x73, 0x74, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.Hosts))) + for za0001 := range z.Hosts { + o = msgp.AppendString(o, z.Hosts[za0001]) + } + // string "ByHost" + o = append(o, 0xa6, 0x42, 0x79, 0x48, 0x6f, 0x73, 0x74) + o = msgp.AppendBool(o, z.ByHost) + // string "Disks" + o = append(o, 0xa5, 0x44, 0x69, 0x73, 0x6b, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.Disks))) + for za0002 := range z.Disks { + o = msgp.AppendString(o, z.Disks[za0002]) + } + // string "ByDisk" + o = append(o, 0xa6, 0x42, 0x79, 0x44, 0x69, 0x73, 0x6b) + o = msgp.AppendBool(o, z.ByDisk) + // string "ByJobID" + o = append(o, 0xa7, 0x42, 0x79, 0x4a, 0x6f, 0x62, 0x49, 0x44) + o = msgp.AppendString(o, z.ByJobID) + // string "ByDepID" + o = append(o, 0xa7, 0x42, 0x79, 0x44, 0x65, 0x70, 0x49, 0x44) + o = msgp.AppendString(o, z.ByDepID) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *MetricsOptions) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "Type": + { + var zb0002 uint32 + zb0002, bts, err = msgp.ReadUint32Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Type") + return + } + z.Type = MetricType(zb0002) + } + case "N": + z.N, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "N") + return + } + case "Interval": + z.Interval, bts, err = msgp.ReadDurationBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Interval") + return + } + case "Hosts": + var zb0003 uint32 + zb0003, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Hosts") + return + } + if cap(z.Hosts) >= int(zb0003) { + z.Hosts = (z.Hosts)[:zb0003] + } else { + z.Hosts = make([]string, zb0003) + } + for za0001 := range z.Hosts { + z.Hosts[za0001], bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Hosts", za0001) + return + } + } + case "ByHost": + z.ByHost, bts, err = msgp.ReadBoolBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ByHost") + return + } + case "Disks": + var zb0004 uint32 + zb0004, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Disks") + return + } + if cap(z.Disks) >= int(zb0004) { + z.Disks = (z.Disks)[:zb0004] + } else { + z.Disks = make([]string, zb0004) + } + for za0002 := range z.Disks { + z.Disks[za0002], bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Disks", za0002) + return + } + } + case "ByDisk": + z.ByDisk, bts, err = msgp.ReadBoolBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ByDisk") + return + } + case "ByJobID": + z.ByJobID, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ByJobID") + return + } + case "ByDepID": + z.ByDepID, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ByDepID") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *MetricsOptions) Msgsize() (s int) { + s = 1 + 5 + msgp.Uint32Size + 2 + msgp.IntSize + 9 + msgp.DurationSize + 6 + msgp.ArrayHeaderSize + for za0001 := range z.Hosts { + s += msgp.StringPrefixSize + len(z.Hosts[za0001]) + } + s += 7 + msgp.BoolSize + 6 + msgp.ArrayHeaderSize + for za0002 := range z.Disks { + s += msgp.StringPrefixSize + len(z.Disks[za0002]) + } + s += 7 + msgp.BoolSize + 8 + msgp.StringPrefixSize + len(z.ByJobID) + 8 + msgp.StringPrefixSize + len(z.ByDepID) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *NetMetrics) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "collected": + z.CollectedAt, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + case "interfaceName": + z.InterfaceName, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "InterfaceName") + return + } + case "netstats": + err = (*procfsNetDevLine)(&z.NetStats).DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "NetStats") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *NetMetrics) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 3 + // write "collected" + err = en.Append(0x83, 0xa9, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteTime(z.CollectedAt) + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + // write "interfaceName" + err = en.Append(0xad, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteString(z.InterfaceName) + if err != nil { + err = msgp.WrapError(err, "InterfaceName") + return + } + // write "netstats" + err = en.Append(0xa8, 0x6e, 0x65, 0x74, 0x73, 0x74, 0x61, 0x74, 0x73) + if err != nil { + return + } + err = (*procfsNetDevLine)(&z.NetStats).EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "NetStats") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *NetMetrics) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 3 + // string "collected" + o = append(o, 0x83, 0xa9, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64) + o = msgp.AppendTime(o, z.CollectedAt) + // string "interfaceName" + o = append(o, 0xad, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65) + o = msgp.AppendString(o, z.InterfaceName) + // string "netstats" + o = append(o, 0xa8, 0x6e, 0x65, 0x74, 0x73, 0x74, 0x61, 0x74, 0x73) + o, err = (*procfsNetDevLine)(&z.NetStats).MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "NetStats") + return + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *NetMetrics) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "collected": + z.CollectedAt, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + case "interfaceName": + z.InterfaceName, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "InterfaceName") + return + } + case "netstats": + bts, err = (*procfsNetDevLine)(&z.NetStats).UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "NetStats") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *NetMetrics) Msgsize() (s int) { + s = 1 + 10 + msgp.TimeSize + 14 + msgp.StringPrefixSize + len(z.InterfaceName) + 9 + (*procfsNetDevLine)(&z.NetStats).Msgsize() + return +} + +// DecodeMsg implements msgp.Decodable +func (z *OSMetrics) 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 /* 1 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "collected": + z.CollectedAt, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + case "life_time_ops": + var zb0002 uint32 + zb0002, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps") + return + } + if z.LifeTimeOps == nil { + z.LifeTimeOps = make(map[string]uint64, zb0002) + } else if len(z.LifeTimeOps) > 0 { + for key := range z.LifeTimeOps { + delete(z.LifeTimeOps, key) + } + } + for zb0002 > 0 { + zb0002-- + var za0001 string + var za0002 uint64 + za0001, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps") + return + } + za0002, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps", za0001) + return + } + z.LifeTimeOps[za0001] = za0002 + } + zb0001Mask |= 0x1 + case "last_minute": + var zb0003 uint32 + zb0003, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "LastMinute") + return + } + var zb0003Mask uint8 /* 1 bits */ + _ = zb0003Mask + for zb0003 > 0 { + zb0003-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, "LastMinute") + return + } + switch msgp.UnsafeString(field) { + case "operations": + var zb0004 uint32 + zb0004, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Operations") + return + } + if z.LastMinute.Operations == nil { + z.LastMinute.Operations = make(map[string]TimedAction, zb0004) + } else if len(z.LastMinute.Operations) > 0 { + for key := range z.LastMinute.Operations { + delete(z.LastMinute.Operations, key) + } + } + for zb0004 > 0 { + zb0004-- + var za0003 string + var za0004 TimedAction + za0003, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Operations") + return + } + err = za0004.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Operations", za0003) + return + } + z.LastMinute.Operations[za0003] = za0004 + } + zb0003Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, "LastMinute") + return + } + } + } + // Clear omitted fields. + if zb0003Mask != 0x1 { + if (zb0003Mask & 0x1) == 0 { + z.LastMinute.Operations = nil + } + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1 { + if (zb0001Mask & 0x1) == 0 { + z.LifeTimeOps = nil + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *OSMetrics) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(3) + var zb0001Mask uint8 /* 3 bits */ + _ = zb0001Mask + if z.LifeTimeOps == nil { + zb0001Len-- + zb0001Mask |= 0x2 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + // write "collected" + err = en.Append(0xa9, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteTime(z.CollectedAt) + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "life_time_ops" + err = en.Append(0xad, 0x6c, 0x69, 0x66, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6f, 0x70, 0x73) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.LifeTimeOps))) + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps") + return + } + for za0001, za0002 := range z.LifeTimeOps { + err = en.WriteString(za0001) + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps") + return + } + err = en.WriteUint64(za0002) + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps", za0001) + return + } + } + } + // write "last_minute" + err = en.Append(0xab, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65) + if err != nil { + return + } + // check for omitted fields + zb0002Len := uint32(1) + var zb0002Mask uint8 /* 1 bits */ + _ = zb0002Mask + if z.LastMinute.Operations == nil { + zb0002Len-- + zb0002Mask |= 0x1 + } + // variable map header, size zb0002Len + err = en.Append(0x80 | uint8(zb0002Len)) + if err != nil { + return + } + if (zb0002Mask & 0x1) == 0 { // if not omitted + // write "operations" + err = en.Append(0xaa, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.LastMinute.Operations))) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Operations") + return + } + for za0003, za0004 := range z.LastMinute.Operations { + err = en.WriteString(za0003) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Operations") + return + } + err = za0004.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Operations", za0003) + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *OSMetrics) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(3) + var zb0001Mask uint8 /* 3 bits */ + _ = zb0001Mask + if z.LifeTimeOps == nil { + zb0001Len-- + zb0001Mask |= 0x2 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + // string "collected" + o = append(o, 0xa9, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64) + o = msgp.AppendTime(o, z.CollectedAt) + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "life_time_ops" + o = append(o, 0xad, 0x6c, 0x69, 0x66, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6f, 0x70, 0x73) + o = msgp.AppendMapHeader(o, uint32(len(z.LifeTimeOps))) + for za0001, za0002 := range z.LifeTimeOps { + o = msgp.AppendString(o, za0001) + o = msgp.AppendUint64(o, za0002) + } + } + // string "last_minute" + o = append(o, 0xab, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65) + // check for omitted fields + zb0002Len := uint32(1) + var zb0002Mask uint8 /* 1 bits */ + _ = zb0002Mask + if z.LastMinute.Operations == nil { + zb0002Len-- + zb0002Mask |= 0x1 + } + // variable map header, size zb0002Len + o = append(o, 0x80|uint8(zb0002Len)) + if (zb0002Mask & 0x1) == 0 { // if not omitted + // string "operations" + o = append(o, 0xaa, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73) + o = msgp.AppendMapHeader(o, uint32(len(z.LastMinute.Operations))) + for za0003, za0004 := range z.LastMinute.Operations { + o = msgp.AppendString(o, za0003) + o, err = za0004.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Operations", za0003) + return + } + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *OSMetrics) 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 /* 1 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 "collected": + z.CollectedAt, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + case "life_time_ops": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps") + return + } + if z.LifeTimeOps == nil { + z.LifeTimeOps = make(map[string]uint64, zb0002) + } else if len(z.LifeTimeOps) > 0 { + for key := range z.LifeTimeOps { + delete(z.LifeTimeOps, key) + } + } + for zb0002 > 0 { + var za0001 string + var za0002 uint64 + zb0002-- + za0001, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps") + return + } + za0002, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps", za0001) + return + } + z.LifeTimeOps[za0001] = za0002 + } + zb0001Mask |= 0x1 + case "last_minute": + var zb0003 uint32 + zb0003, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LastMinute") + return + } + var zb0003Mask uint8 /* 1 bits */ + _ = zb0003Mask + for zb0003 > 0 { + zb0003-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "LastMinute") + return + } + switch msgp.UnsafeString(field) { + case "operations": + var zb0004 uint32 + zb0004, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Operations") + return + } + if z.LastMinute.Operations == nil { + z.LastMinute.Operations = make(map[string]TimedAction, zb0004) + } else if len(z.LastMinute.Operations) > 0 { + for key := range z.LastMinute.Operations { + delete(z.LastMinute.Operations, key) + } + } + for zb0004 > 0 { + var za0003 string + var za0004 TimedAction + zb0004-- + za0003, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Operations") + return + } + bts, err = za0004.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Operations", za0003) + return + } + z.LastMinute.Operations[za0003] = za0004 + } + zb0003Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "LastMinute") + return + } + } + } + // Clear omitted fields. + if zb0003Mask != 0x1 { + if (zb0003Mask & 0x1) == 0 { + z.LastMinute.Operations = nil + } + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1 { + if (zb0001Mask & 0x1) == 0 { + z.LifeTimeOps = nil + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *OSMetrics) Msgsize() (s int) { + s = 1 + 10 + msgp.TimeSize + 14 + msgp.MapHeaderSize + if z.LifeTimeOps != nil { + for za0001, za0002 := range z.LifeTimeOps { + _ = za0002 + s += msgp.StringPrefixSize + len(za0001) + msgp.Uint64Size + } + } + s += 12 + 1 + 11 + msgp.MapHeaderSize + if z.LastMinute.Operations != nil { + for za0003, za0004 := range z.LastMinute.Operations { + _ = za0004 + s += msgp.StringPrefixSize + len(za0003) + za0004.Msgsize() + } + } + return +} + +// DecodeMsg implements msgp.Decodable +func (z *RPCMetrics) 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 "collectedAt": + z.CollectedAt, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + case "connected": + z.Connected, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "Connected") + return + } + case "reconnectCount": + z.ReconnectCount, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "ReconnectCount") + return + } + case "disconnected": + z.Disconnected, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "Disconnected") + return + } + case "outgoingStreams": + z.OutgoingStreams, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "OutgoingStreams") + return + } + case "incomingStreams": + z.IncomingStreams, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "IncomingStreams") + return + } + case "outgoingBytes": + z.OutgoingBytes, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "OutgoingBytes") + return + } + case "incomingBytes": + z.IncomingBytes, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "IncomingBytes") + return + } + case "outgoingMessages": + z.OutgoingMessages, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "OutgoingMessages") + return + } + case "incomingMessages": + z.IncomingMessages, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "IncomingMessages") + return + } + case "outQueue": + z.OutQueue, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "OutQueue") + return + } + case "lastPongTime": + z.LastPongTime, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "LastPongTime") + return + } + case "lastPingMS": + z.LastPingMS, err = dc.ReadFloat64() + if err != nil { + err = msgp.WrapError(err, "LastPingMS") + return + } + case "maxPingDurMS": + z.MaxPingDurMS, err = dc.ReadFloat64() + if err != nil { + err = msgp.WrapError(err, "MaxPingDurMS") + return + } + case "lastConnectTime": + z.LastConnectTime, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "LastConnectTime") + return + } + case "byDestination": + var zb0002 uint32 + zb0002, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "ByDestination") + return + } + if z.ByDestination == nil { + z.ByDestination = make(map[string]RPCMetrics, zb0002) + } else if len(z.ByDestination) > 0 { + for key := range z.ByDestination { + delete(z.ByDestination, key) + } + } + for zb0002 > 0 { + zb0002-- + var za0001 string + var za0002 RPCMetrics + za0001, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "ByDestination") + return + } + err = za0002.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "ByDestination", za0001) + return + } + z.ByDestination[za0001] = za0002 + } + zb0001Mask |= 0x1 + case "byCaller": + var zb0003 uint32 + zb0003, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "ByCaller") + return + } + if z.ByCaller == nil { + z.ByCaller = make(map[string]RPCMetrics, zb0003) + } else if len(z.ByCaller) > 0 { + for key := range z.ByCaller { + delete(z.ByCaller, key) + } + } + for zb0003 > 0 { + zb0003-- + var za0003 string + var za0004 RPCMetrics + za0003, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "ByCaller") + return + } + err = za0004.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "ByCaller", za0003) + return + } + z.ByCaller[za0003] = za0004 + } + 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.ByDestination = nil + } + if (zb0001Mask & 0x2) == 0 { + z.ByCaller = nil + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *RPCMetrics) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(17) + var zb0001Mask uint32 /* 17 bits */ + _ = zb0001Mask + if z.ByDestination == nil { + zb0001Len-- + zb0001Mask |= 0x8000 + } + if z.ByCaller == nil { + zb0001Len-- + zb0001Mask |= 0x10000 + } + // variable map header, size zb0001Len + err = en.WriteMapHeader(zb0001Len) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + // write "collectedAt" + err = en.Append(0xab, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x41, 0x74) + if err != nil { + return + } + err = en.WriteTime(z.CollectedAt) + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + // write "connected" + err = en.Append(0xa9, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteInt(z.Connected) + if err != nil { + err = msgp.WrapError(err, "Connected") + return + } + // write "reconnectCount" + err = en.Append(0xae, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteInt(z.ReconnectCount) + if err != nil { + err = msgp.WrapError(err, "ReconnectCount") + return + } + // write "disconnected" + err = en.Append(0xac, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteInt(z.Disconnected) + if err != nil { + err = msgp.WrapError(err, "Disconnected") + return + } + // write "outgoingStreams" + err = en.Append(0xaf, 0x6f, 0x75, 0x74, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73) + if err != nil { + return + } + err = en.WriteInt(z.OutgoingStreams) + if err != nil { + err = msgp.WrapError(err, "OutgoingStreams") + return + } + // write "incomingStreams" + err = en.Append(0xaf, 0x69, 0x6e, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73) + if err != nil { + return + } + err = en.WriteInt(z.IncomingStreams) + if err != nil { + err = msgp.WrapError(err, "IncomingStreams") + return + } + // write "outgoingBytes" + err = en.Append(0xad, 0x6f, 0x75, 0x74, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteInt64(z.OutgoingBytes) + if err != nil { + err = msgp.WrapError(err, "OutgoingBytes") + return + } + // write "incomingBytes" + err = en.Append(0xad, 0x69, 0x6e, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteInt64(z.IncomingBytes) + if err != nil { + err = msgp.WrapError(err, "IncomingBytes") + return + } + // write "outgoingMessages" + err = en.Append(0xb0, 0x6f, 0x75, 0x74, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteInt64(z.OutgoingMessages) + if err != nil { + err = msgp.WrapError(err, "OutgoingMessages") + return + } + // write "incomingMessages" + err = en.Append(0xb0, 0x69, 0x6e, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteInt64(z.IncomingMessages) + if err != nil { + err = msgp.WrapError(err, "IncomingMessages") + return + } + // write "outQueue" + err = en.Append(0xa8, 0x6f, 0x75, 0x74, 0x51, 0x75, 0x65, 0x75, 0x65) + if err != nil { + return + } + err = en.WriteInt(z.OutQueue) + if err != nil { + err = msgp.WrapError(err, "OutQueue") + return + } + // write "lastPongTime" + err = en.Append(0xac, 0x6c, 0x61, 0x73, 0x74, 0x50, 0x6f, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteTime(z.LastPongTime) + if err != nil { + err = msgp.WrapError(err, "LastPongTime") + return + } + // write "lastPingMS" + err = en.Append(0xaa, 0x6c, 0x61, 0x73, 0x74, 0x50, 0x69, 0x6e, 0x67, 0x4d, 0x53) + if err != nil { + return + } + err = en.WriteFloat64(z.LastPingMS) + if err != nil { + err = msgp.WrapError(err, "LastPingMS") + return + } + // write "maxPingDurMS" + err = en.Append(0xac, 0x6d, 0x61, 0x78, 0x50, 0x69, 0x6e, 0x67, 0x44, 0x75, 0x72, 0x4d, 0x53) + if err != nil { + return + } + err = en.WriteFloat64(z.MaxPingDurMS) + if err != nil { + err = msgp.WrapError(err, "MaxPingDurMS") + return + } + // write "lastConnectTime" + err = en.Append(0xaf, 0x6c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x54, 0x69, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteTime(z.LastConnectTime) + if err != nil { + err = msgp.WrapError(err, "LastConnectTime") + return + } + if (zb0001Mask & 0x8000) == 0 { // if not omitted + // write "byDestination" + err = en.Append(0xad, 0x62, 0x79, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.ByDestination))) + if err != nil { + err = msgp.WrapError(err, "ByDestination") + return + } + for za0001, za0002 := range z.ByDestination { + err = en.WriteString(za0001) + if err != nil { + err = msgp.WrapError(err, "ByDestination") + return + } + err = za0002.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "ByDestination", za0001) + return + } + } + } + if (zb0001Mask & 0x10000) == 0 { // if not omitted + // write "byCaller" + err = en.Append(0xa8, 0x62, 0x79, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.ByCaller))) + if err != nil { + err = msgp.WrapError(err, "ByCaller") + return + } + for za0003, za0004 := range z.ByCaller { + err = en.WriteString(za0003) + if err != nil { + err = msgp.WrapError(err, "ByCaller") + return + } + err = za0004.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "ByCaller", za0003) + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *RPCMetrics) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(17) + var zb0001Mask uint32 /* 17 bits */ + _ = zb0001Mask + if z.ByDestination == nil { + zb0001Len-- + zb0001Mask |= 0x8000 + } + if z.ByCaller == nil { + zb0001Len-- + zb0001Mask |= 0x10000 + } + // variable map header, size zb0001Len + o = msgp.AppendMapHeader(o, zb0001Len) + if zb0001Len == 0 { + return + } + // string "collectedAt" + o = append(o, 0xab, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x41, 0x74) + o = msgp.AppendTime(o, z.CollectedAt) + // string "connected" + o = append(o, 0xa9, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64) + o = msgp.AppendInt(o, z.Connected) + // string "reconnectCount" + o = append(o, 0xae, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendInt(o, z.ReconnectCount) + // string "disconnected" + o = append(o, 0xac, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64) + o = msgp.AppendInt(o, z.Disconnected) + // string "outgoingStreams" + o = append(o, 0xaf, 0x6f, 0x75, 0x74, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73) + o = msgp.AppendInt(o, z.OutgoingStreams) + // string "incomingStreams" + o = append(o, 0xaf, 0x69, 0x6e, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73) + o = msgp.AppendInt(o, z.IncomingStreams) + // string "outgoingBytes" + o = append(o, 0xad, 0x6f, 0x75, 0x74, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73) + o = msgp.AppendInt64(o, z.OutgoingBytes) + // string "incomingBytes" + o = append(o, 0xad, 0x69, 0x6e, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73) + o = msgp.AppendInt64(o, z.IncomingBytes) + // string "outgoingMessages" + o = append(o, 0xb0, 0x6f, 0x75, 0x74, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73) + o = msgp.AppendInt64(o, z.OutgoingMessages) + // string "incomingMessages" + o = append(o, 0xb0, 0x69, 0x6e, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73) + o = msgp.AppendInt64(o, z.IncomingMessages) + // string "outQueue" + o = append(o, 0xa8, 0x6f, 0x75, 0x74, 0x51, 0x75, 0x65, 0x75, 0x65) + o = msgp.AppendInt(o, z.OutQueue) + // string "lastPongTime" + o = append(o, 0xac, 0x6c, 0x61, 0x73, 0x74, 0x50, 0x6f, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65) + o = msgp.AppendTime(o, z.LastPongTime) + // string "lastPingMS" + o = append(o, 0xaa, 0x6c, 0x61, 0x73, 0x74, 0x50, 0x69, 0x6e, 0x67, 0x4d, 0x53) + o = msgp.AppendFloat64(o, z.LastPingMS) + // string "maxPingDurMS" + o = append(o, 0xac, 0x6d, 0x61, 0x78, 0x50, 0x69, 0x6e, 0x67, 0x44, 0x75, 0x72, 0x4d, 0x53) + o = msgp.AppendFloat64(o, z.MaxPingDurMS) + // string "lastConnectTime" + o = append(o, 0xaf, 0x6c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x54, 0x69, 0x6d, 0x65) + o = msgp.AppendTime(o, z.LastConnectTime) + if (zb0001Mask & 0x8000) == 0 { // if not omitted + // string "byDestination" + o = append(o, 0xad, 0x62, 0x79, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e) + o = msgp.AppendMapHeader(o, uint32(len(z.ByDestination))) + for za0001, za0002 := range z.ByDestination { + o = msgp.AppendString(o, za0001) + o, err = za0002.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "ByDestination", za0001) + return + } + } + } + if (zb0001Mask & 0x10000) == 0 { // if not omitted + // string "byCaller" + o = append(o, 0xa8, 0x62, 0x79, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72) + o = msgp.AppendMapHeader(o, uint32(len(z.ByCaller))) + for za0003, za0004 := range z.ByCaller { + o = msgp.AppendString(o, za0003) + o, err = za0004.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "ByCaller", za0003) + return + } + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *RPCMetrics) 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 "collectedAt": + z.CollectedAt, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + case "connected": + z.Connected, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Connected") + return + } + case "reconnectCount": + z.ReconnectCount, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ReconnectCount") + return + } + case "disconnected": + z.Disconnected, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Disconnected") + return + } + case "outgoingStreams": + z.OutgoingStreams, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "OutgoingStreams") + return + } + case "incomingStreams": + z.IncomingStreams, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "IncomingStreams") + return + } + case "outgoingBytes": + z.OutgoingBytes, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "OutgoingBytes") + return + } + case "incomingBytes": + z.IncomingBytes, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "IncomingBytes") + return + } + case "outgoingMessages": + z.OutgoingMessages, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "OutgoingMessages") + return + } + case "incomingMessages": + z.IncomingMessages, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "IncomingMessages") + return + } + case "outQueue": + z.OutQueue, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "OutQueue") + return + } + case "lastPongTime": + z.LastPongTime, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LastPongTime") + return + } + case "lastPingMS": + z.LastPingMS, bts, err = msgp.ReadFloat64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "LastPingMS") + return + } + case "maxPingDurMS": + z.MaxPingDurMS, bts, err = msgp.ReadFloat64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "MaxPingDurMS") + return + } + case "lastConnectTime": + z.LastConnectTime, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LastConnectTime") + return + } + case "byDestination": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ByDestination") + return + } + if z.ByDestination == nil { + z.ByDestination = make(map[string]RPCMetrics, zb0002) + } else if len(z.ByDestination) > 0 { + for key := range z.ByDestination { + delete(z.ByDestination, key) + } + } + for zb0002 > 0 { + var za0001 string + var za0002 RPCMetrics + zb0002-- + za0001, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ByDestination") + return + } + bts, err = za0002.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "ByDestination", za0001) + return + } + z.ByDestination[za0001] = za0002 + } + zb0001Mask |= 0x1 + case "byCaller": + var zb0003 uint32 + zb0003, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ByCaller") + return + } + if z.ByCaller == nil { + z.ByCaller = make(map[string]RPCMetrics, zb0003) + } else if len(z.ByCaller) > 0 { + for key := range z.ByCaller { + delete(z.ByCaller, key) + } + } + for zb0003 > 0 { + var za0003 string + var za0004 RPCMetrics + zb0003-- + za0003, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ByCaller") + return + } + bts, err = za0004.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "ByCaller", za0003) + return + } + z.ByCaller[za0003] = za0004 + } + 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.ByDestination = nil + } + if (zb0001Mask & 0x2) == 0 { + z.ByCaller = nil + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *RPCMetrics) Msgsize() (s int) { + s = 3 + 12 + msgp.TimeSize + 10 + msgp.IntSize + 15 + msgp.IntSize + 13 + msgp.IntSize + 16 + msgp.IntSize + 16 + msgp.IntSize + 14 + msgp.Int64Size + 14 + msgp.Int64Size + 17 + msgp.Int64Size + 17 + msgp.Int64Size + 9 + msgp.IntSize + 13 + msgp.TimeSize + 11 + msgp.Float64Size + 13 + msgp.Float64Size + 16 + msgp.TimeSize + 14 + msgp.MapHeaderSize + if z.ByDestination != nil { + for za0001, za0002 := range z.ByDestination { + _ = za0002 + s += msgp.StringPrefixSize + len(za0001) + za0002.Msgsize() + } + } + s += 9 + msgp.MapHeaderSize + if z.ByCaller != nil { + for za0003, za0004 := range z.ByCaller { + _ = za0004 + s += msgp.StringPrefixSize + len(za0003) + za0004.Msgsize() + } + } + return +} + +// DecodeMsg implements msgp.Decodable +func (z *RealtimeMetrics) 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 /* 3 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "errors": + var zb0002 uint32 + zb0002, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "Errors") + return + } + if cap(z.Errors) >= int(zb0002) { + z.Errors = (z.Errors)[:zb0002] + } else { + z.Errors = make([]string, zb0002) + } + for za0001 := range z.Errors { + z.Errors[za0001], err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Errors", za0001) + return + } + } + zb0001Mask |= 0x1 + case "hosts": + var zb0003 uint32 + zb0003, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "Hosts") + return + } + if cap(z.Hosts) >= int(zb0003) { + z.Hosts = (z.Hosts)[:zb0003] + } else { + z.Hosts = make([]string, zb0003) + } + for za0002 := range z.Hosts { + z.Hosts[za0002], err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Hosts", za0002) + return + } + } + case "aggregated": + err = z.Aggregated.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "Aggregated") + return + } + case "by_host": + var zb0004 uint32 + zb0004, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "ByHost") + return + } + if z.ByHost == nil { + z.ByHost = make(map[string]Metrics, zb0004) + } else if len(z.ByHost) > 0 { + for key := range z.ByHost { + delete(z.ByHost, key) + } + } + for zb0004 > 0 { + zb0004-- + var za0003 string + var za0004 Metrics + za0003, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "ByHost") + return + } + err = za0004.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "ByHost", za0003) + return + } + z.ByHost[za0003] = za0004 + } + zb0001Mask |= 0x2 + case "by_disk": + var zb0005 uint32 + zb0005, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "ByDisk") + return + } + if z.ByDisk == nil { + z.ByDisk = make(map[string]DiskMetric, zb0005) + } else if len(z.ByDisk) > 0 { + for key := range z.ByDisk { + delete(z.ByDisk, key) + } + } + for zb0005 > 0 { + zb0005-- + var za0005 string + var za0006 DiskMetric + za0005, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "ByDisk") + return + } + err = za0006.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "ByDisk", za0005) + return + } + z.ByDisk[za0005] = za0006 + } + zb0001Mask |= 0x4 + case "final": + z.Final, err = dc.ReadBool() + if err != nil { + err = msgp.WrapError(err, "Final") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x7 { + if (zb0001Mask & 0x1) == 0 { + z.Errors = nil + } + if (zb0001Mask & 0x2) == 0 { + z.ByHost = nil + } + if (zb0001Mask & 0x4) == 0 { + z.ByDisk = nil + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *RealtimeMetrics) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(6) + var zb0001Mask uint8 /* 6 bits */ + _ = zb0001Mask + if z.Errors == nil { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.ByHost == nil { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.ByDisk == nil { + zb0001Len-- + zb0001Mask |= 0x10 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + if (zb0001Mask & 0x1) == 0 { // if not omitted + // write "errors" + err = en.Append(0xa6, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Errors))) + if err != nil { + err = msgp.WrapError(err, "Errors") + return + } + for za0001 := range z.Errors { + err = en.WriteString(z.Errors[za0001]) + if err != nil { + err = msgp.WrapError(err, "Errors", za0001) + return + } + } + } + // write "hosts" + err = en.Append(0xa5, 0x68, 0x6f, 0x73, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Hosts))) + if err != nil { + err = msgp.WrapError(err, "Hosts") + return + } + for za0002 := range z.Hosts { + err = en.WriteString(z.Hosts[za0002]) + if err != nil { + err = msgp.WrapError(err, "Hosts", za0002) + return + } + } + // write "aggregated" + err = en.Append(0xaa, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64) + if err != nil { + return + } + err = z.Aggregated.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Aggregated") + return + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // write "by_host" + err = en.Append(0xa7, 0x62, 0x79, 0x5f, 0x68, 0x6f, 0x73, 0x74) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.ByHost))) + if err != nil { + err = msgp.WrapError(err, "ByHost") + return + } + for za0003, za0004 := range z.ByHost { + err = en.WriteString(za0003) + if err != nil { + err = msgp.WrapError(err, "ByHost") + return + } + err = za0004.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "ByHost", za0003) + return + } + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // write "by_disk" + err = en.Append(0xa7, 0x62, 0x79, 0x5f, 0x64, 0x69, 0x73, 0x6b) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.ByDisk))) + if err != nil { + err = msgp.WrapError(err, "ByDisk") + return + } + for za0005, za0006 := range z.ByDisk { + err = en.WriteString(za0005) + if err != nil { + err = msgp.WrapError(err, "ByDisk") + return + } + err = za0006.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "ByDisk", za0005) + return + } + } + } + // write "final" + err = en.Append(0xa5, 0x66, 0x69, 0x6e, 0x61, 0x6c) + if err != nil { + return + } + err = en.WriteBool(z.Final) + if err != nil { + err = msgp.WrapError(err, "Final") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *RealtimeMetrics) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(6) + var zb0001Mask uint8 /* 6 bits */ + _ = zb0001Mask + if z.Errors == nil { + zb0001Len-- + zb0001Mask |= 0x1 + } + if z.ByHost == nil { + zb0001Len-- + zb0001Mask |= 0x8 + } + if z.ByDisk == nil { + zb0001Len-- + zb0001Mask |= 0x10 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + if (zb0001Mask & 0x1) == 0 { // if not omitted + // string "errors" + o = append(o, 0xa6, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.Errors))) + for za0001 := range z.Errors { + o = msgp.AppendString(o, z.Errors[za0001]) + } + } + // string "hosts" + o = append(o, 0xa5, 0x68, 0x6f, 0x73, 0x74, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.Hosts))) + for za0002 := range z.Hosts { + o = msgp.AppendString(o, z.Hosts[za0002]) + } + // string "aggregated" + o = append(o, 0xaa, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64) + o, err = z.Aggregated.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Aggregated") + return + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // string "by_host" + o = append(o, 0xa7, 0x62, 0x79, 0x5f, 0x68, 0x6f, 0x73, 0x74) + o = msgp.AppendMapHeader(o, uint32(len(z.ByHost))) + for za0003, za0004 := range z.ByHost { + o = msgp.AppendString(o, za0003) + o, err = za0004.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "ByHost", za0003) + return + } + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // string "by_disk" + o = append(o, 0xa7, 0x62, 0x79, 0x5f, 0x64, 0x69, 0x73, 0x6b) + o = msgp.AppendMapHeader(o, uint32(len(z.ByDisk))) + for za0005, za0006 := range z.ByDisk { + o = msgp.AppendString(o, za0005) + o, err = za0006.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "ByDisk", za0005) + return + } + } + } + // string "final" + o = append(o, 0xa5, 0x66, 0x69, 0x6e, 0x61, 0x6c) + o = msgp.AppendBool(o, z.Final) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *RealtimeMetrics) 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 /* 3 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 "errors": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Errors") + return + } + if cap(z.Errors) >= int(zb0002) { + z.Errors = (z.Errors)[:zb0002] + } else { + z.Errors = make([]string, zb0002) + } + for za0001 := range z.Errors { + z.Errors[za0001], bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Errors", za0001) + return + } + } + zb0001Mask |= 0x1 + case "hosts": + var zb0003 uint32 + zb0003, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Hosts") + return + } + if cap(z.Hosts) >= int(zb0003) { + z.Hosts = (z.Hosts)[:zb0003] + } else { + z.Hosts = make([]string, zb0003) + } + for za0002 := range z.Hosts { + z.Hosts[za0002], bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Hosts", za0002) + return + } + } + case "aggregated": + bts, err = z.Aggregated.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "Aggregated") + return + } + case "by_host": + var zb0004 uint32 + zb0004, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ByHost") + return + } + if z.ByHost == nil { + z.ByHost = make(map[string]Metrics, zb0004) + } else if len(z.ByHost) > 0 { + for key := range z.ByHost { + delete(z.ByHost, key) + } + } + for zb0004 > 0 { + var za0003 string + var za0004 Metrics + zb0004-- + za0003, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ByHost") + return + } + bts, err = za0004.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "ByHost", za0003) + return + } + z.ByHost[za0003] = za0004 + } + zb0001Mask |= 0x2 + case "by_disk": + var zb0005 uint32 + zb0005, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ByDisk") + return + } + if z.ByDisk == nil { + z.ByDisk = make(map[string]DiskMetric, zb0005) + } else if len(z.ByDisk) > 0 { + for key := range z.ByDisk { + delete(z.ByDisk, key) + } + } + for zb0005 > 0 { + var za0005 string + var za0006 DiskMetric + zb0005-- + za0005, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ByDisk") + return + } + bts, err = za0006.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "ByDisk", za0005) + return + } + z.ByDisk[za0005] = za0006 + } + zb0001Mask |= 0x4 + case "final": + z.Final, bts, err = msgp.ReadBoolBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Final") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x7 { + if (zb0001Mask & 0x1) == 0 { + z.Errors = nil + } + if (zb0001Mask & 0x2) == 0 { + z.ByHost = nil + } + if (zb0001Mask & 0x4) == 0 { + z.ByDisk = nil + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *RealtimeMetrics) Msgsize() (s int) { + s = 1 + 7 + msgp.ArrayHeaderSize + for za0001 := range z.Errors { + s += msgp.StringPrefixSize + len(z.Errors[za0001]) + } + s += 6 + msgp.ArrayHeaderSize + for za0002 := range z.Hosts { + s += msgp.StringPrefixSize + len(z.Hosts[za0002]) + } + s += 11 + z.Aggregated.Msgsize() + 8 + msgp.MapHeaderSize + if z.ByHost != nil { + for za0003, za0004 := range z.ByHost { + _ = za0004 + s += msgp.StringPrefixSize + len(za0003) + za0004.Msgsize() + } + } + s += 8 + msgp.MapHeaderSize + if z.ByDisk != nil { + for za0005, za0006 := range z.ByDisk { + _ = za0006 + s += msgp.StringPrefixSize + len(za0005) + za0006.Msgsize() + } + } + s += 6 + msgp.BoolSize + return +} + +// DecodeMsg implements msgp.Decodable +func (z *ReplicateInfo) 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 + } + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "lastBucket": + z.Bucket, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Bucket") + return + } + case "lastObject": + z.Object, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Object") + return + } + case "objects": + z.Objects, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "Objects") + return + } + case "objectsFailed": + z.ObjectsFailed, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "ObjectsFailed") + return + } + case "bytesTransferred": + z.BytesTransferred, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "BytesTransferred") + return + } + case "bytesFailed": + z.BytesFailed, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "BytesFailed") + return + } + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *ReplicateInfo) EncodeMsg(en *msgp.Writer) (err error) { + // map header, size 6 + // write "lastBucket" + err = en.Append(0x86, 0xaa, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74) + if err != nil { + return + } + err = en.WriteString(z.Bucket) + if err != nil { + err = msgp.WrapError(err, "Bucket") + return + } + // write "lastObject" + err = en.Append(0xaa, 0x6c, 0x61, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74) + if err != nil { + return + } + err = en.WriteString(z.Object) + if err != nil { + err = msgp.WrapError(err, "Object") + return + } + // write "objects" + err = en.Append(0xa7, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteInt64(z.Objects) + if err != nil { + err = msgp.WrapError(err, "Objects") + return + } + // write "objectsFailed" + err = en.Append(0xad, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteInt64(z.ObjectsFailed) + if err != nil { + err = msgp.WrapError(err, "ObjectsFailed") + return + } + // write "bytesTransferred" + err = en.Append(0xb0, 0x62, 0x79, 0x74, 0x65, 0x73, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteInt64(z.BytesTransferred) + if err != nil { + err = msgp.WrapError(err, "BytesTransferred") + return + } + // write "bytesFailed" + err = en.Append(0xab, 0x62, 0x79, 0x74, 0x65, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteInt64(z.BytesFailed) + if err != nil { + err = msgp.WrapError(err, "BytesFailed") + return + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *ReplicateInfo) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // map header, size 6 + // string "lastBucket" + o = append(o, 0x86, 0xaa, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74) + o = msgp.AppendString(o, z.Bucket) + // string "lastObject" + o = append(o, 0xaa, 0x6c, 0x61, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74) + o = msgp.AppendString(o, z.Object) + // string "objects" + o = append(o, 0xa7, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73) + o = msgp.AppendInt64(o, z.Objects) + // string "objectsFailed" + o = append(o, 0xad, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64) + o = msgp.AppendInt64(o, z.ObjectsFailed) + // string "bytesTransferred" + o = append(o, 0xb0, 0x62, 0x79, 0x74, 0x65, 0x73, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64) + o = msgp.AppendInt64(o, z.BytesTransferred) + // string "bytesFailed" + o = append(o, 0xab, 0x62, 0x79, 0x74, 0x65, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64) + o = msgp.AppendInt64(o, z.BytesFailed) + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *ReplicateInfo) 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 + } + for zb0001 > 0 { + zb0001-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "lastBucket": + z.Bucket, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Bucket") + return + } + case "lastObject": + z.Object, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Object") + return + } + case "objects": + z.Objects, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Objects") + return + } + case "objectsFailed": + z.ObjectsFailed, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ObjectsFailed") + return + } + case "bytesTransferred": + z.BytesTransferred, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "BytesTransferred") + return + } + case "bytesFailed": + z.BytesFailed, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "BytesFailed") + return + } + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *ReplicateInfo) Msgsize() (s int) { + s = 1 + 11 + msgp.StringPrefixSize + len(z.Bucket) + 11 + msgp.StringPrefixSize + len(z.Object) + 8 + msgp.Int64Size + 14 + msgp.Int64Size + 17 + msgp.Int64Size + 12 + msgp.Int64Size + return +} + +// DecodeMsg implements msgp.Decodable +func (z *ScannerMetrics) 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 /* 4 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "collected": + z.CollectedAt, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + case "current_cycle": + z.CurrentCycle, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "CurrentCycle") + return + } + case "current_started": + z.CurrentStarted, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "CurrentStarted") + return + } + case "cycle_complete_times": + var zb0002 uint32 + zb0002, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "CyclesCompletedAt") + return + } + if cap(z.CyclesCompletedAt) >= int(zb0002) { + z.CyclesCompletedAt = (z.CyclesCompletedAt)[:zb0002] + } else { + z.CyclesCompletedAt = make([]time.Time, zb0002) + } + for za0001 := range z.CyclesCompletedAt { + z.CyclesCompletedAt[za0001], err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "CyclesCompletedAt", za0001) + return + } + } + case "ongoing_buckets": + z.OngoingBuckets, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "OngoingBuckets") + return + } + case "per_bucket_stats": + var zb0003 uint32 + zb0003, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "PerBucketStats") + return + } + if z.PerBucketStats == nil { + z.PerBucketStats = make(map[string][]BucketScanInfo, zb0003) + } else if len(z.PerBucketStats) > 0 { + for key := range z.PerBucketStats { + delete(z.PerBucketStats, key) + } + } + for zb0003 > 0 { + zb0003-- + var za0002 string + var za0003 []BucketScanInfo + za0002, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "PerBucketStats") + return + } + var zb0004 uint32 + zb0004, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "PerBucketStats", za0002) + return + } + if cap(za0003) >= int(zb0004) { + za0003 = (za0003)[:zb0004] + } else { + za0003 = make([]BucketScanInfo, zb0004) + } + for za0004 := range za0003 { + err = za0003[za0004].DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "PerBucketStats", za0002, za0004) + return + } + } + z.PerBucketStats[za0002] = za0003 + } + zb0001Mask |= 0x1 + case "life_time_ops": + var zb0005 uint32 + zb0005, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps") + return + } + if z.LifeTimeOps == nil { + z.LifeTimeOps = make(map[string]uint64, zb0005) + } else if len(z.LifeTimeOps) > 0 { + for key := range z.LifeTimeOps { + delete(z.LifeTimeOps, key) + } + } + for zb0005 > 0 { + zb0005-- + var za0005 string + var za0006 uint64 + za0005, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps") + return + } + za0006, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps", za0005) + return + } + z.LifeTimeOps[za0005] = za0006 + } + zb0001Mask |= 0x2 + case "ilm_ops": + var zb0006 uint32 + zb0006, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "LifeTimeILM") + return + } + if z.LifeTimeILM == nil { + z.LifeTimeILM = make(map[string]uint64, zb0006) + } else if len(z.LifeTimeILM) > 0 { + for key := range z.LifeTimeILM { + delete(z.LifeTimeILM, key) + } + } + for zb0006 > 0 { + zb0006-- + var za0007 string + var za0008 uint64 + za0007, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "LifeTimeILM") + return + } + za0008, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "LifeTimeILM", za0007) + return + } + z.LifeTimeILM[za0007] = za0008 + } + zb0001Mask |= 0x4 + case "last_minute": + var zb0007 uint32 + zb0007, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "LastMinute") + return + } + var zb0007Mask uint8 /* 2 bits */ + _ = zb0007Mask + for zb0007 > 0 { + zb0007-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err, "LastMinute") + return + } + switch msgp.UnsafeString(field) { + case "actions": + var zb0008 uint32 + zb0008, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Actions") + return + } + if z.LastMinute.Actions == nil { + z.LastMinute.Actions = make(map[string]TimedAction, zb0008) + } else if len(z.LastMinute.Actions) > 0 { + for key := range z.LastMinute.Actions { + delete(z.LastMinute.Actions, key) + } + } + for zb0008 > 0 { + zb0008-- + var za0009 string + var za0010 TimedAction + za0009, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Actions") + return + } + err = za0010.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Actions", za0009) + return + } + z.LastMinute.Actions[za0009] = za0010 + } + zb0007Mask |= 0x1 + case "ilm": + var zb0009 uint32 + zb0009, err = dc.ReadMapHeader() + if err != nil { + err = msgp.WrapError(err, "LastMinute", "ILM") + return + } + if z.LastMinute.ILM == nil { + z.LastMinute.ILM = make(map[string]TimedAction, zb0009) + } else if len(z.LastMinute.ILM) > 0 { + for key := range z.LastMinute.ILM { + delete(z.LastMinute.ILM, key) + } + } + for zb0009 > 0 { + zb0009-- + var za0011 string + var za0012 TimedAction + za0011, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "LastMinute", "ILM") + return + } + err = za0012.DecodeMsg(dc) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "ILM", za0011) + return + } + z.LastMinute.ILM[za0011] = za0012 + } + zb0007Mask |= 0x2 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err, "LastMinute") + return + } + } + } + // Clear omitted fields. + if zb0007Mask != 0x3 { + if (zb0007Mask & 0x1) == 0 { + z.LastMinute.Actions = nil + } + if (zb0007Mask & 0x2) == 0 { + z.LastMinute.ILM = nil + } + } + case "active": + var zb0010 uint32 + zb0010, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "ActivePaths") + return + } + if cap(z.ActivePaths) >= int(zb0010) { + z.ActivePaths = (z.ActivePaths)[:zb0010] + } else { + z.ActivePaths = make([]string, zb0010) + } + for za0013 := range z.ActivePaths { + z.ActivePaths[za0013], err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "ActivePaths", za0013) + return + } + } + zb0001Mask |= 0x8 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0xf { + if (zb0001Mask & 0x1) == 0 { + z.PerBucketStats = nil + } + if (zb0001Mask & 0x2) == 0 { + z.LifeTimeOps = nil + } + if (zb0001Mask & 0x4) == 0 { + z.LifeTimeILM = nil + } + if (zb0001Mask & 0x8) == 0 { + z.ActivePaths = nil + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *ScannerMetrics) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(10) + var zb0001Mask uint16 /* 10 bits */ + _ = zb0001Mask + if z.PerBucketStats == nil { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.LifeTimeOps == nil { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.LifeTimeILM == nil { + zb0001Len-- + zb0001Mask |= 0x80 + } + if z.ActivePaths == nil { + zb0001Len-- + zb0001Mask |= 0x200 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + // write "collected" + err = en.Append(0xa9, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteTime(z.CollectedAt) + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + // write "current_cycle" + err = en.Append(0xad, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x79, 0x63, 0x6c, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.CurrentCycle) + if err != nil { + err = msgp.WrapError(err, "CurrentCycle") + return + } + // write "current_started" + err = en.Append(0xaf, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteTime(z.CurrentStarted) + if err != nil { + err = msgp.WrapError(err, "CurrentStarted") + return + } + // write "cycle_complete_times" + err = en.Append(0xb4, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.CyclesCompletedAt))) + if err != nil { + err = msgp.WrapError(err, "CyclesCompletedAt") + return + } + for za0001 := range z.CyclesCompletedAt { + err = en.WriteTime(z.CyclesCompletedAt[za0001]) + if err != nil { + err = msgp.WrapError(err, "CyclesCompletedAt", za0001) + return + } + } + // write "ongoing_buckets" + err = en.Append(0xaf, 0x6f, 0x6e, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteInt(z.OngoingBuckets) + if err != nil { + err = msgp.WrapError(err, "OngoingBuckets") + return + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // write "per_bucket_stats" + err = en.Append(0xb0, 0x70, 0x65, 0x72, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.PerBucketStats))) + if err != nil { + err = msgp.WrapError(err, "PerBucketStats") + return + } + for za0002, za0003 := range z.PerBucketStats { + err = en.WriteString(za0002) + if err != nil { + err = msgp.WrapError(err, "PerBucketStats") + return + } + err = en.WriteArrayHeader(uint32(len(za0003))) + if err != nil { + err = msgp.WrapError(err, "PerBucketStats", za0002) + return + } + for za0004 := range za0003 { + err = za0003[za0004].EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "PerBucketStats", za0002, za0004) + return + } + } + } + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // write "life_time_ops" + err = en.Append(0xad, 0x6c, 0x69, 0x66, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6f, 0x70, 0x73) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.LifeTimeOps))) + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps") + return + } + for za0005, za0006 := range z.LifeTimeOps { + err = en.WriteString(za0005) + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps") + return + } + err = en.WriteUint64(za0006) + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps", za0005) + return + } + } + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // write "ilm_ops" + err = en.Append(0xa7, 0x69, 0x6c, 0x6d, 0x5f, 0x6f, 0x70, 0x73) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.LifeTimeILM))) + if err != nil { + err = msgp.WrapError(err, "LifeTimeILM") + return + } + for za0007, za0008 := range z.LifeTimeILM { + err = en.WriteString(za0007) + if err != nil { + err = msgp.WrapError(err, "LifeTimeILM") + return + } + err = en.WriteUint64(za0008) + if err != nil { + err = msgp.WrapError(err, "LifeTimeILM", za0007) + return + } + } + } + // write "last_minute" + err = en.Append(0xab, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65) + if err != nil { + return + } + // check for omitted fields + zb0002Len := uint32(2) + var zb0002Mask uint8 /* 2 bits */ + _ = zb0002Mask + if z.LastMinute.Actions == nil { + zb0002Len-- + zb0002Mask |= 0x1 + } + if z.LastMinute.ILM == nil { + zb0002Len-- + zb0002Mask |= 0x2 + } + // variable map header, size zb0002Len + err = en.Append(0x80 | uint8(zb0002Len)) + if err != nil { + return + } + if (zb0002Mask & 0x1) == 0 { // if not omitted + // write "actions" + err = en.Append(0xa7, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.LastMinute.Actions))) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Actions") + return + } + for za0009, za0010 := range z.LastMinute.Actions { + err = en.WriteString(za0009) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Actions") + return + } + err = za0010.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Actions", za0009) + return + } + } + } + if (zb0002Mask & 0x2) == 0 { // if not omitted + // write "ilm" + err = en.Append(0xa3, 0x69, 0x6c, 0x6d) + if err != nil { + return + } + err = en.WriteMapHeader(uint32(len(z.LastMinute.ILM))) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "ILM") + return + } + for za0011, za0012 := range z.LastMinute.ILM { + err = en.WriteString(za0011) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "ILM") + return + } + err = za0012.EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "ILM", za0011) + return + } + } + } + if (zb0001Mask & 0x200) == 0 { // if not omitted + // write "active" + err = en.Append(0xa6, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.ActivePaths))) + if err != nil { + err = msgp.WrapError(err, "ActivePaths") + return + } + for za0013 := range z.ActivePaths { + err = en.WriteString(z.ActivePaths[za0013]) + if err != nil { + err = msgp.WrapError(err, "ActivePaths", za0013) + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *ScannerMetrics) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(10) + var zb0001Mask uint16 /* 10 bits */ + _ = zb0001Mask + if z.PerBucketStats == nil { + zb0001Len-- + zb0001Mask |= 0x20 + } + if z.LifeTimeOps == nil { + zb0001Len-- + zb0001Mask |= 0x40 + } + if z.LifeTimeILM == nil { + zb0001Len-- + zb0001Mask |= 0x80 + } + if z.ActivePaths == nil { + zb0001Len-- + zb0001Mask |= 0x200 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + // string "collected" + o = append(o, 0xa9, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64) + o = msgp.AppendTime(o, z.CollectedAt) + // string "current_cycle" + o = append(o, 0xad, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x79, 0x63, 0x6c, 0x65) + o = msgp.AppendUint64(o, z.CurrentCycle) + // string "current_started" + o = append(o, 0xaf, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64) + o = msgp.AppendTime(o, z.CurrentStarted) + // string "cycle_complete_times" + o = append(o, 0xb4, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.CyclesCompletedAt))) + for za0001 := range z.CyclesCompletedAt { + o = msgp.AppendTime(o, z.CyclesCompletedAt[za0001]) + } + // string "ongoing_buckets" + o = append(o, 0xaf, 0x6f, 0x6e, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73) + o = msgp.AppendInt(o, z.OngoingBuckets) + if (zb0001Mask & 0x20) == 0 { // if not omitted + // string "per_bucket_stats" + o = append(o, 0xb0, 0x70, 0x65, 0x72, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73) + o = msgp.AppendMapHeader(o, uint32(len(z.PerBucketStats))) + for za0002, za0003 := range z.PerBucketStats { + o = msgp.AppendString(o, za0002) + o = msgp.AppendArrayHeader(o, uint32(len(za0003))) + for za0004 := range za0003 { + o, err = za0003[za0004].MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "PerBucketStats", za0002, za0004) + return + } + } + } + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // string "life_time_ops" + o = append(o, 0xad, 0x6c, 0x69, 0x66, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6f, 0x70, 0x73) + o = msgp.AppendMapHeader(o, uint32(len(z.LifeTimeOps))) + for za0005, za0006 := range z.LifeTimeOps { + o = msgp.AppendString(o, za0005) + o = msgp.AppendUint64(o, za0006) + } + } + if (zb0001Mask & 0x80) == 0 { // if not omitted + // string "ilm_ops" + o = append(o, 0xa7, 0x69, 0x6c, 0x6d, 0x5f, 0x6f, 0x70, 0x73) + o = msgp.AppendMapHeader(o, uint32(len(z.LifeTimeILM))) + for za0007, za0008 := range z.LifeTimeILM { + o = msgp.AppendString(o, za0007) + o = msgp.AppendUint64(o, za0008) + } + } + // string "last_minute" + o = append(o, 0xab, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65) + // check for omitted fields + zb0002Len := uint32(2) + var zb0002Mask uint8 /* 2 bits */ + _ = zb0002Mask + if z.LastMinute.Actions == nil { + zb0002Len-- + zb0002Mask |= 0x1 + } + if z.LastMinute.ILM == nil { + zb0002Len-- + zb0002Mask |= 0x2 + } + // variable map header, size zb0002Len + o = append(o, 0x80|uint8(zb0002Len)) + if (zb0002Mask & 0x1) == 0 { // if not omitted + // string "actions" + o = append(o, 0xa7, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73) + o = msgp.AppendMapHeader(o, uint32(len(z.LastMinute.Actions))) + for za0009, za0010 := range z.LastMinute.Actions { + o = msgp.AppendString(o, za0009) + o, err = za0010.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Actions", za0009) + return + } + } + } + if (zb0002Mask & 0x2) == 0 { // if not omitted + // string "ilm" + o = append(o, 0xa3, 0x69, 0x6c, 0x6d) + o = msgp.AppendMapHeader(o, uint32(len(z.LastMinute.ILM))) + for za0011, za0012 := range z.LastMinute.ILM { + o = msgp.AppendString(o, za0011) + o, err = za0012.MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "ILM", za0011) + return + } + } + } + if (zb0001Mask & 0x200) == 0 { // if not omitted + // string "active" + o = append(o, 0xa6, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65) + o = msgp.AppendArrayHeader(o, uint32(len(z.ActivePaths))) + for za0013 := range z.ActivePaths { + o = msgp.AppendString(o, z.ActivePaths[za0013]) + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *ScannerMetrics) 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 /* 4 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 "collected": + z.CollectedAt, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + case "current_cycle": + z.CurrentCycle, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "CurrentCycle") + return + } + case "current_started": + z.CurrentStarted, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "CurrentStarted") + return + } + case "cycle_complete_times": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "CyclesCompletedAt") + return + } + if cap(z.CyclesCompletedAt) >= int(zb0002) { + z.CyclesCompletedAt = (z.CyclesCompletedAt)[:zb0002] + } else { + z.CyclesCompletedAt = make([]time.Time, zb0002) + } + for za0001 := range z.CyclesCompletedAt { + z.CyclesCompletedAt[za0001], bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "CyclesCompletedAt", za0001) + return + } + } + case "ongoing_buckets": + z.OngoingBuckets, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "OngoingBuckets") + return + } + case "per_bucket_stats": + var zb0003 uint32 + zb0003, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "PerBucketStats") + return + } + if z.PerBucketStats == nil { + z.PerBucketStats = make(map[string][]BucketScanInfo, zb0003) + } else if len(z.PerBucketStats) > 0 { + for key := range z.PerBucketStats { + delete(z.PerBucketStats, key) + } + } + for zb0003 > 0 { + var za0002 string + var za0003 []BucketScanInfo + zb0003-- + za0002, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "PerBucketStats") + return + } + var zb0004 uint32 + zb0004, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "PerBucketStats", za0002) + return + } + if cap(za0003) >= int(zb0004) { + za0003 = (za0003)[:zb0004] + } else { + za0003 = make([]BucketScanInfo, zb0004) + } + for za0004 := range za0003 { + bts, err = za0003[za0004].UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "PerBucketStats", za0002, za0004) + return + } + } + z.PerBucketStats[za0002] = za0003 + } + zb0001Mask |= 0x1 + case "life_time_ops": + var zb0005 uint32 + zb0005, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps") + return + } + if z.LifeTimeOps == nil { + z.LifeTimeOps = make(map[string]uint64, zb0005) + } else if len(z.LifeTimeOps) > 0 { + for key := range z.LifeTimeOps { + delete(z.LifeTimeOps, key) + } + } + for zb0005 > 0 { + var za0005 string + var za0006 uint64 + zb0005-- + za0005, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps") + return + } + za0006, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "LifeTimeOps", za0005) + return + } + z.LifeTimeOps[za0005] = za0006 + } + zb0001Mask |= 0x2 + case "ilm_ops": + var zb0006 uint32 + zb0006, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LifeTimeILM") + return + } + if z.LifeTimeILM == nil { + z.LifeTimeILM = make(map[string]uint64, zb0006) + } else if len(z.LifeTimeILM) > 0 { + for key := range z.LifeTimeILM { + delete(z.LifeTimeILM, key) + } + } + for zb0006 > 0 { + var za0007 string + var za0008 uint64 + zb0006-- + za0007, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LifeTimeILM") + return + } + za0008, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "LifeTimeILM", za0007) + return + } + z.LifeTimeILM[za0007] = za0008 + } + zb0001Mask |= 0x4 + case "last_minute": + var zb0007 uint32 + zb0007, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LastMinute") + return + } + var zb0007Mask uint8 /* 2 bits */ + _ = zb0007Mask + for zb0007 > 0 { + zb0007-- + field, bts, err = msgp.ReadMapKeyZC(bts) + if err != nil { + err = msgp.WrapError(err, "LastMinute") + return + } + switch msgp.UnsafeString(field) { + case "actions": + var zb0008 uint32 + zb0008, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Actions") + return + } + if z.LastMinute.Actions == nil { + z.LastMinute.Actions = make(map[string]TimedAction, zb0008) + } else if len(z.LastMinute.Actions) > 0 { + for key := range z.LastMinute.Actions { + delete(z.LastMinute.Actions, key) + } + } + for zb0008 > 0 { + var za0009 string + var za0010 TimedAction + zb0008-- + za0009, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Actions") + return + } + bts, err = za0010.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "Actions", za0009) + return + } + z.LastMinute.Actions[za0009] = za0010 + } + zb0007Mask |= 0x1 + case "ilm": + var zb0009 uint32 + zb0009, bts, err = msgp.ReadMapHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "ILM") + return + } + if z.LastMinute.ILM == nil { + z.LastMinute.ILM = make(map[string]TimedAction, zb0009) + } else if len(z.LastMinute.ILM) > 0 { + for key := range z.LastMinute.ILM { + delete(z.LastMinute.ILM, key) + } + } + for zb0009 > 0 { + var za0011 string + var za0012 TimedAction + zb0009-- + za0011, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "ILM") + return + } + bts, err = za0012.UnmarshalMsg(bts) + if err != nil { + err = msgp.WrapError(err, "LastMinute", "ILM", za0011) + return + } + z.LastMinute.ILM[za0011] = za0012 + } + zb0007Mask |= 0x2 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err, "LastMinute") + return + } + } + } + // Clear omitted fields. + if zb0007Mask != 0x3 { + if (zb0007Mask & 0x1) == 0 { + z.LastMinute.Actions = nil + } + if (zb0007Mask & 0x2) == 0 { + z.LastMinute.ILM = nil + } + } + case "active": + var zb0010 uint32 + zb0010, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ActivePaths") + return + } + if cap(z.ActivePaths) >= int(zb0010) { + z.ActivePaths = (z.ActivePaths)[:zb0010] + } else { + z.ActivePaths = make([]string, zb0010) + } + for za0013 := range z.ActivePaths { + z.ActivePaths[za0013], bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ActivePaths", za0013) + return + } + } + zb0001Mask |= 0x8 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0xf { + if (zb0001Mask & 0x1) == 0 { + z.PerBucketStats = nil + } + if (zb0001Mask & 0x2) == 0 { + z.LifeTimeOps = nil + } + if (zb0001Mask & 0x4) == 0 { + z.LifeTimeILM = nil + } + if (zb0001Mask & 0x8) == 0 { + z.ActivePaths = nil + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *ScannerMetrics) Msgsize() (s int) { + s = 1 + 10 + msgp.TimeSize + 14 + msgp.Uint64Size + 16 + msgp.TimeSize + 21 + msgp.ArrayHeaderSize + (len(z.CyclesCompletedAt) * (msgp.TimeSize)) + 16 + msgp.IntSize + 17 + msgp.MapHeaderSize + if z.PerBucketStats != nil { + for za0002, za0003 := range z.PerBucketStats { + _ = za0003 + s += msgp.StringPrefixSize + len(za0002) + msgp.ArrayHeaderSize + for za0004 := range za0003 { + s += za0003[za0004].Msgsize() + } + } + } + s += 14 + msgp.MapHeaderSize + if z.LifeTimeOps != nil { + for za0005, za0006 := range z.LifeTimeOps { + _ = za0006 + s += msgp.StringPrefixSize + len(za0005) + msgp.Uint64Size + } + } + s += 8 + msgp.MapHeaderSize + if z.LifeTimeILM != nil { + for za0007, za0008 := range z.LifeTimeILM { + _ = za0008 + s += msgp.StringPrefixSize + len(za0007) + msgp.Uint64Size + } + } + s += 12 + 1 + 8 + msgp.MapHeaderSize + if z.LastMinute.Actions != nil { + for za0009, za0010 := range z.LastMinute.Actions { + _ = za0010 + s += msgp.StringPrefixSize + len(za0009) + za0010.Msgsize() + } + } + s += 4 + msgp.MapHeaderSize + if z.LastMinute.ILM != nil { + for za0011, za0012 := range z.LastMinute.ILM { + _ = za0012 + s += msgp.StringPrefixSize + len(za0011) + za0012.Msgsize() + } + } + s += 7 + msgp.ArrayHeaderSize + for za0013 := range z.ActivePaths { + s += msgp.StringPrefixSize + len(z.ActivePaths[za0013]) + } + return +} + +// DecodeMsg implements msgp.Decodable +func (z *SiteResyncMetrics) 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 /* 3 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "collected": + z.CollectedAt, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + case "resyncStatus": + z.ResyncStatus, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "ResyncStatus") + return + } + zb0001Mask |= 0x1 + case "startTime": + z.StartTime, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "StartTime") + return + } + case "lastUpdate": + z.LastUpdate, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "LastUpdate") + return + } + case "numBuckets": + z.NumBuckets, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "NumBuckets") + return + } + case "resyncID": + z.ResyncID, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "ResyncID") + return + } + case "deplID": + z.DeplID, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "DeplID") + return + } + case "completedReplicationSize": + z.ReplicatedSize, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "ReplicatedSize") + return + } + case "replicationCount": + z.ReplicatedCount, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "ReplicatedCount") + return + } + case "failedReplicationSize": + z.FailedSize, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "FailedSize") + return + } + case "failedReplicationCount": + z.FailedCount, err = dc.ReadInt64() + if err != nil { + err = msgp.WrapError(err, "FailedCount") + return + } + case "failedBuckets": + var zb0002 uint32 + zb0002, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "FailedBuckets") + return + } + if cap(z.FailedBuckets) >= int(zb0002) { + z.FailedBuckets = (z.FailedBuckets)[:zb0002] + } else { + z.FailedBuckets = make([]string, zb0002) + } + for za0001 := range z.FailedBuckets { + z.FailedBuckets[za0001], err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "FailedBuckets", za0001) + return + } + } + case "bucket": + z.Bucket, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Bucket") + return + } + zb0001Mask |= 0x2 + case "object": + z.Object, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Object") + return + } + zb0001Mask |= 0x4 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x7 { + if (zb0001Mask & 0x1) == 0 { + z.ResyncStatus = "" + } + if (zb0001Mask & 0x2) == 0 { + z.Bucket = "" + } + if (zb0001Mask & 0x4) == 0 { + z.Object = "" + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *SiteResyncMetrics) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(14) + var zb0001Mask uint16 /* 14 bits */ + _ = zb0001Mask + if z.ResyncStatus == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.Bucket == "" { + zb0001Len-- + zb0001Mask |= 0x1000 + } + if z.Object == "" { + zb0001Len-- + zb0001Mask |= 0x2000 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + // write "collected" + err = en.Append(0xa9, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteTime(z.CollectedAt) + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "resyncStatus" + err = en.Append(0xac, 0x72, 0x65, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73) + if err != nil { + return + } + err = en.WriteString(z.ResyncStatus) + if err != nil { + err = msgp.WrapError(err, "ResyncStatus") + return + } + } + // write "startTime" + err = en.Append(0xa9, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65) + if err != nil { + return + } + err = en.WriteTime(z.StartTime) + if err != nil { + err = msgp.WrapError(err, "StartTime") + return + } + // write "lastUpdate" + err = en.Append(0xaa, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65) + if err != nil { + return + } + err = en.WriteTime(z.LastUpdate) + if err != nil { + err = msgp.WrapError(err, "LastUpdate") + return + } + // write "numBuckets" + err = en.Append(0xaa, 0x6e, 0x75, 0x6d, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteInt64(z.NumBuckets) + if err != nil { + err = msgp.WrapError(err, "NumBuckets") + return + } + // write "resyncID" + err = en.Append(0xa8, 0x72, 0x65, 0x73, 0x79, 0x6e, 0x63, 0x49, 0x44) + if err != nil { + return + } + err = en.WriteString(z.ResyncID) + if err != nil { + err = msgp.WrapError(err, "ResyncID") + return + } + // write "deplID" + err = en.Append(0xa6, 0x64, 0x65, 0x70, 0x6c, 0x49, 0x44) + if err != nil { + return + } + err = en.WriteString(z.DeplID) + if err != nil { + err = msgp.WrapError(err, "DeplID") + return + } + // write "completedReplicationSize" + err = en.Append(0xb8, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x7a, 0x65) + if err != nil { + return + } + err = en.WriteInt64(z.ReplicatedSize) + if err != nil { + err = msgp.WrapError(err, "ReplicatedSize") + return + } + // write "replicationCount" + err = en.Append(0xb0, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteInt64(z.ReplicatedCount) + if err != nil { + err = msgp.WrapError(err, "ReplicatedCount") + return + } + // write "failedReplicationSize" + err = en.Append(0xb5, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x7a, 0x65) + if err != nil { + return + } + err = en.WriteInt64(z.FailedSize) + if err != nil { + err = msgp.WrapError(err, "FailedSize") + return + } + // write "failedReplicationCount" + err = en.Append(0xb6, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteInt64(z.FailedCount) + if err != nil { + err = msgp.WrapError(err, "FailedCount") + return + } + // write "failedBuckets" + err = en.Append(0xad, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.FailedBuckets))) + if err != nil { + err = msgp.WrapError(err, "FailedBuckets") + return + } + for za0001 := range z.FailedBuckets { + err = en.WriteString(z.FailedBuckets[za0001]) + if err != nil { + err = msgp.WrapError(err, "FailedBuckets", za0001) + return + } + } + if (zb0001Mask & 0x1000) == 0 { // if not omitted + // write "bucket" + err = en.Append(0xa6, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74) + if err != nil { + return + } + err = en.WriteString(z.Bucket) + if err != nil { + err = msgp.WrapError(err, "Bucket") + return + } + } + if (zb0001Mask & 0x2000) == 0 { // if not omitted + // write "object" + err = en.Append(0xa6, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74) + if err != nil { + return + } + err = en.WriteString(z.Object) + if err != nil { + err = msgp.WrapError(err, "Object") + return + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *SiteResyncMetrics) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(14) + var zb0001Mask uint16 /* 14 bits */ + _ = zb0001Mask + if z.ResyncStatus == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + if z.Bucket == "" { + zb0001Len-- + zb0001Mask |= 0x1000 + } + if z.Object == "" { + zb0001Len-- + zb0001Mask |= 0x2000 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + // string "collected" + o = append(o, 0xa9, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64) + o = msgp.AppendTime(o, z.CollectedAt) + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "resyncStatus" + o = append(o, 0xac, 0x72, 0x65, 0x73, 0x79, 0x6e, 0x63, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73) + o = msgp.AppendString(o, z.ResyncStatus) + } + // string "startTime" + o = append(o, 0xa9, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65) + o = msgp.AppendTime(o, z.StartTime) + // string "lastUpdate" + o = append(o, 0xaa, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65) + o = msgp.AppendTime(o, z.LastUpdate) + // string "numBuckets" + o = append(o, 0xaa, 0x6e, 0x75, 0x6d, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73) + o = msgp.AppendInt64(o, z.NumBuckets) + // string "resyncID" + o = append(o, 0xa8, 0x72, 0x65, 0x73, 0x79, 0x6e, 0x63, 0x49, 0x44) + o = msgp.AppendString(o, z.ResyncID) + // string "deplID" + o = append(o, 0xa6, 0x64, 0x65, 0x70, 0x6c, 0x49, 0x44) + o = msgp.AppendString(o, z.DeplID) + // string "completedReplicationSize" + o = append(o, 0xb8, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x7a, 0x65) + o = msgp.AppendInt64(o, z.ReplicatedSize) + // string "replicationCount" + o = append(o, 0xb0, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendInt64(o, z.ReplicatedCount) + // string "failedReplicationSize" + o = append(o, 0xb5, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x7a, 0x65) + o = msgp.AppendInt64(o, z.FailedSize) + // string "failedReplicationCount" + o = append(o, 0xb6, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendInt64(o, z.FailedCount) + // string "failedBuckets" + o = append(o, 0xad, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.FailedBuckets))) + for za0001 := range z.FailedBuckets { + o = msgp.AppendString(o, z.FailedBuckets[za0001]) + } + if (zb0001Mask & 0x1000) == 0 { // if not omitted + // string "bucket" + o = append(o, 0xa6, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74) + o = msgp.AppendString(o, z.Bucket) + } + if (zb0001Mask & 0x2000) == 0 { // if not omitted + // string "object" + o = append(o, 0xa6, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74) + o = msgp.AppendString(o, z.Object) + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *SiteResyncMetrics) 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 /* 3 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 "collected": + z.CollectedAt, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "CollectedAt") + return + } + case "resyncStatus": + z.ResyncStatus, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ResyncStatus") + return + } + zb0001Mask |= 0x1 + case "startTime": + z.StartTime, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "StartTime") + return + } + case "lastUpdate": + z.LastUpdate, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LastUpdate") + return + } + case "numBuckets": + z.NumBuckets, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "NumBuckets") + return + } + case "resyncID": + z.ResyncID, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "ResyncID") + return + } + case "deplID": + z.DeplID, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "DeplID") + return + } + case "completedReplicationSize": + z.ReplicatedSize, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ReplicatedSize") + return + } + case "replicationCount": + z.ReplicatedCount, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "ReplicatedCount") + return + } + case "failedReplicationSize": + z.FailedSize, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "FailedSize") + return + } + case "failedReplicationCount": + z.FailedCount, bts, err = msgp.ReadInt64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "FailedCount") + return + } + case "failedBuckets": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "FailedBuckets") + return + } + if cap(z.FailedBuckets) >= int(zb0002) { + z.FailedBuckets = (z.FailedBuckets)[:zb0002] + } else { + z.FailedBuckets = make([]string, zb0002) + } + for za0001 := range z.FailedBuckets { + z.FailedBuckets[za0001], bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "FailedBuckets", za0001) + return + } + } + case "bucket": + z.Bucket, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Bucket") + return + } + zb0001Mask |= 0x2 + case "object": + z.Object, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Object") + return + } + zb0001Mask |= 0x4 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x7 { + if (zb0001Mask & 0x1) == 0 { + z.ResyncStatus = "" + } + if (zb0001Mask & 0x2) == 0 { + z.Bucket = "" + } + if (zb0001Mask & 0x4) == 0 { + z.Object = "" + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *SiteResyncMetrics) Msgsize() (s int) { + s = 1 + 10 + msgp.TimeSize + 13 + msgp.StringPrefixSize + len(z.ResyncStatus) + 10 + msgp.TimeSize + 11 + msgp.TimeSize + 11 + msgp.Int64Size + 9 + msgp.StringPrefixSize + len(z.ResyncID) + 7 + msgp.StringPrefixSize + len(z.DeplID) + 25 + msgp.Int64Size + 17 + msgp.Int64Size + 22 + msgp.Int64Size + 23 + msgp.Int64Size + 14 + msgp.ArrayHeaderSize + for za0001 := range z.FailedBuckets { + s += msgp.StringPrefixSize + len(z.FailedBuckets[za0001]) + } + s += 7 + msgp.StringPrefixSize + len(z.Bucket) + 7 + msgp.StringPrefixSize + len(z.Object) + return +} diff --git a/metrics_gen_test.go b/metrics_gen_test.go new file mode 100644 index 0000000..6e5fdc2 --- /dev/null +++ b/metrics_gen_test.go @@ -0,0 +1,2044 @@ +package madmin + +// Code generated by github.com/tinylib/msgp DO NOT EDIT. + +import ( + "bytes" + "testing" + + "github.com/tinylib/msgp/msgp" +) + +func TestMarshalUnmarshalBatchJobMetrics(t *testing.T) { + v := BatchJobMetrics{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgBatchJobMetrics(b *testing.B) { + v := BatchJobMetrics{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgBatchJobMetrics(b *testing.B) { + v := BatchJobMetrics{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalBatchJobMetrics(b *testing.B) { + v := BatchJobMetrics{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeBatchJobMetrics(t *testing.T) { + v := BatchJobMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeBatchJobMetrics Msgsize() is inaccurate") + } + + vn := BatchJobMetrics{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeBatchJobMetrics(b *testing.B) { + v := BatchJobMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeBatchJobMetrics(b *testing.B) { + v := BatchJobMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalCPUMetrics(t *testing.T) { + v := CPUMetrics{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgCPUMetrics(b *testing.B) { + v := CPUMetrics{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgCPUMetrics(b *testing.B) { + v := CPUMetrics{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalCPUMetrics(b *testing.B) { + v := CPUMetrics{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeCPUMetrics(t *testing.T) { + v := CPUMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeCPUMetrics Msgsize() is inaccurate") + } + + vn := CPUMetrics{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeCPUMetrics(b *testing.B) { + v := CPUMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeCPUMetrics(b *testing.B) { + v := CPUMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalDiskIOStats(t *testing.T) { + v := DiskIOStats{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgDiskIOStats(b *testing.B) { + v := DiskIOStats{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgDiskIOStats(b *testing.B) { + v := DiskIOStats{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalDiskIOStats(b *testing.B) { + v := DiskIOStats{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeDiskIOStats(t *testing.T) { + v := DiskIOStats{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeDiskIOStats Msgsize() is inaccurate") + } + + vn := DiskIOStats{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeDiskIOStats(b *testing.B) { + v := DiskIOStats{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeDiskIOStats(b *testing.B) { + v := DiskIOStats{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalDiskMetric(t *testing.T) { + v := DiskMetric{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgDiskMetric(b *testing.B) { + v := DiskMetric{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgDiskMetric(b *testing.B) { + v := DiskMetric{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalDiskMetric(b *testing.B) { + v := DiskMetric{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeDiskMetric(t *testing.T) { + v := DiskMetric{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeDiskMetric Msgsize() is inaccurate") + } + + vn := DiskMetric{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeDiskMetric(b *testing.B) { + v := DiskMetric{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeDiskMetric(b *testing.B) { + v := DiskMetric{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalExpirationInfo(t *testing.T) { + v := ExpirationInfo{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgExpirationInfo(b *testing.B) { + v := ExpirationInfo{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgExpirationInfo(b *testing.B) { + v := ExpirationInfo{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalExpirationInfo(b *testing.B) { + v := ExpirationInfo{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeExpirationInfo(t *testing.T) { + v := ExpirationInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeExpirationInfo Msgsize() is inaccurate") + } + + vn := ExpirationInfo{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeExpirationInfo(b *testing.B) { + v := ExpirationInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeExpirationInfo(b *testing.B) { + v := ExpirationInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalJobMetric(t *testing.T) { + v := JobMetric{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgJobMetric(b *testing.B) { + v := JobMetric{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgJobMetric(b *testing.B) { + v := JobMetric{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalJobMetric(b *testing.B) { + v := JobMetric{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeJobMetric(t *testing.T) { + v := JobMetric{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeJobMetric Msgsize() is inaccurate") + } + + vn := JobMetric{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeJobMetric(b *testing.B) { + v := JobMetric{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeJobMetric(b *testing.B) { + v := JobMetric{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalKeyRotationInfo(t *testing.T) { + v := KeyRotationInfo{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgKeyRotationInfo(b *testing.B) { + v := KeyRotationInfo{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgKeyRotationInfo(b *testing.B) { + v := KeyRotationInfo{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalKeyRotationInfo(b *testing.B) { + v := KeyRotationInfo{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeKeyRotationInfo(t *testing.T) { + v := KeyRotationInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeKeyRotationInfo Msgsize() is inaccurate") + } + + vn := KeyRotationInfo{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeKeyRotationInfo(b *testing.B) { + v := KeyRotationInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeKeyRotationInfo(b *testing.B) { + v := KeyRotationInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalMemInfo(t *testing.T) { + v := MemInfo{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgMemInfo(b *testing.B) { + v := MemInfo{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgMemInfo(b *testing.B) { + v := MemInfo{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalMemInfo(b *testing.B) { + v := MemInfo{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeMemInfo(t *testing.T) { + v := MemInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeMemInfo Msgsize() is inaccurate") + } + + vn := MemInfo{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeMemInfo(b *testing.B) { + v := MemInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeMemInfo(b *testing.B) { + v := MemInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalMemMetrics(t *testing.T) { + v := MemMetrics{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgMemMetrics(b *testing.B) { + v := MemMetrics{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgMemMetrics(b *testing.B) { + v := MemMetrics{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalMemMetrics(b *testing.B) { + v := MemMetrics{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeMemMetrics(t *testing.T) { + v := MemMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeMemMetrics Msgsize() is inaccurate") + } + + vn := MemMetrics{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeMemMetrics(b *testing.B) { + v := MemMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeMemMetrics(b *testing.B) { + v := MemMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalMetrics(t *testing.T) { + v := Metrics{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgMetrics(b *testing.B) { + v := Metrics{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgMetrics(b *testing.B) { + v := Metrics{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalMetrics(b *testing.B) { + v := Metrics{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeMetrics(t *testing.T) { + v := Metrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeMetrics Msgsize() is inaccurate") + } + + vn := Metrics{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeMetrics(b *testing.B) { + v := Metrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeMetrics(b *testing.B) { + v := Metrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalMetricsOptions(t *testing.T) { + v := MetricsOptions{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgMetricsOptions(b *testing.B) { + v := MetricsOptions{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgMetricsOptions(b *testing.B) { + v := MetricsOptions{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalMetricsOptions(b *testing.B) { + v := MetricsOptions{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeMetricsOptions(t *testing.T) { + v := MetricsOptions{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeMetricsOptions Msgsize() is inaccurate") + } + + vn := MetricsOptions{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeMetricsOptions(b *testing.B) { + v := MetricsOptions{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeMetricsOptions(b *testing.B) { + v := MetricsOptions{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalNetMetrics(t *testing.T) { + v := NetMetrics{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgNetMetrics(b *testing.B) { + v := NetMetrics{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgNetMetrics(b *testing.B) { + v := NetMetrics{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalNetMetrics(b *testing.B) { + v := NetMetrics{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeNetMetrics(t *testing.T) { + v := NetMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeNetMetrics Msgsize() is inaccurate") + } + + vn := NetMetrics{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeNetMetrics(b *testing.B) { + v := NetMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeNetMetrics(b *testing.B) { + v := NetMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalOSMetrics(t *testing.T) { + v := OSMetrics{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgOSMetrics(b *testing.B) { + v := OSMetrics{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgOSMetrics(b *testing.B) { + v := OSMetrics{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalOSMetrics(b *testing.B) { + v := OSMetrics{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeOSMetrics(t *testing.T) { + v := OSMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeOSMetrics Msgsize() is inaccurate") + } + + vn := OSMetrics{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeOSMetrics(b *testing.B) { + v := OSMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeOSMetrics(b *testing.B) { + v := OSMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalRPCMetrics(t *testing.T) { + v := RPCMetrics{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgRPCMetrics(b *testing.B) { + v := RPCMetrics{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgRPCMetrics(b *testing.B) { + v := RPCMetrics{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalRPCMetrics(b *testing.B) { + v := RPCMetrics{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeRPCMetrics(t *testing.T) { + v := RPCMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeRPCMetrics Msgsize() is inaccurate") + } + + vn := RPCMetrics{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeRPCMetrics(b *testing.B) { + v := RPCMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeRPCMetrics(b *testing.B) { + v := RPCMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalRealtimeMetrics(t *testing.T) { + v := RealtimeMetrics{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgRealtimeMetrics(b *testing.B) { + v := RealtimeMetrics{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgRealtimeMetrics(b *testing.B) { + v := RealtimeMetrics{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalRealtimeMetrics(b *testing.B) { + v := RealtimeMetrics{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeRealtimeMetrics(t *testing.T) { + v := RealtimeMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeRealtimeMetrics Msgsize() is inaccurate") + } + + vn := RealtimeMetrics{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeRealtimeMetrics(b *testing.B) { + v := RealtimeMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeRealtimeMetrics(b *testing.B) { + v := RealtimeMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalReplicateInfo(t *testing.T) { + v := ReplicateInfo{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgReplicateInfo(b *testing.B) { + v := ReplicateInfo{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgReplicateInfo(b *testing.B) { + v := ReplicateInfo{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalReplicateInfo(b *testing.B) { + v := ReplicateInfo{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeReplicateInfo(t *testing.T) { + v := ReplicateInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeReplicateInfo Msgsize() is inaccurate") + } + + vn := ReplicateInfo{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeReplicateInfo(b *testing.B) { + v := ReplicateInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeReplicateInfo(b *testing.B) { + v := ReplicateInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalScannerMetrics(t *testing.T) { + v := ScannerMetrics{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgScannerMetrics(b *testing.B) { + v := ScannerMetrics{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgScannerMetrics(b *testing.B) { + v := ScannerMetrics{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalScannerMetrics(b *testing.B) { + v := ScannerMetrics{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeScannerMetrics(t *testing.T) { + v := ScannerMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeScannerMetrics Msgsize() is inaccurate") + } + + vn := ScannerMetrics{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeScannerMetrics(b *testing.B) { + v := ScannerMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeScannerMetrics(b *testing.B) { + v := ScannerMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalSiteResyncMetrics(t *testing.T) { + v := SiteResyncMetrics{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgSiteResyncMetrics(b *testing.B) { + v := SiteResyncMetrics{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgSiteResyncMetrics(b *testing.B) { + v := SiteResyncMetrics{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalSiteResyncMetrics(b *testing.B) { + v := SiteResyncMetrics{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeSiteResyncMetrics(t *testing.T) { + v := SiteResyncMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeSiteResyncMetrics Msgsize() is inaccurate") + } + + vn := SiteResyncMetrics{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeSiteResyncMetrics(b *testing.B) { + v := SiteResyncMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeSiteResyncMetrics(b *testing.B) { + v := SiteResyncMetrics{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} diff --git a/scanner.go b/scanner.go index f1ca670..c64d8a3 100644 --- a/scanner.go +++ b/scanner.go @@ -26,14 +26,18 @@ import ( "time" ) +//msgp:clearomitted +//go:generate msgp + // BucketScanInfo contains information of a bucket scan in a given pool/set type BucketScanInfo struct { - Pool, Set int - Cycle uint64 - Ongoing bool - LastUpdate time.Time - LastStarted time.Time - Completed []time.Time + Pool int `msg:"pool"` + Set int `msg:"set"` + Cycle uint64 `msg:"cycle"` + Ongoing bool `msg:"ongoing"` + LastUpdate time.Time `msg:"last_update"` + LastStarted time.Time `msg:"last_started"` + Completed []time.Time `msg:"completed,omitempty"` } // BucketScanInfo returns information of a bucket scan in all pools/sets diff --git a/scanner_gen.go b/scanner_gen.go new file mode 100644 index 0000000..a65718f --- /dev/null +++ b/scanner_gen.go @@ -0,0 +1,347 @@ +package madmin + +// Code generated by github.com/tinylib/msgp DO NOT EDIT. + +import ( + "time" + + "github.com/tinylib/msgp/msgp" +) + +// DecodeMsg implements msgp.Decodable +func (z *BucketScanInfo) 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 /* 1 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "pool": + z.Pool, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "Pool") + return + } + case "set": + z.Set, err = dc.ReadInt() + if err != nil { + err = msgp.WrapError(err, "Set") + return + } + case "cycle": + z.Cycle, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "Cycle") + return + } + case "ongoing": + z.Ongoing, err = dc.ReadBool() + if err != nil { + err = msgp.WrapError(err, "Ongoing") + return + } + case "last_update": + z.LastUpdate, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "LastUpdate") + return + } + case "last_started": + z.LastStarted, err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "LastStarted") + return + } + case "completed": + var zb0002 uint32 + zb0002, err = dc.ReadArrayHeader() + if err != nil { + err = msgp.WrapError(err, "Completed") + return + } + if cap(z.Completed) >= int(zb0002) { + z.Completed = (z.Completed)[:zb0002] + } else { + z.Completed = make([]time.Time, zb0002) + } + for za0001 := range z.Completed { + z.Completed[za0001], err = dc.ReadTime() + if err != nil { + err = msgp.WrapError(err, "Completed", za0001) + return + } + } + zb0001Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1 { + if (zb0001Mask & 0x1) == 0 { + z.Completed = nil + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z *BucketScanInfo) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(7) + var zb0001Mask uint8 /* 7 bits */ + _ = zb0001Mask + if z.Completed == nil { + zb0001Len-- + zb0001Mask |= 0x40 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + // write "pool" + err = en.Append(0xa4, 0x70, 0x6f, 0x6f, 0x6c) + if err != nil { + return + } + err = en.WriteInt(z.Pool) + if err != nil { + err = msgp.WrapError(err, "Pool") + return + } + // write "set" + err = en.Append(0xa3, 0x73, 0x65, 0x74) + if err != nil { + return + } + err = en.WriteInt(z.Set) + if err != nil { + err = msgp.WrapError(err, "Set") + return + } + // write "cycle" + err = en.Append(0xa5, 0x63, 0x79, 0x63, 0x6c, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.Cycle) + if err != nil { + err = msgp.WrapError(err, "Cycle") + return + } + // write "ongoing" + err = en.Append(0xa7, 0x6f, 0x6e, 0x67, 0x6f, 0x69, 0x6e, 0x67) + if err != nil { + return + } + err = en.WriteBool(z.Ongoing) + if err != nil { + err = msgp.WrapError(err, "Ongoing") + return + } + // write "last_update" + err = en.Append(0xab, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65) + if err != nil { + return + } + err = en.WriteTime(z.LastUpdate) + if err != nil { + err = msgp.WrapError(err, "LastUpdate") + return + } + // write "last_started" + err = en.Append(0xac, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteTime(z.LastStarted) + if err != nil { + err = msgp.WrapError(err, "LastStarted") + return + } + if (zb0001Mask & 0x40) == 0 { // if not omitted + // write "completed" + err = en.Append(0xa9, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Completed))) + if err != nil { + err = msgp.WrapError(err, "Completed") + return + } + for za0001 := range z.Completed { + err = en.WriteTime(z.Completed[za0001]) + if err != nil { + err = msgp.WrapError(err, "Completed", za0001) + return + } + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z *BucketScanInfo) 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.Completed == nil { + zb0001Len-- + zb0001Mask |= 0x40 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + // string "pool" + o = append(o, 0xa4, 0x70, 0x6f, 0x6f, 0x6c) + o = msgp.AppendInt(o, z.Pool) + // string "set" + o = append(o, 0xa3, 0x73, 0x65, 0x74) + o = msgp.AppendInt(o, z.Set) + // string "cycle" + o = append(o, 0xa5, 0x63, 0x79, 0x63, 0x6c, 0x65) + o = msgp.AppendUint64(o, z.Cycle) + // string "ongoing" + o = append(o, 0xa7, 0x6f, 0x6e, 0x67, 0x6f, 0x69, 0x6e, 0x67) + o = msgp.AppendBool(o, z.Ongoing) + // string "last_update" + o = append(o, 0xab, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65) + o = msgp.AppendTime(o, z.LastUpdate) + // string "last_started" + o = append(o, 0xac, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64) + o = msgp.AppendTime(o, z.LastStarted) + if (zb0001Mask & 0x40) == 0 { // if not omitted + // string "completed" + o = append(o, 0xa9, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64) + o = msgp.AppendArrayHeader(o, uint32(len(z.Completed))) + for za0001 := range z.Completed { + o = msgp.AppendTime(o, z.Completed[za0001]) + } + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *BucketScanInfo) 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 /* 1 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 "pool": + z.Pool, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Pool") + return + } + case "set": + z.Set, bts, err = msgp.ReadIntBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Set") + return + } + case "cycle": + z.Cycle, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Cycle") + return + } + case "ongoing": + z.Ongoing, bts, err = msgp.ReadBoolBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Ongoing") + return + } + case "last_update": + z.LastUpdate, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LastUpdate") + return + } + case "last_started": + z.LastStarted, bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "LastStarted") + return + } + case "completed": + var zb0002 uint32 + zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Completed") + return + } + if cap(z.Completed) >= int(zb0002) { + z.Completed = (z.Completed)[:zb0002] + } else { + z.Completed = make([]time.Time, zb0002) + } + for za0001 := range z.Completed { + z.Completed[za0001], bts, err = msgp.ReadTimeBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Completed", za0001) + return + } + } + zb0001Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1 { + if (zb0001Mask & 0x1) == 0 { + z.Completed = nil + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z *BucketScanInfo) Msgsize() (s int) { + s = 1 + 5 + msgp.IntSize + 4 + msgp.IntSize + 6 + msgp.Uint64Size + 8 + msgp.BoolSize + 12 + msgp.TimeSize + 13 + msgp.TimeSize + 10 + msgp.ArrayHeaderSize + (len(z.Completed) * (msgp.TimeSize)) + return +} diff --git a/scanner_gen_test.go b/scanner_gen_test.go new file mode 100644 index 0000000..bf9b70f --- /dev/null +++ b/scanner_gen_test.go @@ -0,0 +1,123 @@ +package madmin + +// Code generated by github.com/tinylib/msgp DO NOT EDIT. + +import ( + "bytes" + "testing" + + "github.com/tinylib/msgp/msgp" +) + +func TestMarshalUnmarshalBucketScanInfo(t *testing.T) { + v := BucketScanInfo{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgBucketScanInfo(b *testing.B) { + v := BucketScanInfo{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgBucketScanInfo(b *testing.B) { + v := BucketScanInfo{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalBucketScanInfo(b *testing.B) { + v := BucketScanInfo{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeBucketScanInfo(t *testing.T) { + v := BucketScanInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeBucketScanInfo Msgsize() is inaccurate") + } + + vn := BucketScanInfo{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeBucketScanInfo(b *testing.B) { + v := BucketScanInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeBucketScanInfo(b *testing.B) { + v := BucketScanInfo{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} diff --git a/utils.go b/utils.go index 2b92cc9..a67b905 100644 --- a/utils.go +++ b/utils.go @@ -25,10 +25,15 @@ import ( "net/http" "net/url" "strings" + "time" "github.com/minio/minio-go/v7/pkg/s3utils" ) +//msgp:clearomitted +//msgp:tag json +//go:generate msgp + // AdminAPIVersion - admin api version used in the request. const ( AdminAPIVersion = "v3" @@ -119,3 +124,54 @@ func closeResponse(resp *http.Response) { resp.Body.Close() } } + +// TimedAction contains a number of actions and their accumulated duration in nanoseconds. +type TimedAction struct { + Count uint64 `json:"count"` + AccTime uint64 `json:"acc_time_ns"` + Bytes uint64 `json:"bytes,omitempty"` +} + +// Avg returns the average time spent on the action. +func (t TimedAction) Avg() time.Duration { + if t.Count == 0 { + return 0 + } + return time.Duration(t.AccTime / t.Count) +} + +// AvgBytes returns the average time spent on the action. +func (t TimedAction) AvgBytes() uint64 { + if t.Count == 0 { + return 0 + } + return t.Bytes / t.Count +} + +// Merge other into t. +func (t *TimedAction) Merge(other TimedAction) { + t.Count += other.Count + t.AccTime += other.AccTime + t.Bytes += other.Bytes +} + +// NodeCommon - Common fields across most node-specific health structs +type NodeCommon struct { + Addr string `json:"addr"` + Error string `json:"error,omitempty"` +} + +// GetAddr - return the address of the node +func (n *NodeCommon) GetAddr() string { + return n.Addr +} + +// SetAddr - set the address of the node +func (n *NodeCommon) SetAddr(addr string) { + n.Addr = addr +} + +// SetError - set the address of the node +func (n *NodeCommon) SetError(err string) { + n.Error = err +} diff --git a/utils_gen.go b/utils_gen.go new file mode 100644 index 0000000..a5b780d --- /dev/null +++ b/utils_gen.go @@ -0,0 +1,386 @@ +package madmin + +// Code generated by github.com/tinylib/msgp DO NOT EDIT. + +import ( + "github.com/tinylib/msgp/msgp" +) + +// DecodeMsg implements msgp.Decodable +func (z *NodeCommon) 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 /* 1 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "addr": + z.Addr, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Addr") + return + } + case "error": + z.Error, err = dc.ReadString() + if err != nil { + err = msgp.WrapError(err, "Error") + return + } + zb0001Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1 { + if (zb0001Mask & 0x1) == 0 { + z.Error = "" + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z NodeCommon) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(2) + var zb0001Mask uint8 /* 2 bits */ + _ = zb0001Mask + if z.Error == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + // write "addr" + err = en.Append(0xa4, 0x61, 0x64, 0x64, 0x72) + if err != nil { + return + } + err = en.WriteString(z.Addr) + if err != nil { + err = msgp.WrapError(err, "Addr") + return + } + if (zb0001Mask & 0x2) == 0 { // if not omitted + // write "error" + err = en.Append(0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72) + if err != nil { + return + } + err = en.WriteString(z.Error) + if err != nil { + err = msgp.WrapError(err, "Error") + return + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z NodeCommon) 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.Error == "" { + zb0001Len-- + zb0001Mask |= 0x2 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + // string "addr" + o = append(o, 0xa4, 0x61, 0x64, 0x64, 0x72) + o = msgp.AppendString(o, z.Addr) + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "error" + o = append(o, 0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72) + o = msgp.AppendString(o, z.Error) + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *NodeCommon) 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 /* 1 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 "addr": + z.Addr, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Addr") + return + } + case "error": + z.Error, bts, err = msgp.ReadStringBytes(bts) + if err != nil { + err = msgp.WrapError(err, "Error") + return + } + zb0001Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1 { + if (zb0001Mask & 0x1) == 0 { + z.Error = "" + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z NodeCommon) Msgsize() (s int) { + s = 1 + 5 + msgp.StringPrefixSize + len(z.Addr) + 6 + msgp.StringPrefixSize + len(z.Error) + return +} + +// DecodeMsg implements msgp.Decodable +func (z *TimedAction) 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 /* 1 bits */ + _ = zb0001Mask + for zb0001 > 0 { + zb0001-- + field, err = dc.ReadMapKeyPtr() + if err != nil { + err = msgp.WrapError(err) + return + } + switch msgp.UnsafeString(field) { + case "count": + z.Count, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "Count") + return + } + case "acc_time_ns": + z.AccTime, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "AccTime") + return + } + case "bytes": + z.Bytes, err = dc.ReadUint64() + if err != nil { + err = msgp.WrapError(err, "Bytes") + return + } + zb0001Mask |= 0x1 + default: + err = dc.Skip() + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1 { + if (zb0001Mask & 0x1) == 0 { + z.Bytes = 0 + } + } + return +} + +// EncodeMsg implements msgp.Encodable +func (z TimedAction) EncodeMsg(en *msgp.Writer) (err error) { + // check for omitted fields + zb0001Len := uint32(3) + var zb0001Mask uint8 /* 3 bits */ + _ = zb0001Mask + if z.Bytes == 0 { + zb0001Len-- + zb0001Mask |= 0x4 + } + // variable map header, size zb0001Len + err = en.Append(0x80 | uint8(zb0001Len)) + if err != nil { + return + } + if zb0001Len == 0 { + return + } + // write "count" + err = en.Append(0xa5, 0x63, 0x6f, 0x75, 0x6e, 0x74) + if err != nil { + return + } + err = en.WriteUint64(z.Count) + if err != nil { + err = msgp.WrapError(err, "Count") + return + } + // write "acc_time_ns" + err = en.Append(0xab, 0x61, 0x63, 0x63, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6e, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.AccTime) + if err != nil { + err = msgp.WrapError(err, "AccTime") + return + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "bytes" + err = en.Append(0xa5, 0x62, 0x79, 0x74, 0x65, 0x73) + if err != nil { + return + } + err = en.WriteUint64(z.Bytes) + if err != nil { + err = msgp.WrapError(err, "Bytes") + return + } + } + return +} + +// MarshalMsg implements msgp.Marshaler +func (z TimedAction) MarshalMsg(b []byte) (o []byte, err error) { + o = msgp.Require(b, z.Msgsize()) + // check for omitted fields + zb0001Len := uint32(3) + var zb0001Mask uint8 /* 3 bits */ + _ = zb0001Mask + if z.Bytes == 0 { + zb0001Len-- + zb0001Mask |= 0x4 + } + // variable map header, size zb0001Len + o = append(o, 0x80|uint8(zb0001Len)) + if zb0001Len == 0 { + return + } + // string "count" + o = append(o, 0xa5, 0x63, 0x6f, 0x75, 0x6e, 0x74) + o = msgp.AppendUint64(o, z.Count) + // string "acc_time_ns" + o = append(o, 0xab, 0x61, 0x63, 0x63, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6e, 0x73) + o = msgp.AppendUint64(o, z.AccTime) + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "bytes" + o = append(o, 0xa5, 0x62, 0x79, 0x74, 0x65, 0x73) + o = msgp.AppendUint64(o, z.Bytes) + } + return +} + +// UnmarshalMsg implements msgp.Unmarshaler +func (z *TimedAction) 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 /* 1 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 "count": + z.Count, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Count") + return + } + case "acc_time_ns": + z.AccTime, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "AccTime") + return + } + case "bytes": + z.Bytes, bts, err = msgp.ReadUint64Bytes(bts) + if err != nil { + err = msgp.WrapError(err, "Bytes") + return + } + zb0001Mask |= 0x1 + default: + bts, err = msgp.Skip(bts) + if err != nil { + err = msgp.WrapError(err) + return + } + } + } + // Clear omitted fields. + if zb0001Mask != 0x1 { + if (zb0001Mask & 0x1) == 0 { + z.Bytes = 0 + } + } + o = bts + return +} + +// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message +func (z TimedAction) Msgsize() (s int) { + s = 1 + 6 + msgp.Uint64Size + 12 + msgp.Uint64Size + 6 + msgp.Uint64Size + return +} diff --git a/utils_gen_test.go b/utils_gen_test.go new file mode 100644 index 0000000..069afb5 --- /dev/null +++ b/utils_gen_test.go @@ -0,0 +1,236 @@ +package madmin + +// Code generated by github.com/tinylib/msgp DO NOT EDIT. + +import ( + "bytes" + "testing" + + "github.com/tinylib/msgp/msgp" +) + +func TestMarshalUnmarshalNodeCommon(t *testing.T) { + v := NodeCommon{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgNodeCommon(b *testing.B) { + v := NodeCommon{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgNodeCommon(b *testing.B) { + v := NodeCommon{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalNodeCommon(b *testing.B) { + v := NodeCommon{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeNodeCommon(t *testing.T) { + v := NodeCommon{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeNodeCommon Msgsize() is inaccurate") + } + + vn := NodeCommon{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeNodeCommon(b *testing.B) { + v := NodeCommon{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeNodeCommon(b *testing.B) { + v := NodeCommon{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +} + +func TestMarshalUnmarshalTimedAction(t *testing.T) { + v := TimedAction{} + bts, err := v.MarshalMsg(nil) + if err != nil { + t.Fatal(err) + } + left, err := v.UnmarshalMsg(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) + } + + left, err = msgp.Skip(bts) + if err != nil { + t.Fatal(err) + } + if len(left) > 0 { + t.Errorf("%d bytes left over after Skip(): %q", len(left), left) + } +} + +func BenchmarkMarshalMsgTimedAction(b *testing.B) { + v := TimedAction{} + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.MarshalMsg(nil) + } +} + +func BenchmarkAppendMsgTimedAction(b *testing.B) { + v := TimedAction{} + bts := make([]byte, 0, v.Msgsize()) + bts, _ = v.MarshalMsg(bts[0:0]) + b.SetBytes(int64(len(bts))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + bts, _ = v.MarshalMsg(bts[0:0]) + } +} + +func BenchmarkUnmarshalTimedAction(b *testing.B) { + v := TimedAction{} + bts, _ := v.MarshalMsg(nil) + b.ReportAllocs() + b.SetBytes(int64(len(bts))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := v.UnmarshalMsg(bts) + if err != nil { + b.Fatal(err) + } + } +} + +func TestEncodeDecodeTimedAction(t *testing.T) { + v := TimedAction{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + + m := v.Msgsize() + if buf.Len() > m { + t.Log("WARNING: TestEncodeDecodeTimedAction Msgsize() is inaccurate") + } + + vn := TimedAction{} + err := msgp.Decode(&buf, &vn) + if err != nil { + t.Error(err) + } + + buf.Reset() + msgp.Encode(&buf, &v) + err = msgp.NewReader(&buf).Skip() + if err != nil { + t.Error(err) + } +} + +func BenchmarkEncodeTimedAction(b *testing.B) { + v := TimedAction{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + en := msgp.NewWriter(msgp.Nowhere) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + v.EncodeMsg(en) + } + en.Flush() +} + +func BenchmarkDecodeTimedAction(b *testing.B) { + v := TimedAction{} + var buf bytes.Buffer + msgp.Encode(&buf, &v) + b.SetBytes(int64(buf.Len())) + rd := msgp.NewEndlessReader(buf.Bytes(), b) + dc := msgp.NewReader(rd) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := v.DecodeMsg(dc) + if err != nil { + b.Fatal(err) + } + } +}