2424public abstract class Format {
2525
2626 public static String asCSV (EventCounter inEventCounter ) {
27- StringBuffer sb = new StringBuffer (1000 );
27+ StringBuilder sb = new StringBuilder (1000 );
2828 sb .append (metricAsCSV (inEventCounter ));
2929
3030 sb .append (", " ).append (inEventCounter .getCount ());
3131 sb .append (", " ).append (Format .toDecimalFormat (inEventCounter .getCumulativeFreq ()));
3232 sb .append (", " ).append (Format .toDecimalFormat (inEventCounter .getCurrentFreq ()));
3333
3434 EventCounterInterval i = inEventCounter .getPeakEventsInterval ();
35- sb .append (", " + Format .toDecimalFormat (i .getEventRatePerSecond ()));
36- sb .append (", " + i .getStartTime ());
35+ sb .append (", " ). append ( Format .toDecimalFormat (i .getEventRatePerSecond ()));
36+ sb .append (", " ). append ( i .getStartTime ());
3737
3838 return sb .toString ();
3939 }
4040
4141 public static String asCSV (SessionCounter inSessionCounter ) {
42- StringBuffer sb = new StringBuffer (1000 );
42+ StringBuilder sb = new StringBuilder (1000 );
4343 sb .append (asCSV ((EventCounter ) inSessionCounter ));
4444
4545 sb .append (", " ).append (inSessionCounter .getConcurrency ());
@@ -56,10 +56,7 @@ public static String asCSV(SessionCounter inSessionCounter) {
5656 }
5757
5858 public static String metricAsCSV (Metric inMetric ) {
59- StringBuffer sb = new StringBuffer (1000 );
60- sb .append (inMetric .getLabel ());
61- sb .append (", " ).append (Format .toDecimalFormat (inMetric .getAge ()));
62- return sb .toString ();
59+ return inMetric .getLabel () + ", " + Format .toDecimalFormat (inMetric .getAge ());
6360 }
6461
6562 public static String percent (double inValue , double inBase ) {
0 commit comments