object TimeStamped extends Serializable
- Source
- TimeStamped.scala
- Alphabetic
- By Inheritance
- TimeStamped
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def attemptReorderLocally[F[_], A](over: FiniteDuration): Pipe[F, TimeStamped[A], TimeStamped[A]]
Scan that reorders timestamped values over a specified duration.
Scan that reorders timestamped values over a specified duration.
Values are kept in an internal buffer. Upon receiving a new value, any buffered values that are timestamped with
value.time - over
are emitted. Other values, and the new value, are kept in the buffer.This is useful for ordering mostly ordered streams, where values may be out of order with close neighbors but are strictly less than values that come much later in the stream.
An example of such a structure is the result of merging streams of values generated with
TimeStamped.now
.Caution: this scan should only be used on streams that are mostly ordered. In the worst case, if the source is in reverse order, all values in the source will be accumulated in to the buffer until the source halts, and then the values will be emitted in order.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- implicit val functor: Functor[[α$0$]TimeStamped[α$0$]]
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def increasing[F[_], A]: Pipe[F, TimeStamped[A], TimeStamped[A]]
Scan that filters the specified timestamped values to ensure the output time stamps are always increasing in time.
Scan that filters the specified timestamped values to ensure the output time stamps are always increasing in time. Other values are dropped.
- def increasingEither[F[_], A]: Pipe[F, TimeStamped[A], Either[TimeStamped[A], TimeStamped[A]]]
Scan that filters the specified timestamped values to ensure the output time stamps are always increasing in time.
Scan that filters the specified timestamped values to ensure the output time stamps are always increasing in time. The increasing values are emitted wrapped in
Right
, while out of order values are emitted inLeft
. - final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def left[S, I, O, A](t: Scan[S, TimeStamped[I], TimeStamped[O]]): Scan[S, TimeStamped[Either[I, A]], TimeStamped[Either[O, A]]]
- def monotonic[F[_], A](a: A)(implicit arg0: Functor[F], arg1: Clock[F]): F[TimeStamped[A]]
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- implicit def ordering[A](implicit A: Ordering[A]): Ordering[TimeStamped[A]]
Orders values by timestamp, then by value.
- def perSecondRate[A, B](f: (A) => B)(implicit arg0: Monoid[B]): Scan[(Option[FiniteDuration], B), TimeStamped[A], TimeStamped[B]]
Scan that converts a stream of
TimeStamped[A]
in to a stream ofTimeStamped[B]
whereB
is an accumulated feature ofA
over a second.Scan that converts a stream of
TimeStamped[A]
in to a stream ofTimeStamped[B]
whereB
is an accumulated feature ofA
over a second.For example, the emitted bits per second of a
Stream[F, ByteVector]
can be calculated usingperSecondRate(_.size * 8)
, which yields a stream of the emitted bits per second.- f
function which extracts a feature of
A
- def preserve[S, I, O](t: Scan[S, I, O]): Scan[S, TimeStamped[I], TimeStamped[O]]
Combinator that converts a
Scan[A, B]
in to aScan[TimeStamped[A], TimeStamped[B]]
such that timestamps are preserved on elements that flow through the stream. - def rate[A, B](over: FiniteDuration)(f: (A) => B)(implicit arg0: Monoid[B]): Scan[(Option[FiniteDuration], B), TimeStamped[A], TimeStamped[B]]
Scan that converts a stream of
TimeStamped[A]
in to a stream ofTimeStamped[B]
whereB
is an accumulated feature ofA
over a specified time period.Scan that converts a stream of
TimeStamped[A]
in to a stream ofTimeStamped[B]
whereB
is an accumulated feature ofA
over a specified time period.For example, the emitted bits per second of a
Stream[F, ByteVector]
can be calculated usingrate(1.0)(_.size * 8)
, which yields a stream of the emitted bits per second.- over
time period over which to calculate
- f
function which extracts a feature of
A
- def realTime[F[_], A](a: A)(implicit arg0: Functor[F], arg1: Clock[F]): F[TimeStamped[A]]
- def reorderLocally[F[_], A](over: FiniteDuration): Pipe[F, TimeStamped[A], TimeStamped[A]]
Scan that reorders a stream of timestamped values that are mostly ordered, using a time based buffer of the specified duration.
Scan that reorders a stream of timestamped values that are mostly ordered, using a time based buffer of the specified duration. See attemptReorderLocally for details.
The resulting stream is guaranteed to always emit values in time increasing order. Values may be dropped from the source stream if they were not successfully reordered.
- def reorderLocallyEither[F[_], A](over: FiniteDuration): Pipe[F, TimeStamped[A], Either[TimeStamped[A], TimeStamped[A]]]
Scan that reorders a stream of timestamped values that are mostly ordered, using a time based buffer of the specified duration.
Scan that reorders a stream of timestamped values that are mostly ordered, using a time based buffer of the specified duration. See attemptReorderLocally for details.
The resulting stream is guaranteed to always emit output values in time increasing order, wrapped in
Right
. Any values that could not be reordered due to insufficient buffer space are emitted wrapped inLeft
. - def right[S, I, O, A](t: Scan[S, TimeStamped[I], TimeStamped[O]]): Scan[S, TimeStamped[Either[A, I]], TimeStamped[Either[A, O]]]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def throttle[F[_], A](throttlingFactor: Double, tickResolution: FiniteDuration)(implicit arg0: Temporal[F]): Pipe[F, TimeStamped[A], TimeStamped[A]]
Returns a stream that is the throttled version of the source stream.
Returns a stream that is the throttled version of the source stream.
Given two adjacent items from the source stream,
a
andb
, wherea
is emitted first andb
is emitted second, their time delta isb.time - a.time
.This function creates a stream that emits values at wall clock times such that the time delta between any two adjacent values is proportional to their time delta in the source stream.
The
throttlingFactor
is a scaling factor that determines how much source time a unit of wall clock time is worth. A value of 1.0 causes the output stream to emit values spaced in wall clock time equal to their time deltas. A value of 2.0 emits values at twice the speed of wall clock time.This is particularly useful when timestamped data can be read in bulk (e.g., from a capture file) but should be "played back" at real time speeds.
- def tick(time: FiniteDuration): TimeStamped[Option[Nothing]]
- def timeBasedOrdering[A]: Ordering[TimeStamped[A]]
Orders values by timestamp -- values with the same timestamp are considered equal.
- def toString(): String
- Definition Classes
- AnyRef → Any
- def unsafeMonotonic[A](a: A): TimeStamped[A]
- def unsafeRealTime[A](a: A): TimeStamped[A]
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def withPerSecondRate[A, B](f: (A) => B)(implicit arg0: Monoid[B]): Scan[(Option[FiniteDuration], B), TimeStamped[A], TimeStamped[Either[B, A]]]
Scan that converts a stream of
TimeStamped[A]
in to a stream ofTimeStamped[B Either A]
whereB
is an accumulated feature ofA
over a second.Scan that converts a stream of
TimeStamped[A]
in to a stream ofTimeStamped[B Either A]
whereB
is an accumulated feature ofA
over a second.Every incoming
A
is echoed to the output.For example, the emitted bits per second of a
Stream[F, ByteVector]
can be calculated usingperSecondRate(_.size * 8)
, which yields a stream of the emitted bits per second.- f
function which extracts a feature of
A
- def withRate[A, B](over: FiniteDuration)(f: (A) => B)(implicit B: Monoid[B]): Scan[(Option[FiniteDuration], B), TimeStamped[A], TimeStamped[Either[B, A]]]
Scan that converts a stream of
TimeStamped[A]
in to a stream ofTimeStamped[Either[B, A]]
whereB
is an accumulated feature ofA
over a specified time period.Scan that converts a stream of
TimeStamped[A]
in to a stream ofTimeStamped[Either[B, A]]
whereB
is an accumulated feature ofA
over a specified time period.Every incoming
A
is echoed to the output.For example, the emitted bits per second of a
Stream[F, ByteVector]
can be calculated usingrate(1.second)(_.size * 8)
, which yields a stream of the emitted bits per second.- over
time period over which to calculate
- f
function which extracts a feature of
A
- object syntax
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
- def now[F[_], A](a: A)(implicit arg0: Functor[F], arg1: Clock[F]): F[TimeStamped[A]]
- Annotations
- @deprecated
- Deprecated
(Since version 3.2.10) Use realTime or monotonic
- def unsafeNow[A](a: A): TimeStamped[A]
- Annotations
- @deprecated
- Deprecated
(Since version 3.2.10) Use unsafeRealTime or unsafeMonotonic