Skip to content

Commit

Permalink
Epimetheus 0.6.0-M1 (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
sideeffffect committed Jan 31, 2024
1 parent 32ec94e commit 1c3c4c2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import com.typesafe.tools.mima.core.Problem

ThisBuild / tlBaseVersion := "0.5" // your current series x.y

ThisBuild / organization := "io.chrisdavenport"
Expand All @@ -17,7 +19,7 @@ ThisBuild / crossScalaVersions := Seq("2.12.18", "2.13.11", "3.3.0")

val catsV = "2.7.0"
val catsEffectV = "3.5.0"
val epimetheusV = "0.5.0"
val epimetheusV = "0.6.0-M1"
val circuitV = "0.5.1"

val specs2V = "4.15.0"
Expand All @@ -27,6 +29,7 @@ lazy val `epimetheus-circuit` = tlCrossRootProject

lazy val core = project.in(file("core"))
.settings(
mimaBinaryIssueFilters := List({(_: Problem) => false}), // TODO: remove this once switched to next major version
name := "epimetheus-circuit",
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-core" % catsV,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ object RejectedExecutionCounter {
* which can be applied to multiple circuit breakers.
*/
def register[F[_]: Sync](
cr: CollectorRegistry[F],
pr: PrometheusRegistry[F],
metricName: Name = Name("circuit_rejected_execution_total")
): F[RejectedExecutionCounter[F]] =
Counter.labelled(
cr,
pr,
metricName,
"Circuit Breaker Rejected Executions.",
Sized(Label("circuit_name")),
Expand All @@ -42,11 +42,11 @@ object RejectedExecutionCounter {
* Single Metered Circuit
*/
def meteredCircuit[F[_]: Sync](
cr: CollectorRegistry[F],
pr: PrometheusRegistry[F],
metricName: Name,
circuit: CircuitBreaker[F]
): F[CircuitBreaker[F]] =
Counter.noLabels[F](cr, metricName, "Circuit Breaker Rejected Executions.")
): F[CircuitBreaker[F]] =
Counter.noLabels[F](pr, metricName, "Circuit Breaker Rejected Executions.")
.map(counter => circuit.doOnRejected(counter.inc))

}

0 comments on commit 1c3c4c2

Please sign in to comment.