← ZIO Profiling docs

zio.profiling

package zio.profiling

Members list

Type members

Classlikes

final case class CostCenter(locations: Chunk[String])

A CostCenter allows grouping multiple source code locations into one unit for reporting and targeting purposes. Instead of relying on a function call hierarchy to identify a location, zio-profiling relies on manual tagging.

A CostCenter allows grouping multiple source code locations into one unit for reporting and targeting purposes. Instead of relying on a function call hierarchy to identify a location, zio-profiling relies on manual tagging.

for {
 _ <- CostCenter.withChildCostCenter("short")(ZIO.succeed(Thread.sleep(20))) // code attributed to cost center `Root / "short"`
 _ <- CostCenter.withChildCostCenter("long")(ZIO.succeed(Thread.sleep(40))) // code attributes to cost center `Root / "long"`
} yield ()

Attributes

Companion
object
Source
CostCenter.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object CostCenter

Attributes

Companion
class
Source
CostCenter.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
CostCenter.type