BuildkiteTestCollector.Duration (buildkite_test_collector v0.3.0)

The difference between two instants with microsecond accuracy.

The Buildkite analytics API stores all times as decimal seconds since the start of the test run. Therefore we use Duration to calculate the span between two Instant values.

Link to this section Summary

Functions

Return the absolute duration (ie make the duration unsigned).

The duration of the timing, in (fractional) seconds.

Return the elapsed time between two instants.

Returns the elapsed duration between instant and now.

Create a new duration directly from microseconds.

Create a new duration from the specified number of seconds.

Link to this section Types

@type t() :: %BuildkiteTestCollector.Duration{usec: integer()}

Link to this section Functions

@spec abs(t()) :: t()

Return the absolute duration (ie make the duration unsigned).

Link to this function

as_seconds(duration)

@spec as_seconds(t()) :: number()

The duration of the timing, in (fractional) seconds.

Link to this function

between(instant1, instant2)

Return the elapsed time between two instants.

Link to this function

elapsed(instant)

@spec elapsed(BuildkiteTestCollector.Instant.t()) :: t()

Returns the elapsed duration between instant and now.

Link to this function

from_microseconds(microseconds)

@spec from_microseconds(number()) :: t()

Create a new duration directly from microseconds.

Link to this function

from_seconds(seconds)

@spec from_seconds(number()) :: t()

Create a new duration from the specified number of seconds.