Skip to content

Main content

Counter Reset Lower Bound Tool

Infer a minimum increment with a zero-reset assumption when a nonnegative counter decreases; unseen resets cannot be reconstructed.

Loading tool…

Description

If after ≥ before, return their difference; otherwise mark resetDetected and use after as minimumIncrement.

A cumulative counter can increase, wrap, or restart. The difference between two readings is meaningful only under an explicit rollover or reset model and compatible time units.

If after ≥ before, return their difference; otherwise mark resetDetected and use after as minimumIncrement.

When to use this tool

Use Counter Reset Lower Bound when you need a supplied counter difference or rate convention.

How to use the tool and how it works

  1. Enter before, after. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read minimumIncrement, resetDetected. Inspect resetDetected before interpreting the associated values.

If after ≥ before, return their difference; otherwise mark resetDetected and use after as minimumIncrement.1

Input fieldMeaning and unitsAccepted input
beforeBeforeRequired. Finite number; minimum 0.
afterAfterRequired. Finite number; minimum 0.
Output fieldInterpretationReturned shape
minimumIncrementMinimum IncrementRequired. Finite number.
resetDetectedReset DetectedRequired. Boolean.
json
{
  "input": {
    "before": 95,
    "after": 4
  },
  "output": {
    "minimumIncrement": 4,
    "resetDetected": true
  }
}

Limitations and assumptions

  • This assumes a zero-reset interpretation for decreases; wraps and unobserved activity can require different accounting, and undetected resets are possible.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Use reset events, wrap epochs, and monotonic timestamps to resolve ambiguous counter histories.

References

  1. Calculation and input contract: metrics/counter-reset-lower-bound — tool.io

Similar or alternative tools