Skip to content

Commit

Permalink
actually finish moving metrics to unsafe
Browse files Browse the repository at this point in the history
  • Loading branch information
samspills committed Sep 22, 2023
1 parent 96fb5f0 commit 5b7d873
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion core/js/src/main/scala/cats/effect/IOApp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package cats.effect.metrics
package cats.effect.unsafe.metrics

import cats.effect.IO

Expand Down
2 changes: 1 addition & 1 deletion core/jvm/src/main/scala/cats/effect/IOApp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
* limitations under the License.
*/

package cats.effect.metrics
package cats.effect.unsafe.metrics

import cats.effect.IO

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)
Expand All @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion core/native/src/main/scala/cats/effect/IOApp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package cats.effect.metrics
package cats.effect.unsafe.metrics

import cats.effect.IO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package cats.effect.metrics
package cats.effect.unsafe.metrics

import cats.effect.IO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package cats.effect.metrics
package cats.effect.unsafe.metrics

import scala.concurrent.duration.FiniteDuration

Expand Down

0 comments on commit 5b7d873

Please sign in to comment.