Skip to content

Main content

Gauge Sample Age Fraction Tool

Calculate gauge sample age fraction from explicit caller-supplied inputs.

Loading tool…

Description

Subtract sampleTime from evaluationTime for age and divide by positive freshnessWindow for fraction.

A timestamp difference produces an age or lag only after both timestamps use one origin and unit. Negative differences can be meaningful diagnostics of future samples or early events.

Subtract sampleTime from evaluationTime for age and divide by positive freshnessWindow for fraction.

When to use this tool

Use Gauge Sample Age Fraction when you need a supplied sample-age or event-lag calculation.

How to use the tool and how it works

  1. Enter sampleTime, evaluationTime, freshnessWindow. 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 age, fraction, futureSample. Inspect futureSample before interpreting the associated values.

Subtract sampleTime from evaluationTime for age and divide by positive freshnessWindow for fraction. Mark futureSample when age is negative.1

Input fieldMeaning and unitsAccepted input
sampleTimeSample TimeRequired. Finite number.
evaluationTimeEvaluation TimeRequired. Finite number.
freshnessWindowFreshness WindowRequired. Finite number; strictly above 0.
Output fieldInterpretationReturned shape
ageAgeRequired. Finite number.
fractionDimensionless fraction under the stated convention.Required. Finite number.
futureSampleFuture SampleRequired. Boolean.
json
{
  "input": {
    "sampleTime": 90,
    "evaluationTime": 100,
    "freshnessWindow": 20
  },
  "output": {
    "age": 10,
    "fraction": 0.5,
    "futureSample": false
  }
}

Limitations and assumptions

  • This returns a signed age ratio without clamping or deciding a freshness policy; all time values require compatible units.
  • 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

Resolve clock synchronization, timezone conversion, and source timestamp accuracy before interpreting real-world timing.

References

  1. Calculation and input contract: metrics/gauge-sample-age-fraction — tool.io

Similar or alternative tools