Fix names and add missing methods

This commit is contained in:
Lou Knauer
2022-07-26 10:04:58 +02:00
parent 03a5dee97a
commit d54bedc82f
7 changed files with 239 additions and 169 deletions

View File

@@ -187,7 +187,7 @@ func reorder(buf, prefix []byte) []byte {
// Decode lines using dec and make write calls to the MemoryStore.
// If a line is missing its cluster tag, use clusterDefault as default.
func decodeLine(memoryStore *memstore.MemoryStore, dec *lineprotocol.Decoder, clusterDefault string) error {
func DecodeLine(memoryStore *memstore.MemoryStore, dec *lineprotocol.Decoder, clusterDefault string) error {
// Reduce allocations in loop:
t := time.Now()
metric, metricBuf := types.Metric{}, make([]byte, 0, 16)

View File

@@ -139,7 +139,7 @@ func BenchmarkLineprotocolDecoder(b *testing.B) {
dec := lineprotocol.NewDecoderWithBytes(data)
b.StartTimer()
if err := decodeLine(memoryStore, dec, "ctest"); err != nil {
if err := DecodeLine(memoryStore, dec, "ctest"); err != nil {
b.Fatal(err)
}
b.StopTimer()