RollingInterval

com.netflix.atlas.core.util.RollingInterval
See theRollingInterval companion object
case class RollingInterval(offset: Duration, duration: Duration, unit: ChronoUnit)

Interval that moves over time in increments of a given unit. When in the middle of a unit it will round to the next even boundary. For example, if the unit is HOURS and it is 10:37, then it will round too 11:00.

The offset and duration must be an even multiple of the unit.

Value parameters

duration

The length of the interval. The start time is now - offset - duration.

offset

Offset subtracted from the current time, now - offset is used as the end time for this interval.

unit

The unit to use when moving along. This is typically HOURS or DAYS.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def contains(instant: Instant): Boolean

Returns true if the instant is currently within this interval.

Returns true if the instant is currently within this interval.

Attributes

def end: Instant

Current end time for this interval.

Current end time for this interval.

Attributes

def overlaps(s: Instant, e: Instant): Boolean

Returns true if the interval [s, e] overlaps with this interval.

Returns true if the interval [s, e] overlaps with this interval.

Attributes

def start: Instant

Current start time for this interval.

Current start time for this interval.

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product