public class PrintStyle extends Object
PrintFormat to generate a String output
out of a Stopwatch or MonitoredOperation.| Modifier and Type | Field and Description |
|---|---|
static PrintStyle |
DETAILED_CSV
A string-based style for the detailed stopwatch formatter, which prints data as
CSV (comma-separated values).
|
static PrintStyle |
DETAILED_CSV_ISO_8601
A string-based style for the detailed stopwatch formatter, which prints data as
CSV (comma-separated values), with elapsed times expressed using the ISO-8601 duration
format.
|
static PrintStyle |
DETAILED_CSV_ISO_8601_NO_HEADER
A string-based style for the detailed stopwatch formatter, which prints data as
CSV (comma-separated values), with elapsed times expressed using the ISO-8601 duration
format and no header.
|
static PrintStyle |
DETAILED_CSV_NO_HEADER
A string-based style for the detailed stopwatch formatter, which prints data as
CSV (comma-separated values), without header.
|
static PrintStyle |
DETAILED_TABLE_FULL
A string-based style for the detailed stopwatch formatter, with horizontal lines
separating each row, and total elapsed time for each counter.
|
static PrintStyle |
DETAILED_XML
A string-based style for the detailed stopwatch formatter, which prints data in
XML format.
|
static PrintStyle |
DETAILED_XML_ISO_8601
A string-based style for the detailed stopwatch formatter, which prints data as
XML with elapsed times expressed using the ISO-8601 duration format.
|
static PrintStyle |
DETAILED_YAML
A string-based style for the detailed stopwatch formatter, which prints data in
YAML format.
|
static PrintStyle |
DETAILED_YAML_ISO_8601
A string-based style for the detailed stopwatch formatter, which prints data as
YAML with elapsed times expressed using the ISO-8601 duration format.
|
static PrintStyle |
LINUX
A string-based style which prints stopwatch data in Linux style.
|
static PrintStyle |
SUMMARIZED_CSV
A string-based style for the summarized stopwatch formatter, which prints data
as CSV (comma-separated values).
|
static PrintStyle |
SUMMARIZED_CSV_ISO_8601
A string-based style for the summarized stopwatch formatter, which prints data
as CSV (comma-separated values), with elapsed times expressed using the ISO-8601
duration format.
|
static PrintStyle |
SUMMARIZED_CSV_ISO_8601_NO_HEADER
A string-based style for the summarized stopwatch formatter, which prints data
as CSV (comma-separated values), with elapsed times expressed using the ISO-8601
duration format and no header.
|
static PrintStyle |
SUMMARIZED_CSV_NO_HEADER
A string-based style for the summarized stopwatch formatter, which prints data
as CSV (comma-separated values), without header.
|
static PrintStyle |
SUMMARIZED_TABLE_FULL
A string-based style for the summarized stopwatch formatter, which prints data
in tabular format, with horizontal lines separating each row.
|
static PrintStyle |
SUMMARIZED_TABLE_NO_HEADER
A string-based style for the summarized stopwatch formatter, which prints data
in tabular format without header.
|
static PrintStyle |
SUMMARIZED_XML
A string-based style for the summarized stopwatch formatter, which prints data
in XML format.
|
static PrintStyle |
SUMMARIZED_XML_ISO_8601
A string-based style for the summarized stopwatch formatter, which prints data
as XML with elapsed times expressed using the ISO-8601 duration format.
|
static PrintStyle |
SUMMARIZED_YAML
A string-based style for the summarized stopwatch formatter, which prints data
in YAML format.
|
static PrintStyle |
SUMMARIZED_YAML_ISO_8601
A string-based style for the summarized stopwatch formatter, which prints data
as YAML with elapsed times expressed using the ISO-8601 duration format.
|
| Modifier and Type | Method and Description |
|---|---|
static PrintStyleBuilder |
builder(PrintFormat printFormat)
Returns an empty PrintStyle builder.
|
static PrintStyleBuilder |
builder(PrintStyle source)
Returns a PrintStyle builder with the same attributes of an existing PrintStyle.
|
String |
toString(Stopwatch stopwatch)
Generates a string containing the formatted stopwatch output in this style.
|
public static final PrintStyle SUMMARIZED_TABLE_NO_HEADER
Elapsed times are expressed in the format H:M:S.ns.
Sample output:
Wall clock time 0:00:04.455383500 CPU time 0:00:00.109375000 User time 0:00:00.046875000 System time 0:00:00.062500000
PrintFormat.SUMMARIZED,
DurationFormat.FULLpublic static final PrintStyle SUMMARIZED_TABLE_FULL
Elapsed times are expressed in the format H:M:S.ns.
Sample output:
==================================== Counter Elapsed time ------------------------------------ Wall clock time 0:00:04.455383500 CPU time 0:00:00.109375000 User time 0:00:00.046875000 System time 0:00:00.062500000 ====================================
PrintFormat.SUMMARIZED,
DurationFormat.FULLpublic static final PrintStyle SUMMARIZED_CSV
Elapsed times are expressed in the format H:M:S.ns.
Sample output:
"Counter","Elapsed time" "Wall clock time","0:00:04.455383500" "CPU time","0:00:00.109375000" "User time","0:00:00.046875000" "System time","0:00:00.062500000"
PrintFormat.SUMMARIZED,
DurationFormat.FULLpublic static final PrintStyle SUMMARIZED_CSV_NO_HEADER
Elapsed times are expressed in the format H:M:S.ns.
Sample output:
"Wall clock time","0:00:04.455383500" "CPU time","0:00:00.109375000" "User time","0:00:00.046875000" "System time","0:00:00.062500000"
PrintFormat.SUMMARIZED,
DurationFormat.FULLpublic static final PrintStyle SUMMARIZED_CSV_ISO_8601
Sample output:
"Counter","Elapsed time" "Wall clock time","PT4.4553835S" "CPU time","PT0.109375S" "User time","PT0.046875S" "System time","PT0.0625S"
DurationFormat.ISO_8601,
PrintFormat.SUMMARIZEDpublic static final PrintStyle SUMMARIZED_CSV_ISO_8601_NO_HEADER
Sample output:
"Wall clock time","PT4.4553835S" "CPU time","PT0.109375S" "User time","PT0.046875S" "System time","PT0.0625S"
DurationFormat.ISO_8601,
PrintFormat.SUMMARIZEDpublic static final PrintStyle SUMMARIZED_XML
Elapsed times are expressed in the format H:M:S.ns.
Sample output:
<counters><counter type="Wall clock time">0:00:01.352886500</counter><counter type="CPU time">0:00:00.062500000</counter><counter type="User time">0:00:00.031250000</counter><counter type="System time">0:00:00.031250000</counter></counters>
PrintFormat.SUMMARIZED,
DurationFormat.FULLpublic static final PrintStyle SUMMARIZED_XML_ISO_8601
Sample output:
<counters><counter type="Wall clock time">PT1.3528865S</counter><counter type="CPU time">PT0.0625S</counter><counter type="User time">PT0.03125S</counter><counter type="System time">PT0.03125S</counter></counters>
DurationFormat.ISO_8601,
PrintFormat.SUMMARIZEDpublic static final PrintStyle SUMMARIZED_YAML
Elapsed times are expressed in the format H:M:S.ns.
Sample output:
counters:- type: Wall clock timevalue: '0:00:01.352886500'- type: CPU timevalue: '0:00:00.062500000'- type: User timevalue: '0:00:00.031250000'- type: System timevalue: '0:00:00.031250000'
PrintFormat.SUMMARIZED,
DurationFormat.FULLpublic static final PrintStyle SUMMARIZED_YAML_ISO_8601
Sample output:
counters:- type: Wall clock timevalue: PT1.3528865S- type: CPU timevalue: PT0.0625S- type: User timevalue: PT0.03125S- type: System timevalue: PT0.03125S
DurationFormat.ISO_8601,
PrintFormat.SUMMARIZEDpublic static final PrintStyle DETAILED_TABLE_FULL
Elapsed times are expressed in the format H:M:S.ns.
Sample output:
===============================================
# Elapsed time Elapsed time (+)
===============================================
Wall clock time
-----------------------------------------------
0 0:00:01.055824100 0:00:01.055824100
1 0:00:00.836569500 0:00:01.892393600
2 0:00:00.836091100 0:00:02.728484700
3 0:00:00.837092700 0:00:03.565577400
-----------------------------------------------
TOTAL 0:00:03.565577400
===============================================
CPU time
-----------------------------------------------
0 0:00:00.109375000 0:00:00.109375000
1 0:00:00.000000000 0:00:00.109375000
2 0:00:00.000000000 0:00:00.109375000
3 0:00:00.015625000 0:00:00.125000000
-----------------------------------------------
TOTAL 0:00:00.125000000
===============================================
PrintFormat.DETAILED,
DurationFormat.FULLpublic static final PrintStyle DETAILED_CSV
Elapsed times are expressed in the format H:M:S.ns.
Sample output:
"Counter","Session","Elapsed time","Elapsed time (+)" "Wall clock time",0,"0:00:00.032319200","0:00:00.032319200" "Wall clock time",1,"0:00:00.016766500","0:00:00.049085700" "Wall clock time",2,"0:00:00.014459500","0:00:00.063545200" "CPU time",0,"0:00:00.031250000","0:00:00.031250000" "CPU time",1,"0:00:00.015625000","0:00:00.046875000" "CPU time",2,"0:00:00.015625000","0:00:00.062500000"
PrintFormat.DETAILED,
DurationFormat.FULLpublic static final PrintStyle DETAILED_CSV_NO_HEADER
Elapsed times are expressed in the format H:M:S.ns.
Sample output:
"Wall clock time",0,"0:00:00.032319200","0:00:00.032319200" "Wall clock time",1,"0:00:00.016766500","0:00:00.049085700" "Wall clock time",2,"0:00:00.014459500","0:00:00.063545200" "CPU time",0,"0:00:00.031250000","0:00:00.031250000" "CPU time",1,"0:00:00.015625000","0:00:00.046875000" "CPU time",2,"0:00:00.015625000","0:00:00.062500000"
PrintFormat.DETAILED,
DurationFormat.FULLpublic static final PrintStyle DETAILED_CSV_ISO_8601
Sample output:
"Counter","Session","Elapsed time","Elapsed time (+)" "Wall clock time",0,"PT0.0323192S","PT0.0323192S" "Wall clock time",1,"PT0.0167665S","PT0.0490857S" "CPU time",0,"PT0.03125S","PT0.03125S" "CPU time",1,"PT0.015625S","PT0.046875S"
DurationFormat.ISO_8601,
PrintFormat.DETAILEDpublic static final PrintStyle DETAILED_CSV_ISO_8601_NO_HEADER
Sample output:
"Wall clock time",0,"PT0.0323192S","PT0.0323192S" "Wall clock time",1,"PT0.0167665S","PT0.0490857S" "CPU time",0,"PT0.03125S","PT0.03125S" "CPU time",1,"PT0.015625S","PT0.046875S"
DurationFormat.ISO_8601,
PrintFormat.DETAILEDpublic static final PrintStyle DETAILED_XML
Elapsed times are expressed in the format H:M:S.ns.
Sample output:
<counters><counter type="Wall clock time"><session index="0">0:00:01.371288100</session><session index="1">0:00:01.103620000</session><total>0:00:02.474908100</total></counter><counter type="CPU time"><session index="0">0:00:00.031250000</session><session index="1">0:00:00.015625000</session><total>0:00:00.046875000</total></counter></counters>
PrintFormat.DETAILED,
DurationFormat.FULLpublic static final PrintStyle DETAILED_XML_ISO_8601
Sample output:
<counters><counter type="Wall clock time"><session index="0">PT1.357239099S</session><session index="1">PT1.1036874</session><total>PT2.460926499S</total></counter><counter type="CPU time"><session index="0">PT0.1875S</session><session index="1">PT0.015625S</session><total>PT0.203125S</total></counter></counters>
DurationFormat.ISO_8601,
PrintFormat.DETAILEDpublic static final PrintStyle DETAILED_YAML
Elapsed times are expressed in the format H:M:S.ns.
Sample output:
counters:- type: Wall clock timesessions:- '0:00:01.371288100'- '0:00:01.103620000'total: '0:00:02.474908100'- type="CPU time">sessions:- '0:00:00.031250000'- '0:00:00.015625000'total: 0:00:00.046875000
PrintFormat.DETAILED,
DurationFormat.FULLpublic static final PrintStyle DETAILED_YAML_ISO_8601
Sample output:
counters:- type: Wall clock timesessions:- '0:00:01.371288100'- '0:00:01.103620000'total: '0:00:02.474908100'- type="CPU time">sessions:- '0:00:00.031250000'- '0:00:00.015625000'total: 0:00:00.046875000
PrintFormat.DETAILED,
DurationFormat.ISO_8601public static final PrintStyle LINUX
Sample output:
real 0m4.995s user 0m0.031s sys 0m0.358s
PrintFormat.SUMMARIZED,
DurationFormat.LINUXpublic static PrintStyleBuilder builder(PrintFormat printFormat)
printFormat - the target PrintFormat, not nullPrintStyleBuilder instanceNullPointerException - if the specified PrintFormat is nullpublic static PrintStyleBuilder builder(PrintStyle source)
source - the PrintStyle whose attributes are to be copiedPrintStyleBuilder instance with the same attributes of the
specified source objectNullPointerException - if the specified PrintStyle is nullpublic String toString(Stopwatch stopwatch)
stopwatch - the stopwatch to be printed; not nullNullPointerException - if the specified stopwatch is nullCopyright © 2023. All rights reserved.