MCPcopy Create free account
hub / github.com/AdRoll/baker / createStatsCSV

Method createStatsCSV

output/stats.go:319–334  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

317}
318
319func (s *Stats) createStatsCSV() error {
320 buf := &bytes.Buffer{}
321 fmt.Fprintln(buf, "section,log line sizes,distribution of log lines sizes")
322 (&s.sizes).print(buf)
323 if s.times.fieldIdx != -1 {
324 fmt.Fprintln(buf, "section,timestamps,distribution of timestamps")
325 (&s.times).print(buf)
326 }
327 for i := range s.fields {
328 fname := s.cfg.FieldNames[s.fields[i].field]
329 fmt.Fprintf(buf, "section,%s,distribution of number of log lines per distinct %s value\n", fname, fname)
330 s.fields[i].print(buf, s.cfg.FieldNames)
331 }
332 return os.WriteFile(s.csvPath, buf.Bytes(), os.ModePerm)
333
334}
335
336// Stats implements baker.Output
337func (s *Stats) Stats() baker.OutputStats {

Callers 1

RunMethod · 0.95

Calls 1

printMethod · 0.45

Tested by

no test coverage detected