FlushMode

sealed interface FlushMode

Determines when collection happens. A sealed interface rather than a nullable Duration because the two modes differ in behaviour, not just timing.

Inheritors

Types

Link copied to clipboard
data object OnDemand : FlushMode

Collect only when PeriodicMetricReader.flush is called explicitly. The default under AWS Lambda, where the environment is frozen between invocations and a scheduled delay() may not resume until the next one, or ever.

Link copied to clipboard
class Periodic(val interval: Duration = 1.minutes) : FlushMode

Collect on a timer.