Skip to content

Commit

Permalink
Split MetricUpdater in a separate class.
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrozev committed Feb 1, 2024
1 parent 1b0a7b6 commit a9f2668
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,12 @@ import java.util.concurrent.ScheduledExecutorService
import java.util.concurrent.ScheduledFuture
import java.util.concurrent.TimeUnit

open class UpdatingMetricsContainer(
namespace: String,
class MetricsUpdater(
private val executor: ScheduledExecutorService,
private val updateInterval: Duration
) : MetricsContainer(namespace = namespace) {
) {
private val logger = createLogger()

private val subtasks: MutableList<() -> Unit> = CopyOnWriteArrayList()

private var updateTask: ScheduledFuture<*>? = null

// Allow updates to be disabled for tests
Expand Down

0 comments on commit a9f2668

Please sign in to comment.