Skip to content

Commit

Permalink
core-trace: remove Histogram.DoubleBackend
Browse files Browse the repository at this point in the history
  • Loading branch information
iRevive committed Sep 7, 2024
1 parent f699969 commit a28a328
Showing 1 changed file with 0 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ package org.typelevel.otel4s
package metrics

import cats.Applicative
import cats.Monad
import cats.effect.kernel.Clock
import cats.effect.kernel.Resource
import cats.syntax.flatMap._
import cats.syntax.functor._
import org.typelevel.otel4s.meta.InstrumentMeta

import scala.collection.immutable
Expand Down Expand Up @@ -135,28 +131,6 @@ object Histogram {
): Resource[F, Unit]
}

abstract class DoubleBackend[F[_]: Monad: Clock] extends Backend[F, Double] {

final val unit: F[Unit] = Monad[F].unit

final def recordDuration(
timeUnit: TimeUnit,
attributes: immutable.Iterable[Attribute[_]]
): Resource[F, Unit] =
Resource
.makeCase(Clock[F].monotonic) { case (start, ec) =>
for {
end <- Clock[F].monotonic
_ <- record(
(end - start).toUnit(timeUnit),
attributes ++ causeAttributes(ec)
)
} yield ()
}
.void

}

def noop[F[_], A](implicit F: Applicative[F]): Histogram[F, A] =
new Histogram[F, A] {
val backend: Backend[F, A] =
Expand Down

0 comments on commit a28a328

Please sign in to comment.