2024-02-19 17:54:46 -05:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
// Code generated by github.com/tinylib/msgp DO NOT EDIT.
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/tinylib/msgp/msgp"
|
|
|
|
)
|
|
|
|
|
2024-03-10 05:15:15 -04:00
|
|
|
func TestMarshalUnmarshalMetricDescription(t *testing.T) {
|
|
|
|
v := MetricDescription{}
|
2024-02-19 17:54:46 -05:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-10 05:15:15 -04:00
|
|
|
func BenchmarkMarshalMsgMetricDescription(b *testing.B) {
|
|
|
|
v := MetricDescription{}
|
2024-02-19 17:54:46 -05:00
|
|
|
b.ReportAllocs()
|
|
|
|
b.ResetTimer()
|
|
|
|
for i := 0; i < b.N; i++ {
|
|
|
|
v.MarshalMsg(nil)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-10 05:15:15 -04:00
|
|
|
func BenchmarkAppendMsgMetricDescription(b *testing.B) {
|
|
|
|
v := MetricDescription{}
|
2024-02-19 17:54:46 -05:00
|
|
|
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])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-10 05:15:15 -04:00
|
|
|
func BenchmarkUnmarshalMetricDescription(b *testing.B) {
|
|
|
|
v := MetricDescription{}
|
2024-02-19 17:54:46 -05:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-10 05:15:15 -04:00
|
|
|
func TestMarshalUnmarshalMetricV2(t *testing.T) {
|
|
|
|
v := MetricV2{}
|
2024-02-19 17:54:46 -05:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-10 05:15:15 -04:00
|
|
|
func BenchmarkMarshalMsgMetricV2(b *testing.B) {
|
|
|
|
v := MetricV2{}
|
2024-02-19 17:54:46 -05:00
|
|
|
b.ReportAllocs()
|
|
|
|
b.ResetTimer()
|
|
|
|
for i := 0; i < b.N; i++ {
|
|
|
|
v.MarshalMsg(nil)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-10 05:15:15 -04:00
|
|
|
func BenchmarkAppendMsgMetricV2(b *testing.B) {
|
|
|
|
v := MetricV2{}
|
2024-02-19 17:54:46 -05:00
|
|
|
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])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-10 05:15:15 -04:00
|
|
|
func BenchmarkUnmarshalMetricV2(b *testing.B) {
|
|
|
|
v := MetricV2{}
|
2024-02-19 17:54:46 -05:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-10 05:15:15 -04:00
|
|
|
func TestMarshalUnmarshalMetricsGroupOpts(t *testing.T) {
|
|
|
|
v := MetricsGroupOpts{}
|
2024-02-19 17:54:46 -05:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-10 05:15:15 -04:00
|
|
|
func BenchmarkMarshalMsgMetricsGroupOpts(b *testing.B) {
|
|
|
|
v := MetricsGroupOpts{}
|
2024-02-19 17:54:46 -05:00
|
|
|
b.ReportAllocs()
|
|
|
|
b.ResetTimer()
|
|
|
|
for i := 0; i < b.N; i++ {
|
|
|
|
v.MarshalMsg(nil)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-10 05:15:15 -04:00
|
|
|
func BenchmarkAppendMsgMetricsGroupOpts(b *testing.B) {
|
|
|
|
v := MetricsGroupOpts{}
|
2024-02-19 17:54:46 -05:00
|
|
|
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])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-10 05:15:15 -04:00
|
|
|
func BenchmarkUnmarshalMetricsGroupOpts(b *testing.B) {
|
|
|
|
v := MetricsGroupOpts{}
|
2024-02-19 17:54:46 -05:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-10 05:15:15 -04:00
|
|
|
func TestMarshalUnmarshalMetricsGroupV2(t *testing.T) {
|
|
|
|
v := MetricsGroupV2{}
|
2024-02-19 17:54:46 -05:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-10 05:15:15 -04:00
|
|
|
func BenchmarkMarshalMsgMetricsGroupV2(b *testing.B) {
|
|
|
|
v := MetricsGroupV2{}
|
2024-02-19 17:54:46 -05:00
|
|
|
b.ReportAllocs()
|
|
|
|
b.ResetTimer()
|
|
|
|
for i := 0; i < b.N; i++ {
|
|
|
|
v.MarshalMsg(nil)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-10 05:15:15 -04:00
|
|
|
func BenchmarkAppendMsgMetricsGroupV2(b *testing.B) {
|
|
|
|
v := MetricsGroupV2{}
|
2024-02-19 17:54:46 -05:00
|
|
|
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])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-10 05:15:15 -04:00
|
|
|
func BenchmarkUnmarshalMetricsGroupV2(b *testing.B) {
|
|
|
|
v := MetricsGroupV2{}
|
2024-02-19 17:54:46 -05:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|