public class PrintUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static String |
COUNTERS_TABLE_COLUMN_COUNTER |
protected static String |
COUNTERS_TABLE_COLUMN_ELAPSED_TIME |
protected static String |
COUNTERS_TABLE_COLUMN_TIME_UNIT |
protected static String |
COUNTERS_TABLE_HEADER |
protected static String |
COUNTERS_TABLE_ROW_FORMAT |
protected static String |
COUNTERS_TABLE_ROW_SEPARATOR |
protected static String |
LINE_SEPARATOR |
| Modifier and Type | Method and Description |
|---|---|
static void |
printCounters(Collection<Counter> counters,
PrintStream printStream)
Prints the statistics for the given counters in the specified print stream.
|
static void |
printCounters(Collection<Counter> counters,
PrintStream printStream,
TimeUnit timeUnit)
Prints the statistics for the given counters in the specified print stream.
|
static void |
printStopwatch(Stopwatch stopwatch,
PrintStream printStream)
Prints the statistics for the given stopwatch in the specified print stream.
|
static void |
printStopwatch(Stopwatch stopwatch,
PrintStream printStream,
TimeUnit timeUnit)
Prints the statistics for the given stopwatch in the specified print stream.
|
protected static String |
toRowFormat(Counter counter)
Returns a row with the given counter.
|
protected static String |
toRowFormat(Counter counter,
TimeUnit timeUnit)
Returns a row with the given counter.
|
protected static String |
toTableFormat(Collection<Counter> counters)
Returns a table with counters and elapsed times
|
protected static String |
toTableFormat(Collection<Counter> counters,
TimeUnit timeUnit)
Returns a table with counters and elapsed times in a given time unit.
|
protected static final String LINE_SEPARATOR
protected static final String COUNTERS_TABLE_COLUMN_TIME_UNIT
protected static final String COUNTERS_TABLE_COLUMN_ELAPSED_TIME
protected static final String COUNTERS_TABLE_COLUMN_COUNTER
protected static final String COUNTERS_TABLE_ROW_FORMAT
protected static final String COUNTERS_TABLE_ROW_SEPARATOR
protected static final String COUNTERS_TABLE_HEADER
public static void printStopwatch(Stopwatch stopwatch, PrintStream printStream)
stopwatch - the stopwatch to be printedprintStream - the print stream to which statistics will be sentNullPointerException - if a null stopwatch or print stream is receivedpublic static void printCounters(Collection<Counter> counters, PrintStream printStream)
counters - the counters to be printedprintStream - the print stream to which statistics will be sentNullPointerException - if a null stopwatch or print stream is receivedpublic static void printStopwatch(Stopwatch stopwatch, PrintStream printStream, TimeUnit timeUnit)
stopwatch - the stopwatch to be printedprintStream - the print stream to which statistics will be senttimeUnit - the time unit in which elapsed times will be displayed; if null, the
default time unit specified for each counter will be appliedNullPointerException - if a null stopwatch or print stream is receivedpublic static void printCounters(Collection<Counter> counters, PrintStream printStream, TimeUnit timeUnit)
counters - the counters to be printedprintStream - the print stream to which statistics will be senttimeUnit - the time unit in which elapsed times will be displayed; if null, the
default time unit specified for each counter will be appliedNullPointerException - if a null collection or print stream is receivedprotected static String toTableFormat(Collection<Counter> counters)
counters - the counters whose data will be fetchedprotected static String toTableFormat(Collection<Counter> counters, TimeUnit timeUnit)
counters - the counters whose data will be fetchedtimeUnit - the time unit in which elapsed times will be displayed; if null, the
default time unit specified for each counter will be appliedprotected static String toRowFormat(Counter counter)
counter - the counter whose data will be fetchedprotected static String toRowFormat(Counter counter, TimeUnit timeUnit)
counter - the counter whose data will be fetchedtimeUnit - the time unit in which the counter's elapsed time will be displayed
(cannot be null)Copyright © 2019. All rights reserved.