Utilities for HDR Histogram logs manipulation

Overview

HdrLogProcessing

Utilities for HDR Histogram logs manipulation. This repo currently includes utilities for summarizing and unioning of logs.

  • Requires Maven to build and JDK8 to build/run.
  • Released under BSD licence.

For brevity in the following examples, lets assume you built the project and added the following alias:

alias hodor=java -jar processor.jar

Summary tool

Using the above alias run:

$ hodor summarize [...]

SummarizeHistogramLogsRange supports the following options:

-start (-s) N                          : relative log start time in seconds, (default: 0.0)
-end (-e) N                            : relative log end time in seconds, (default: MAX_DOUBLE)
-ignoreTag (-it)                       : summary should not be split by tag, (default: false)
-inputFile (-if) VAL                   : add an input hdr log from input path, also takes regexp
-inputFilePath (-ifp) VAL              : add an input file by path relative to working dir or absolute
-inputPath (-ip) VAL                   : set path to use for input files, defaults to current folder
-outputBucketSize (-obs) N             : csv output bucket size, (default: 100)
-outputFile (-of) VAL                  : set an output file destination, default goes to sysout
-outputValueUnitRatio (-ovr) N         : output value unit ratio, (default: 1.0)
-percentilesOutputTicksPerHalf (-tph) N: ticks per half percentile, used for hgrm output, (default: 5)
-summaryType (-st) [CSV | PERCENTILES | HGRM]:  : summary type: csv, percentiles, hgrm                                   
-verbose (-v) : verbose logging, (default: false)

This is useful when for example you are face with a histogram log you have collected from your application over time and you wish to summarize the percentiles from the full run:

 $ hodor summarize -if my-awesome-app-latencies.hdr
 TotalCount=27663673
 Period(ms)=205823
 Throughput(ops/sec)=134405.16
 Min=263
 Mean=6561.99
 50.000ptile=5491
 90.000ptile=8887
 99.000ptile=49023
 99.900ptile=72767
 99.990ptile=92927
 99.999ptile=116415
 Max=145151

Now perhaps the first 200 seconds of this run are an unstable warmup period I wish to exclude from my summary:

$ hodor summarize -if my-awesome-app-latencies.hdr -s 200

Or maybe I got several logs, from several runs and I want an overall summary, excluding the first 60 seconds of the run and saving the output into a file:

$ hodor summarize -if run1.hdr -if run2.hdr -if run3.hdr -s 60 -of runs-summary.out

-OR you could use a regexp to get all the files-

$ hodor summarize -if ^run.*.hdr -s 60 -of runs-summary.out

The default output is percentiles as shown above. We support HGRM output if you wish to plot the result with the useful plotter in HdrHistogram, and a CSV format to enable statistical analysis with other tools. The HGRM output with an output file will result in a file per tagged summary with the convention of: outputfile.tag.hgrm

The summary tool supports tags, and if your logs contains histograms of different tags they will get summarized separately. You can use the '-it|ignoreTag' option to summarize all tags together.

Union tool

Using the above alias run:

$ hodor union [...]

UnionHistogramLogs supports the following options:

-end (-e) N                 : relative log end time in seconds, (default: MAX_DOUBLE)
-inputFile (-if) VAL        : add an input hdr log from input path, also takes regexp
-inputPath (-ip) VAL        : set path to use for input files, defaults to current folder
-outputFile (-of) VAL       : set an output file destination, default goes to sysout
-relative (-r)              : relative timeline merge, (default: true)
-start (-s) N               : relative log start time in seconds, (default: 0.0)
-taggedInputFile (-tif) VAL : a <tag>=<filename> add an input file, tag all
                              histograms from this file with tag. If histograms
                              have a tag it will be conactanated to file tag
                              <file-tag>::<histogram-tag>.
-verbose (-v)               : verbose logging, (default: false)

Sometimes you got lots of files, and you really wish you could just throw them all into one file. For example, lets say you used 3 separate load-generating clients to measure your server latencies. You can union all the logs into a single log as follows:

$ hodor union -if ^load-gen.*.hdr -of union-load-gens.hdr

The above union will use absolute time so the result will be as if all load generators were logged from a single source (assuming the clocks are reasonablely in sync). You may want to collect multiple runs timelines into a single union. This is possible using the '-r' option.

If each load generator represents a different operation you could use tags to differentiate them in the union:

$ hodor union -tif READ=load-gen1.hdr -tif READ=load-gen2.hdr -tif WRITE=load-gen3.hdr -of union-load-gens.hdr

Split tool

Using the above alias run:

$ hodor union [...]

SplitHistogramLogs supports the following options:

-end (-e) N           : relative log end time in  seconds,    (default: MAX_DOUBLE)
-excludeTag (-et) VAL : add a tag to exclude from input, 'default' is a special tag for the null tag.
-includeTag (-it) VAL : when include tags are used only the explicitly included will be split out, 'default' is a special tag for the null tag.
-inputFile (-if) VAL  : set the input hdr log from input     path
-inputPath (-ip) VAL  : set path to use for input files, defaults to current folder
-start (-s) N         : relative log start time in  seconds,    (default: 0.0)
-verbose (-v)         : verbose logging, (default:  false)

Some tools do not support tags yet, so you may want to split a log into several logs for post processing.

$ hodor split -if taggyLog.hdr

Will result in the creation of a log file per tag, with the default tag going to the 'default' file. So tags A,B,C will end up in the files A.taggyLog.hdr, B.taggyLog.hdr, C.taggyLog.hdr respectively. If you need only certain tags A,B:

$ hodor split -if taggyLog.hdr -it A -it B

HDR to CSV tool

Using the above alias, run:

$ hodor to-csv -i INPUT_FILE

It will result in a strict transformation of a log file to CSV. Intervals will be preserved. For each interval, important percentiles will be written in dedicated columns. The resulting CSV is printed on stdout.

Example usage:

$ hodor to-csv -i input.hgrm | tee output.csv
#Timestamp,Throughput,Min,Avg,p50,p90,p95,p99,p999,p9999,Max
1523292112.000,2364,60608,143515,113599,221823,268543,442367,1638399,6348799,6348799
1523292113.000,192,64672,130923,116287,188031,205823,260351,366591,366591,366591
1523292114.000,384,67520,144460,118527,213759,264703,414463,1793023,1793023,1793023
...
Comments
  • Preserve the numberOfSignificantValueDigits in sum and union histograms

    Preserve the numberOfSignificantValueDigits in sum and union histograms

    In the event that the input histograms have a number of significant figures that isn't 3, then some detail is lost (or meaningless detail is added). This PR uses the significant digits of:

    • The first histogram for each tag seen in UnionHistogramLogs
    • The first histogram for each tag, or if ignoring tags, the first histogram, in SummarizeHistogramLogs

    This PR also upgrades the version of HdrHistogram, removing the need to provide a patched HistogramLogReader to get the hasNext() method.

    opened by guyboltonking 2
  • Is the license right?

    Is the license right?

    It says this at the top:

    The code in this repository code was Written by Gil Tene, Michael Barker, and Matt Warren, and released to the public domain

    But then this in the "if you want to use it BSD" section:

    Copyright (c) 2016 Nitsan Wakart

    opened by JeremiahDJordan 1
  • Improve CLI usage

    Improve CLI usage

    This commit brings a new main class to HdrLogProcessing. It acts like a command dispatcher so that the users do not need to remember the class name they want to invoke. The uberjar is also made executable by specifying that dispatcher as the Main-Class in MANIFEST.MF.

    The old java -cp way still works, regardless.

    opened by pingtimeout 0
  • Add instructions in readme and fix CSV output.

    Add instructions in readme and fix CSV output.

    The CSV output used millisecond timestamps as longs instead of the exact same timestamps from HDR, as doubles. This PR contains a ninja fix for that. The example in README shows the output with double timestamps.

    opened by pingtimeout 0
  • Add HDR to CSV converter

    Add HDR to CSV converter

    Sometimes, it can be useful to inspect the HDR histogram intervals, rather than only looking at the summary. This new action allows the user to transform an HDR histogram file in CSV, with the very same intervals.

    No transformation but strict conversion is applied. The output units depend on the input file. Throughput may be ops/s or ops/min depending on what the user provided. Similarly, the exported value may represent ns or ms.

    Typical usage:

    java -cp HdrLogProcessing-1.0-SNAPSHOT-jar-with-dependencies.jar \
        HdrToCsv \
        -i input.hgrm \
        | tee some-output-file.csv
    
    opened by pingtimeout 0
  • Consume Input stream instead of file in split and to-csv

    Consume Input stream instead of file in split and to-csv

    I recommend to tick the Hide whitespace changes box when reviewing this PR.

    This PR is about making sure that OrderedHistogramLogReader consumes an InputStream instead of a File. The change does not impact a lot of the codebase, as HistogramLogScanner already supports reading from an InputStream.

    The main advantage is that if a Java application processes a file that is compressed, the GZIPInputStream can be passed straight away to HdrLogProcessing instead of decompressing in a temporary file.

    To enable this ^ use case, the SplitHistogramLogs and HdrToCsv logics are extracted to a dedicated class. This makes it possible to include HdrLogProcessing as a library, rather than only use it from the command line.

    opened by pingtimeout 0
Releases(v0.2-beta)
Owner
Nitsan Wakart
Nitsan Wakart
One file java script for visualizing JDK flight recorder execution logs as flamegraphs without any dependencies except Java and a browser.

Flamegraph from JFR logs Simple one file Java script to generate flamegraphs from Java flight recordings without installing Perl and the Brendan Gregg

Billy Sjöberg 17 Oct 2, 2022
Best-of-breed OpenTracing utilities, instrumentations and extensions

OpenTracing Toolbox OpenTracing Toolbox is a collection of libraries that build on top of OpenTracing and provide extensions and plugins to existing i

Zalando SE 181 Oct 15, 2022
A High Dynamic Range (HDR) Histogram

HdrHistogram HdrHistogram: A High Dynamic Range (HDR) Histogram This repository currently includes a Java implementation of HdrHistogram. C, C#/.NET,

null 2k Dec 29, 2022
By this package we can get sim info, call logs and sms logs.Also we can find for specific sim info and call logs as well.

sim_sms_call_info A new flutter plugin project. Getting Started This project is a starting point for a Flutter plug-in package, a specialized package

 Hasib Akon 3 Sep 17, 2022
Reactive Streams Utilities - Future standard utilities library for Reactive Streams.

Reactive Streams Utilities This is an exploration of what a utilities library for Reactive Streams in the JDK might look like. Glossary: A short gloss

Lightbend 61 May 27, 2021
CSGO cheat made in Java using JavaFX as the overlay and JNA for memory manipulation

CSGO-CHEAT CSGO cheat made in Java using JavaFX as the overlay and JNA for memory manipulation FEATURES RCS Triggerbot No Flash Third Person Rank Reve

Notorious 9 Dec 28, 2022
Intra is an experimental tool that allows you to test new DNS-over-HTTPS services that encrypt domain name lookups and prevent manipulation by your network

Intra Intra is an experimental tool that allows you to test new DNS-over-HTTPS services that encrypt domain name lookups and prevent manipulation by y

Jigsaw 1.2k Jan 1, 2023
Logstash - transport and process your logs, events, or other data

Logstash Logstash is part of the Elastic Stack along with Beats, Elasticsearch and Kibana. Logstash is a server-side data processing pipeline that ing

elastic 13.2k Jan 5, 2023
Fork of tagtraum industries' GCViewer. Tagtraum stopped development in 2008, I aim to improve support for Sun's / Oracle's java 1.6+ garbage collector logs (including G1 collector)

GCViewer 1.36 GCViewer is a little tool that visualizes verbose GC output generated by Sun / Oracle, IBM, HP and BEA Java Virtual Machines. It is free

null 4.1k Jan 4, 2023
Fork of tagtraum industries' GCViewer. Tagtraum stopped development in 2008, I aim to improve support for Sun's / Oracle's java 1.6+ garbage collector logs (including G1 collector)

GCViewer 1.36 GCViewer is a little tool that visualizes verbose GC output generated by Sun / Oracle, IBM, HP and BEA Java Virtual Machines. It is free

null 4.1k Jan 4, 2023
Log sourcing is method of trying to map all the ERROR and WARN logs you have in your system in a cost effective way.

log-sourcing Log sourcing is method of trying to map all the ERROR and WARN logs you have in your system in a cost effective way. The basic idea is th

Shimon Magal 12 Apr 19, 2021
🔌 Simple library to manipulate HTTP requests/responses and capture network logs made by the browser using selenium tests without using any proxies

Simple library to manipulate HTTP requests and responses, capture the network logs made by the browser using selenium tests without using any proxies

Sudharsan Selvaraj 29 Oct 23, 2022
One file java script for visualizing JDK flight recorder execution logs as flamegraphs without any dependencies except Java and a browser.

Flamegraph from JFR logs Simple one file Java script to generate flamegraphs from Java flight recordings without installing Perl and the Brendan Gregg

Billy Sjöberg 17 Oct 2, 2022
Tool for parsing GC logs

Microsoft GCToolKit GCToolkit is a set of libraries for analyzing HotSpot Java garbage collection (GC) log files. The toolkit parses GC log files into

Microsoft 1.2k Jan 2, 2023
Show git commit logs in NetBeans

gitlogbeans Description Show git commit logs in NetBeans Apache NetBeans and JDK Compatibility JDK >= 9 Apache NetBeans >= 9.0 Plugin is available at

Chrizzly 5 Jul 13, 2022
A simple minecraft mod for 1.12.2 which logs sent and received packets.

Packet-Logger A simple minecraft mod for 1.12.2 which logs sent and received packets. Usage You must have Forge 1.12.2 installed. Download the jar fro

null 14 Dec 2, 2022
Minecraft configurable plugin , which sends messages the first time a player logs into the server or the next time they log in.

JoinMessages Minecraft configurable plugin , which sends messages the first time a player logs into the server or the next time they log in or leave.

ᴠᴀʟᴇɴᴛɪɴ ᴢʜᴇʟᴇᴠ 6 Aug 30, 2022
PCRE RegEx matching Log4Shell CVE-2021-44228 IOC in your logs

Log4Shell-Rex The following RegEx was written in an attempt to match indicators of a Log4Shell (CVE-2021-44228 and CVE-2021-45046) exploitation. If yo

back2root 286 Nov 9, 2022
PortalLogger - Logs portals into a text file and in chat

Logs portals into a text file and in chat. Useful if afk flying under bedrock. Feel free to add to your client The logs are stored in .minecraft/ARTEMIS/PortalLogger

null 7 Dec 2, 2022