func BenchmarkNewFluentRecordSetJSON(b *testing.B) { b.ResetTimer() buf := []byte(createRecordsetSampleJSON(10)) for i := 0; i < b.N; i++ { _ = hydra.NewFluentRecordSet("dummy", "message", hydra.FormatJSON, nil, nil, buf) } }
func TestNewFluentRecordSetJSON(t *testing.T) { buf := []byte(createRecordsetSampleJSON(1)) record := hydra.NewFluentRecordSet("dummy", "message", hydra.FormatJSON, nil, nil, buf) if record.Tag != "dummy" { t.Errorf("invalid tag: %s", record.Tag) } if len(record.Records) != 1 { t.Errorf("invalid record length: %#v", len(record.Records)) } }
func prepareRecordSet() *fluent.FluentRecordSet { message := strings.Join(TestMessageLines, "\n") messageBytes := []byte(message) return hydra.NewFluentRecordSet(TestTag, TestFieldName, hydra.FormatNone, nil, nil, messageBytes) }