Top Description Inners Fields Constructors Methods
org.HdrHistogram

public Class HistogramLogProcessor

extends Thread
Class Inheritance
Imports
java.io.FileNotFoundException, .FileOutputStream, .PrintStream, java.util.*

org.HdrHistogram.HistogramLogProcessor will process an input log and [can] generate two separate log files from a single histogram log file: a sequential interval log file and a histogram percentile distribution log file.

The sequential interval log file logs a single stats summary line for each reporting interval.

The histogram percentile distribution log file includes a detailed percentiles and fine grained distribution of the entire log file range processed.

HistogramLogProcessor will process an input log file when provided with the -i <filename> option. When no -i option is provided, standard input will be processed.

When provided with an output file name <logfile> with the -o option (e.g. "-o mylog"), HistogramLogProcessor will produce both output files under the names <logfile> and <logfile>.hgrm (e.g. mylog and mylog.hgrm).

When not provided with an output file name, HistogramLogProcessor will produce [only] the histogram percentile distribution log output to standard output.

By default, HistogramLogProcessor only processes hlog file lines lines with no tag specified [aka "default tagged" lines]. An optional -tag parameter can be used to process lines of a [single] specific tag. The -listtags option can be used to list all the tags found in the input file.

HistogramLogProcessor accepts optional -start and -end time range parameters. When provided, the output will only reflect the portion of the input log with timestamps that fall within the provided start and end time range parameters.

HistogramLogProcessor also accepts and optional -csv parameter, which will cause the output formatting (of both output file forms) to use a CSV file format.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final HistogramLogProcessor.HistogramLogProcessorConfiguration
private int
private HistogramLogReader
pack-priv static final String
Inherited from java.lang.Thread:
MAX_PRIORITYMIN_PRIORITYNORM_PRIORITY

Constructor Summary

AccessConstructor and Description
public
HistogramLogProcessor(final String[]
command line arguments
args
)

Construct a org.HdrHistogram.HistogramLogProcessor with the given arguments (provided in command line style).

Method Summary

Modifier and TypeMethod and Description
pack-priv EncodableHistogram
private EncodableHistogram
private EncodableHistogram
public static void
main(final String[]
command line arguments
args
)

main() method.

private void
outputStartTime(final PrintStream log, final Double startTime)

private void
outputTimeRange(final PrintStream log, final String title)

public void
run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

Run the log processor with the currently provided arguments.
Inherited from java.lang.Thread:
activeCountcheckAccessclonecountStackFramescurrentThreaddumpStackenumerategetAllStackTracesgetContextClassLoadergetDefaultUncaughtExceptionHandlergetIdgetNamegetPrioritygetStackTracegetStategetThreadGroupgetUncaughtExceptionHandlerholdsLockinterruptinterruptedisAliveisDaemonisInterruptedisVirtualjoinjoinjoinjoinofPlatformofVirtualonSpinWaitresumesetContextClassLoadersetDaemonsetDefaultUncaughtExceptionHandlersetNamesetPrioritysetUncaughtExceptionHandlersleepsleepsleepstartstartVirtualThreadstopsuspendthreadIdtoStringyield

Field Detail

configback to summary
private final HistogramLogProcessor.HistogramLogProcessorConfiguration config
lineNumberback to summary
private int lineNumber
logReaderback to summary
private HistogramLogReader logReader
versionStringback to summary
pack-priv static final String versionString

Constructor Detail

HistogramLogProcessorback to summary
public HistogramLogProcessor(final String[] args) throws FileNotFoundException

Construct a org.HdrHistogram.HistogramLogProcessor with the given arguments (provided in command line style).

[-h]                                                        help
[-csv]                                                      Use CSV format for output log files
[-i logFileName]                                            File name of Histogram Log to process (default is standard input)
[-o outputFileName]                                         File name to output to (default is standard output)
                                                            (will replace occurrences of %pid and %date with appropriate information)
[-tag tag]                                                  The tag (default no tag) of the histogram lines to be processed\n
[-start rangeStartTimeSec]                                  The start time for the range in the file, in seconds (default 0.0)
[-end rangeEndTimeSec]                                      The end time for the range in the file, in seconds (default is infinite)
[-correctLogWithKnownCoordinatedOmission expectedInterval]  When the supplied expected interval i is than 0, performs coordinated
                                                            omission corection on the input log's interval histograms by adding
                                                            missing values as appropriate based on the supplied expected interval
                                                            value i (in wahtever units the log histograms were recorded with). This
                                                            feature should only be used when the input log is known to have been
                                                            recorded with coordinated ommisions, and when an expected interval is known.
[-outputValueUnitRatio r]                                   The scaling factor by which to divide histogram recorded values units
                                                            in output. [default = 1000000.0 (1 msec in nsec)]"
Parameters
args:String[]

command line arguments

Exceptions
FileNotFoundException:
if specified input file is not found

Method Detail

copyCorrectedForCoordinatedOmissionback to summary
pack-priv EncodableHistogram copyCorrectedForCoordinatedOmission(final EncodableHistogram inputHistogram)
getIntervalHistogramback to summary
private EncodableHistogram getIntervalHistogram()
getIntervalHistogramback to summary
private EncodableHistogram getIntervalHistogram(String tag)
mainback to summary
public static void main(final String[] args)

main() method.

Parameters
args:String[]

command line arguments

outputStartTimeback to summary
private void outputStartTime(final PrintStream log, final Double startTime)
outputTimeRangeback to summary
private void outputTimeRange(final PrintStream log, final String title)
runback to summary
public void run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

Run the log processor with the currently provided arguments.

Annotations
@Override
org.HdrHistogram back to summary

private Class HistogramLogProcessor.HistogramLogProcessorConfiguration

extends Object
Class Inheritance
  • java.lang.Object
  • org.HdrHistogram.HistogramLogProcessor.HistogramLogProcessorConfiguration

Field Summary

Modifier and TypeField and Description
pack-priv boolean
pack-priv String
pack-priv double
pack-priv String
pack-priv boolean
pack-priv boolean
pack-priv boolean
pack-priv long
pack-priv double
pack-priv String
pack-priv Double
pack-priv int
pack-priv double
pack-priv double
pack-priv String
pack-priv boolean

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

allTagsback to summary
pack-priv boolean allTags
errorMessageback to summary
pack-priv String errorMessage
expectedIntervalForCoordinatedOmissionCorrectionback to summary
pack-priv double expectedIntervalForCoordinatedOmissionCorrection
inputFileNameback to summary
pack-priv String inputFileName
listTagsback to summary
pack-priv boolean listTags
logFormatCsvback to summary
pack-priv boolean logFormatCsv
movingWindowback to summary
pack-priv boolean movingWindow
movingWindowLengthInMsecback to summary
pack-priv long movingWindowLengthInMsec
movingWindowPercentileToReportback to summary
pack-priv double movingWindowPercentileToReport
outputFileNameback to summary
pack-priv String outputFileName
outputValueUnitRatioback to summary
pack-priv Double outputValueUnitRatio
percentilesOutputTicksPerHalfback to summary
pack-priv int percentilesOutputTicksPerHalf
rangeEndTimeSecback to summary
pack-priv double rangeEndTimeSec
rangeStartTimeSecback to summary
pack-priv double rangeStartTimeSec
tagback to summary
pack-priv String tag
verboseback to summary
pack-priv boolean verbose

Constructor Detail

HistogramLogProcessorConfigurationback to summary
pack-priv HistogramLogProcessorConfiguration(final String[] args)