(b *testing.B)
| 205 | } |
| 206 | |
| 207 | func BenchmarkEncodeMetric(b *testing.B) { |
| 208 | v := Metric{} |
| 209 | var buf bytes.Buffer |
| 210 | msgp.Encode(&buf, &v) |
| 211 | b.SetBytes(int64(buf.Len())) |
| 212 | en := msgp.NewWriter(msgp.Nowhere) |
| 213 | b.ReportAllocs() |
| 214 | b.ResetTimer() |
| 215 | for i := 0; i < b.N; i++ { |
| 216 | v.EncodeMsg(en) |
| 217 | } |
| 218 | en.Flush() |
| 219 | } |
| 220 | |
| 221 | func BenchmarkDecodeMetric(b *testing.B) { |
| 222 | v := Metric{} |