From 2a73aed0b91c17f1992de51ff53f30af52067631 Mon Sep 17 00:00:00 2001 From: Vasil Vasilev Date: Sun, 14 Nov 2021 00:18:37 +0100 Subject: [PATCH] Make the MBean implementation classes final --- .../scala/cats/effect/unsafe/metrics/ComputePoolSampler.scala | 2 +- .../scala/cats/effect/unsafe/metrics/LocalQueueSampler.scala | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/jvm/src/main/scala/cats/effect/unsafe/metrics/ComputePoolSampler.scala b/core/jvm/src/main/scala/cats/effect/unsafe/metrics/ComputePoolSampler.scala index d015150b62..d30d87c624 100644 --- a/core/jvm/src/main/scala/cats/effect/unsafe/metrics/ComputePoolSampler.scala +++ b/core/jvm/src/main/scala/cats/effect/unsafe/metrics/ComputePoolSampler.scala @@ -24,7 +24,7 @@ package metrics * @param queue * the monitored local queue */ -private[unsafe] class ComputePoolSampler(compute: WorkStealingThreadPool) +private[unsafe] final class ComputePoolSampler(compute: WorkStealingThreadPool) extends ComputePoolSamplerMBean { def getWorkerThreadCount(): Int = compute.getWorkerThreadCount() def getActiveThreadCount(): Int = compute.getActiveThreadCount() diff --git a/core/jvm/src/main/scala/cats/effect/unsafe/metrics/LocalQueueSampler.scala b/core/jvm/src/main/scala/cats/effect/unsafe/metrics/LocalQueueSampler.scala index 19985ea9c2..3abc9eb579 100644 --- a/core/jvm/src/main/scala/cats/effect/unsafe/metrics/LocalQueueSampler.scala +++ b/core/jvm/src/main/scala/cats/effect/unsafe/metrics/LocalQueueSampler.scala @@ -24,7 +24,8 @@ package metrics * @param queue * the monitored local queue */ -private[unsafe] class LocalQueueSampler(queue: LocalQueue) extends LocalQueueSamplerMBean { +private[unsafe] final class LocalQueueSampler(queue: LocalQueue) + extends LocalQueueSamplerMBean { def getFiberCount(): Int = queue.getFiberCount() def getHeadIndex(): Int = queue.getHeadIndex() def getTailIndex(): Int = queue.getTailIndex()