final class Counter[A] extends ZIOMetric[A]
A Counter
is a metric representing a single numerical value that may be
incremented over time. A typical use of this metric would be to track the
number of a certain type of request received. With a counter the quantity
of interest is the cumulative value over time, as opposed to a gauge where
the quantity of interest is the value as of a specific point in time.
- Self Type
- Counter[A]
- Alphabetic
- By Inheritance
- Counter
- ZIOMetric
- ZIOAspect
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Counter(name: String, tags: Chunk[MetricLabel], aspect: (Counter[A]) ⇒ MetricAspect[A])
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
-
def
>>>[LowerR1 >: Nothing, UpperR1 <: Any, LowerE1 >: Nothing, UpperE1 <: Any, LowerA1 >: Nothing, UpperA1 <: A](that: ZIOAspect[LowerR1, UpperR1, LowerE1, UpperE1, LowerA1, UpperA1]): ZIOAspect[LowerR1, UpperR1, LowerE1, UpperE1, LowerA1, UpperA1]
- Definition Classes
- ZIOAspect
-
def
@@[LowerR1 >: Nothing, UpperR1 <: Any, LowerE1 >: Nothing, UpperE1 <: Any, LowerA1 >: Nothing, UpperA1 <: A](that: ZIOAspect[LowerR1, UpperR1, LowerE1, UpperE1, LowerA1, UpperA1]): ZIOAspect[LowerR1, UpperR1, LowerE1, UpperE1, LowerA1, UpperA1]
Returns a new aspect that represents the sequential composition of this aspect with the specified one.
Returns a new aspect that represents the sequential composition of this aspect with the specified one.
- Definition Classes
- ZIOAspect
-
def
andThen[LowerR1 >: Nothing, UpperR1 <: Any, LowerE1 >: Nothing, UpperE1 <: Any, LowerA1 >: Nothing, UpperA1 <: A](that: ZIOAspect[LowerR1, UpperR1, LowerE1, UpperE1, LowerA1, UpperA1]): ZIOAspect[LowerR1, UpperR1, LowerE1, UpperE1, LowerA1, UpperA1]
- Definition Classes
- ZIOAspect
- def apply[R, E, A1 <: A](zio: ZIO[R, E, A1])(implicit trace: ZTraceElement): ZIO[R, E, A1]
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
copy(name: String = name, tags: Chunk[MetricLabel] = tags): Counter[A]
Returns a copy of this counter with the specified name and tags.
-
def
count(implicit trace: ZTraceElement): UIO[Double]
Returns the current value of this counter.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(that: Any): Boolean
Returns whether this counter is equal to the specified counter.
Returns whether this counter is equal to the specified counter.
- Definition Classes
- Counter → AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
Returns the hash code of this counter.
Returns the hash code of this counter.
- Definition Classes
- Counter → AnyRef → Any
-
def
increment(implicit trace: ZTraceElement): UIO[Any]
Increments this counter by one.
-
def
increment(value: Double)(implicit trace: ZTraceElement): UIO[Any]
Increments this counter by the specified amount.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
lazy val
metricType: Class[_ <: (Counter[A]) ⇒ MetricAspect[A]]
The type of this counter.
The type of this counter.
- Attributes
- protected
- val name: String
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
taggedWith(f: (A) ⇒ Chunk[MetricLabel]): ZIOMetric[A]
Converts this counter metric to one where the tags depend on the measured effect's result value
- val tags: Chunk[MetricLabel]
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()