Skip to content
Lee Campbell edited this page May 5, 2017 · 5 revisions

V2 HdrHistogram Log format

The log format encodes into a single file, multiple histograms with optional shared meta data.

File format

([MetaData]\n)*
[ColumnHeaders]\n
([Histogram]\n)*

MetaData format

#[StartTime|BaseTime|Comment]

Meta data rows include comments, the StartTime and the BaseTime for the set of Histograms being logged

StartTime value format

[StartTime:\d*.\d{1,3}															

Start time is represented as seconds since epoch with up to 3 decimal places. Line starts with the leading text '#[StartTime:'

BaseTime value format

[BaseTime:\d*.\d

Base time is represented as seconds since epoch with up to 3 decimal places. Line starts with the leading text '#[BaseTime:'

Comment value format

.*

A comment is any line that leads with '#' that is not matched by the BaseTime or StartTime formats. Comments are ignored when parsed.

ColumnHeaders format

StartTimestamp.*

Human readable column headers. Ignored when parsed.

Histogram format

([Tag],)[LogTimeStamp],[IntervalLengthSeconds],[MaxTime],[CompressedPayload]

Tag value format

Tag=\s+

The Tag is an optional string value used to help provide custom metadata for the Histogram. The value is a string. The Tag value may not include commas, spaces or line breaks. If no Tag value is provided, then the prefix of Tag= and trailing , can be omitted.

LogTimeStamp value format

\d*.\d*

The LogTimeStamp is the start time of the Histogram in seconds since the BaseTime measured as a double. If the BaseTime is not provided, then this is an absolute time in seconds.

IntervalLengthSeconds value format

\d*.\d*

The interval length is the total time in seconds that the Histogram has measured.

MaxTime value format

\d*.\d*

The MaxTime is the finish time in seconds since the BaseTime measured as a double. This is ignored as it can be inferred from the LogTimeStamp and the IntervalLengthSeconds

CompressedPayload format

BASE64(
	DEFLATE(
		[Histogram]
	)
)

The compressed payload is a Base64Encoded, ZLIB compressed encoding (RFC-1950) of an HdrHistogram.

The Encoded-Histogram-format is a standard format.