package opentelemetry

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Opentelemetry.Interval_limiterSource

Utility to limit the frequency of some event

  • since 0.90

Interval limiter. This is a form of rate limiting where an event cannot be followed by another event until a given interval of time has passed.

Sourcetype t
Sourceval create : min_interval:Mtime.span -> unit -> t
Sourceval min_interval : t -> Mtime.span
Sourceval make_attempt : t -> bool

make_attempt lim returns true if the last successful attempt was more than min_interval ago, as measured by mtime. If so, this counts as the new latest attempt; otherwise false is returned and the state is not updated.