@@ -116,7 +116,7 @@ func (s *fieldStats) add(ll baker.Record) {
116116 s .m [string (b )]++
117117}
118118
119- func (s * fieldStats ) print (w io.Writer , fieldName func (baker. FieldIndex ) string ) error {
119+ func (s * fieldStats ) print (w io.Writer , fieldNames [] string ) error {
120120 var smallest , biggest uint = math .MaxUint32 , 0
121121
122122 qt := quantile .NewTargeted (0.01 , 0.05 , 0.1 , 0.25 , 0.5 , 0.75 , 0.90 , 0.95 , 0.99 )
@@ -135,7 +135,7 @@ func (s *fieldStats) print(w io.Writer, fieldName func(baker.FieldIndex) string)
135135 csvw := csv .NewWriter (w )
136136 if err := csvw .Write (
137137 []string {fmt .Sprintf (
138- "num samples (%s)" , fieldName ( s .field ) ),
138+ "num samples (%s)" , fieldNames [ s .field ] ),
139139 "smallest" ,
140140 "1st %%ile" , "5th %%ile" , "10th %%ile" , "25th %%ile" , "50th %%ile" , "75th %%ile" , "90th %%ile" , "95th %%ile" , "99th %%ile" ,
141141 "biggest" }); err != nil {
@@ -330,9 +330,9 @@ func (s *Stats) createStatsCSV() error {
330330 (& s .times ).print (buf )
331331 }
332332 for i := range s .fields {
333- fname := s .cfg .FieldName ( s .fields [i ].field )
333+ fname := s .cfg .FieldNames [ s .fields [i ].field ]
334334 fmt .Fprintf (buf , "section,%s,distribution of number of log lines per distinct %s value\n " , fname , fname )
335- s .fields [i ].print (buf , s .cfg .FieldName )
335+ s .fields [i ].print (buf , s .cfg .FieldNames )
336336 }
337337 return ioutil .WriteFile (s .csvPath , buf .Bytes (), os .ModePerm )
338338
0 commit comments