Skip to content

Metrics: Consider introducing dedicated measure instrument for timings #464

@jmacd

Description

@jmacd

This text was considered for the 0.3 release, but held back. Consider this for 0.4.

### Option: Dedicated Measure instrument for timing measurements

As a language-optional feature, the API MAY support a dedicated
instrument for reporting timing measurements.  This kind of
instrument, with recommended name `Timer` (and `BoundTimer`), is
semantically equivalent to a Measure instrument.  Like the Measure
instrument, Timers support a `Record()` function.  The input value to
this instrument is in the language's conventional data type for timing
measurements.

Timer instruments MUST capture only the magnitude of the input value
(i.e., an absolute value).  When the user provides a negative value to
the Timer `Record()` function, the captured measurement is the number
stripped of its sign.

For example, in Go the API will accept a `time.Duration`, and in C++
the API will accept a `std::chrono::duration`.  These instruments
apply the correct units automatically, reducing the potential for
confusion over timing metric events.

See the comment: #430 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:apiCross language API specification issuespec:metricsRelated to the specification/metrics directorytriage:accepted:needs-sponsorReady to be implemented, but does not yet have a specification sponsor

    Type

    No type

    Projects

    Status

    Spec - Priority Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions