diff --git a/core/js/src/main/scala/cats/effect/IOApp.scala b/core/js/src/main/scala/cats/effect/IOApp.scala index 5f5e1b9b39..cf8b1e3521 100644 --- a/core/js/src/main/scala/cats/effect/IOApp.scala +++ b/core/js/src/main/scala/cats/effect/IOApp.scala @@ -16,9 +16,9 @@ package cats.effect -import cats.effect.metrics.{CpuStarvationWarningMetrics, JsCpuStarvationMetrics} import cats.effect.std.Console import cats.effect.tracing.TracingConstants._ +import cats.effect.unsafe.metrics.{CpuStarvationWarningMetrics, JsCpuStarvationMetrics} import scala.concurrent.CancellationException import scala.concurrent.duration._ diff --git a/core/js/src/main/scala/cats/effect/metrics/JsCpuStarvationMetrics.scala b/core/js/src/main/scala/cats/effect/unsafe/metrics/JsCpuStarvationMetrics.scala similarity index 96% rename from core/js/src/main/scala/cats/effect/metrics/JsCpuStarvationMetrics.scala rename to core/js/src/main/scala/cats/effect/unsafe/metrics/JsCpuStarvationMetrics.scala index 3353e9ef30..a6dcbd182d 100644 --- a/core/js/src/main/scala/cats/effect/metrics/JsCpuStarvationMetrics.scala +++ b/core/js/src/main/scala/cats/effect/unsafe/metrics/JsCpuStarvationMetrics.scala @@ -14,7 +14,7 @@ * limitations under the License. */ -package cats.effect.metrics +package cats.effect.unsafe.metrics import cats.effect.IO diff --git a/core/jvm/src/main/scala/cats/effect/IOApp.scala b/core/jvm/src/main/scala/cats/effect/IOApp.scala index 816ad51053..34071cae97 100644 --- a/core/jvm/src/main/scala/cats/effect/IOApp.scala +++ b/core/jvm/src/main/scala/cats/effect/IOApp.scala @@ -16,9 +16,9 @@ package cats.effect -import cats.effect.metrics.{CpuStarvationWarningMetrics, JvmCpuStarvationMetrics} import cats.effect.std.Console import cats.effect.tracing.TracingConstants._ +import cats.effect.unsafe.metrics.{CpuStarvationWarningMetrics, JvmCpuStarvationMetrics} import cats.syntax.all._ import scala.concurrent.{blocking, CancellationException, ExecutionContext} diff --git a/core/jvm/src/main/scala/cats/effect/unsafe/metrics/CpuStarvation.scala b/core/jvm/src/main/scala/cats/effect/unsafe/metrics/CpuStarvation.scala index 6a1d726669..16a425a8f5 100644 --- a/core/jvm/src/main/scala/cats/effect/unsafe/metrics/CpuStarvation.scala +++ b/core/jvm/src/main/scala/cats/effect/unsafe/metrics/CpuStarvation.scala @@ -14,7 +14,7 @@ * limitations under the License. */ -package cats.effect.metrics +package cats.effect.unsafe.metrics import cats.effect.IO @@ -22,7 +22,7 @@ import scala.concurrent.duration.FiniteDuration import java.util.concurrent.atomic.AtomicLong -private[metrics] class CpuStarvation private ( +private[unsafe] class CpuStarvation private ( counter: AtomicLong, currentClockDrift: AtomicLong, maxClockDrift: AtomicLong) @@ -48,8 +48,8 @@ private[metrics] class CpuStarvation private ( } -private[metrics] object CpuStarvation { - private[metrics] def apply(): IO[CpuStarvation] = for { +private[unsafe] object CpuStarvation { + private[unsafe] def apply(): IO[CpuStarvation] = for { counter <- IO.delay(new AtomicLong(0)) currentClockDrift <- IO.delay(new AtomicLong(0)) maxClockDrift <- IO.delay(new AtomicLong(0)) diff --git a/core/jvm/src/main/scala/cats/effect/unsafe/metrics/CpuStarvationMbean.scala b/core/jvm/src/main/scala/cats/effect/unsafe/metrics/CpuStarvationMbean.scala index d8e4a592d4..c6671119dc 100644 --- a/core/jvm/src/main/scala/cats/effect/unsafe/metrics/CpuStarvationMbean.scala +++ b/core/jvm/src/main/scala/cats/effect/unsafe/metrics/CpuStarvationMbean.scala @@ -14,7 +14,7 @@ * limitations under the License. */ -package cats.effect.metrics +package cats.effect.unsafe.metrics /** * An MBean interfaces for monitoring when CPU starvation occurs. diff --git a/core/jvm/src/main/scala/cats/effect/unsafe/metrics/JvmCpuStarvationMetrics.scala b/core/jvm/src/main/scala/cats/effect/unsafe/metrics/JvmCpuStarvationMetrics.scala index dfe024d20f..fb3fbef5c5 100644 --- a/core/jvm/src/main/scala/cats/effect/unsafe/metrics/JvmCpuStarvationMetrics.scala +++ b/core/jvm/src/main/scala/cats/effect/unsafe/metrics/JvmCpuStarvationMetrics.scala @@ -14,7 +14,7 @@ * limitations under the License. */ -package cats.effect.metrics +package cats.effect.unsafe.metrics import cats.effect.{IO, Resource} import cats.effect.std.Console @@ -27,7 +27,7 @@ import java.lang.management.ManagementFactory import javax.management.{MBeanServer, ObjectName} private[effect] class JvmCpuStarvationMetrics private (mbean: CpuStarvation) - extends UnsealedCpuStarvationMetrics { + extends CpuStarvationMetrics { override def incCpuStarvationCount: IO[Unit] = mbean.incStarvationCount override def recordClockDrift(drift: FiniteDuration): IO[Unit] = mbean.recordDrift(drift) diff --git a/core/native/src/main/scala/cats/effect/IOApp.scala b/core/native/src/main/scala/cats/effect/IOApp.scala index 6268cf9b33..ad3bbca78e 100644 --- a/core/native/src/main/scala/cats/effect/IOApp.scala +++ b/core/native/src/main/scala/cats/effect/IOApp.scala @@ -16,7 +16,7 @@ package cats.effect -import cats.effect.metrics.{CpuStarvationWarningMetrics, NativeCpuStarvationMetrics} +import cats.effect.unsafe.metrics.{CpuStarvationWarningMetrics, NativeCpuStarvationMetrics} import cats.syntax.all._ import scala.concurrent.CancellationException diff --git a/core/native/src/main/scala/cats/effect/metrics/NativeCpuStarvationMetrics.scala b/core/native/src/main/scala/cats/effect/unsafe/metrics/NativeCpuStarvationMetrics.scala similarity index 96% rename from core/native/src/main/scala/cats/effect/metrics/NativeCpuStarvationMetrics.scala rename to core/native/src/main/scala/cats/effect/unsafe/metrics/NativeCpuStarvationMetrics.scala index bc2c849e58..5f268a8647 100644 --- a/core/native/src/main/scala/cats/effect/metrics/NativeCpuStarvationMetrics.scala +++ b/core/native/src/main/scala/cats/effect/unsafe/metrics/NativeCpuStarvationMetrics.scala @@ -14,7 +14,7 @@ * limitations under the License. */ -package cats.effect.metrics +package cats.effect.unsafe.metrics import cats.effect.IO diff --git a/core/shared/src/main/scala/cats/effect/CpuStarvationCheck.scala b/core/shared/src/main/scala/cats/effect/CpuStarvationCheck.scala index 92cfe9e14b..77edabab2b 100644 --- a/core/shared/src/main/scala/cats/effect/CpuStarvationCheck.scala +++ b/core/shared/src/main/scala/cats/effect/CpuStarvationCheck.scala @@ -16,9 +16,9 @@ package cats.effect -import cats.effect.metrics.{CpuStarvationMetrics, CpuStarvationWarningMetrics} import cats.effect.std.Console import cats.effect.unsafe.IORuntimeConfig +import cats.effect.unsafe.metrics.{CpuStarvationMetrics, CpuStarvationWarningMetrics} import cats.syntax.all._ import scala.concurrent.duration.{Duration, FiniteDuration} diff --git a/core/shared/src/main/scala/cats/effect/metrics/CpuStarvationMetrics.scala b/core/shared/src/main/scala/cats/effect/unsafe/metrics/CpuStarvationMetrics.scala similarity index 95% rename from core/shared/src/main/scala/cats/effect/metrics/CpuStarvationMetrics.scala rename to core/shared/src/main/scala/cats/effect/unsafe/metrics/CpuStarvationMetrics.scala index 1b0e51e2cd..476701b782 100644 --- a/core/shared/src/main/scala/cats/effect/metrics/CpuStarvationMetrics.scala +++ b/core/shared/src/main/scala/cats/effect/unsafe/metrics/CpuStarvationMetrics.scala @@ -14,7 +14,7 @@ * limitations under the License. */ -package cats.effect.metrics +package cats.effect.unsafe.metrics import cats.effect.IO diff --git a/core/shared/src/main/scala/cats/effect/metrics/CpuStarvationWarningMetrics.scala b/core/shared/src/main/scala/cats/effect/unsafe/metrics/CpuStarvationWarningMetrics.scala similarity index 95% rename from core/shared/src/main/scala/cats/effect/metrics/CpuStarvationWarningMetrics.scala rename to core/shared/src/main/scala/cats/effect/unsafe/metrics/CpuStarvationWarningMetrics.scala index 65194deae1..0ae11245e4 100644 --- a/core/shared/src/main/scala/cats/effect/metrics/CpuStarvationWarningMetrics.scala +++ b/core/shared/src/main/scala/cats/effect/unsafe/metrics/CpuStarvationWarningMetrics.scala @@ -14,7 +14,7 @@ * limitations under the License. */ -package cats.effect.metrics +package cats.effect.unsafe.metrics import scala.concurrent.duration.FiniteDuration