Utilities for latency measurement and reporting

Overview

LatencyUtils

A latency stats tracking package

The LatencyUtils package includes useful utilities for tracking latencies. Especially in common in-process recording scenarios, which can exhibit significant coordinated omission sensitivity without proper handling. LatencyStats instances are used to track recorded latencies in the common use case the often follow this pattern:

 LatencyStats myOpStats = new LatencyStats();
 ...

 // During normal operation, record all operation latencies into a LatencyStats instance:

 long startTime = System.nanoTime();
 // Perform operation:
 doMyOperation(...);
 // Record operation latency:
 myOpStats.recordLatency(System.nanoTime() - startTime);
 ...

 // Later, report on stats collected:
 Histogram intervalHistogram = myOpStats.getIntervalHistogram();

 intervalHistogram.getHistogramData().outputPercentileDistribution(System.out, 1000000.0);

The problem

Latency tracking of in-process operations usually consists simple time sampling around a tracked operation. E.g. a database read operation for which latency statistics are being developed may be surrounded by time measurement operation immediately before and after the operation is performed, with the difference in time recorded in some aggregate statistics gathering form (average, std. deviation, histogram,. etc.) which is later used to report on the experienced latency behavior of the tracked operation.

The problem with this extremely common form of latency behavior tracking is that whenever pauses occur in the system, latency statistics become significantly skewed toward falsely-optimistic values. This occurs in two key ways:

  • When a pause occurs during a tracked operation, a single long recorded latency will appear in the recorded values, with no long latencies associated with any pending requests that may be stalled by the pause.
  • When a pause occurs outside of the tracked operation (and outside of the tracked time window) no long latency value would be recorded, even though any requested operation would be stalled by the pause.

The Solution

The LatencyStats class is designed for simple, drop-in use as a latency behavior recording object in common in-process latency recording and tracking situations. LatencyStats includes under-the-hood tracking and correction of pause effects, compensating for coordinated omission. It does so by using pluggable pause detectors and interval estimators that together with LatencyStats will transparently produce corrected histogram values for the recorded latency behavior.

Comments
  • Give the PauseDetector thread a descriptive name

    Give the PauseDetector thread a descriptive name

    PauseDetector starts a thread without a name. This leads to the thread being assigned a generic name like "Thread-13" that is not easily identifiable.

    It would be nice if the thread started by PauseDetector was given a descriptive name that included pause-detector or latency-pause-detector or something, so that it is easily identifiable in thread lists, stack dumps, etc.

    opened by philsttr 1
  • Fix typos

    Fix typos

    Fix a few typos and remove some leftover imports that I noticed while learning the codebase.

    Also, nix a p tag that javadoc didn't like. I checked the output afterwards and it still looks ok to my eyes.

    opened by marshallpierce 0
  • Bump junit from 4.10 to 4.13.1

    Bump junit from 4.10 to 4.13.1

    Bumps junit from 4.10 to 4.13.1.

    Release notes

    Sourced from junit's releases.

    JUnit 4.13.1

    Please refer to the release notes for details.

    JUnit 4.13

    Please refer to the release notes for details.

    JUnit 4.13 RC 2

    Please refer to the release notes for details.

    JUnit 4.13 RC 1

    Please refer to the release notes for details.

    JUnit 4.13 Beta 3

    Please refer to the release notes for details.

    JUnit 4.13 Beta 2

    Please refer to the release notes for details.

    JUnit 4.13 Beta 1

    Please refer to the release notes for details.

    JUnit 4.12

    Please refer to the release notes for details.

    JUnit 4.12 Beta 3

    Please refer to the release notes for details.

    JUnit 4.12 Beta 2

    No release notes provided.

    JUnit 4.12 Beta 1

    No release notes provided.

    JUnit 4.11

    No release notes provided.

    Commits
    • 1b683f4 [maven-release-plugin] prepare release r4.13.1
    • ce6ce3a Draft 4.13.1 release notes
    • c29dd82 Change version to 4.13.1-SNAPSHOT
    • 1d17486 Add a link to assertThrows in exception testing
    • 543905d Use separate line for annotation in Javadoc
    • 510e906 Add sub headlines to class Javadoc
    • 610155b Merge pull request from GHSA-269g-pwp5-87pp
    • b6cfd1e Explicitly wrap float parameter for consistency (#1671)
    • a5d205c Fix GitHub link in FAQ (#1672)
    • 3a5c6b4 Deprecated since jdk9 replacing constructor instance of Double and Float (#1660)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Migrate LGTM.com installation from OAuth to GitHub App

    Migrate LGTM.com installation from OAuth to GitHub App

    Hi There,

    This project is still using an old implementation of LGTM's automated code review, which has now been disabled. To continue using automated code review, and receive checks on your Pull Requests, please install the GitHub App on this repository.

    Thanks, The LGTM Team

    opened by LGTM-badger 0
  • `LatencyStats` equivalent to `Recorder#getIntervalHistogram(Histogram)`?

    `LatencyStats` equivalent to `Recorder#getIntervalHistogram(Histogram)`?

    LatencyStats has getIntervalHistogram() and getIntervalHistogramInto(Histogram) and ``(Histogram)but doesn't have anything like HdrHistogram'sRecorder#getIntervalHistogram(Histogram)` that avoids holding the reader lock while copying into either a new or target histogram. To be fair, I haven't found a scalability problem in the current approach with actual usage, so I'm operating on the assumption that this is important because Recorder does it.

    As far as I can tell, it's a little more complicated in LatencyStats because there are two histograms, but it seems like it would be workable to have a getBothIntervalHistograms(Histogram, Histogram) that takes a histogram for the raw data and another for the pause corrections, and a getIntervalHistograms() that returned a pair. Does this seem sensible?

    The existing addIntervalHistogramTo is actually very convenient for my usage (https://bitbucket.org/marshallpierce/hdrhistogram-metrics-reservoir/commits/d6b5c43b612a447768b058f81e35898b953d3116?at=master#chg-src/main/java/org/mpierce/metrics/reservoir/hdrhistogram/LatencyStatsReservoir.java) but it would be almost as easy to manage the interval histograms myself and remove some work from the locked section.

    opened by marshallpierce 0
  • LatencyStats#stop() shuts down static executor?

    LatencyStats#stop() shuts down static executor?

    Just reading through the code to figure out how it works, and I noticed https://github.com/LatencyUtils/LatencyUtils/blob/master/src/main/java/org/LatencyUtils/LatencyStats.java#L307. Is this intentional that shutting down one LatencyStats will halt that shared executor? It's hard to tell the intent because TimeServices.ScheduledExecutor#scheduleAtFixedRate is not actually used (presumably it's there as a convenience for other user code).

    opened by marshallpierce 0
Log analyser / visualiser for Java HotSpot JIT compiler. Inspect inlining decisions, hot methods, bytecode, and assembly. View results in the JavaFX user interface.

JITWatch Log analyser and visualiser for the HotSpot JIT compiler. Video introduction to JITWatch video Slides from my LJC lightning talk on JITWatch

AdoptOpenJDK 2.8k Jan 3, 2023
:chart_with_upwards_trend: Capturing JVM- and application-level metrics. So you know what's going on.

Metrics ?? Capturing JVM- and application-level metrics. So you know what's going on. For more information, please see the documentation Versions Vers

Dropwizard 7.7k Dec 30, 2022
Table-Computing (Simplified as TC) is a distributed light weighted, high performance and low latency stream processing and data analysis framework. Milliseconds latency and 10+ times faster than Flink for complicated use cases.

Table-Computing Welcome to the Table-Computing GitHub. Table-Computing (Simplified as TC) is a distributed light weighted, high performance and low la

Alibaba 34 Oct 14, 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
Netflix, Inc. 23.1k Jan 5, 2023
SpringBoot service to pick up CAN messages retransmitted by CANBridge and extract certain values for reporting/monitoring/alerting via DataDog

SpringBoot service to pick up CAN messages retransmitted by CANBridge and extract certain values for reporting/monitoring/alerting via DataDog

Grumpy Cricket 2 Mar 12, 2022
Java reporting library for creating dynamic report designs at runtime

Master Development Dynamic Reports DynamicReports is an open source Java reporting library based on JasperReports. It allows to create dynamic report

Dynamic Reports 165 Dec 28, 2022
High-level contextual steps in your tests for any reporting tool

Xteps High-level contextual steps in your tests for any reporting tool. License Maven Central Javadoc Xteps Xteps Allure Xteps ReportPortal How to use

Evgenii Plugatar 8 Dec 11, 2022
This mod gives the option to server admins to disable chat reporting, in a non-intrusive way

Simply No Report This mod gives the option to server admins to disable chat reporting, in a non-intrusive way. It is disabled by default to let everyo

Amber Bertucci 17 Aug 20, 2022
Sentry is cross-platform application monitoring, with a focus on error reporting.

Users and logs provide clues. Sentry provides answers. What's Sentry? Sentry is a developer-first error tracking and performance monitoring platform t

Sentry 33k Jan 9, 2023
A 1.7.10 Forge Mod to allow players to access easy stats like latency, FPS, and CPS

EZStats A 1.7.10 Forge Mod to allow players to access easy stats like latency, FPS, and CPS. Currently a work in progress, all code is accessable in t

applesfruit 4 Aug 8, 2022
Low-latency Financial Information Exchange (FIX) engine for the JVM

Philadelphia Philadelphia is a low-latency Financial Information Exchange (FIX) engine for the JVM. You can use Philadelphia to connect to stock excha

Parity 278 Dec 31, 2022
Lightning Memory Database (LMDB) for Java: a low latency, transactional, sorted, embedded, key-value store

LMDB for Java LMDB offers: Transactions (full ACID semantics) Ordered keys (enabling very fast cursor-based iteration) Memory-mapped files (enabling o

null 680 Dec 23, 2022
A gulp of low latency Java

SmoothieMap SmoothieMap is a Map implementation for Java with the lowest memory usage and absence of rehash latency spikes. Under the hood, it is a ve

null 278 Oct 31, 2022
simple disk I/0 latency measuring tool

ioping A tool to monitor I/O latency in real time. It shows disk latency in the same way as ping shows network latency. Homepage: https://github.com/k

Konstantin Khlebnikov 879 Dec 21, 2022
Netflix, Inc. 809 Dec 28, 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
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