Skip to content

Commit

Permalink
Revert "feat: added gauge metrics for batch, blob, aggregation size"
Browse files Browse the repository at this point in the history
This reverts commit 4b1bfc4.
  • Loading branch information
jonesho committed Jan 22, 2025
1 parent 2f434a1 commit 97765c3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import net.consensys.zkevm.domain.BlobCounters
import net.consensys.zkevm.domain.BlobsToAggregate
import org.apache.logging.log4j.LogManager
import org.apache.logging.log4j.Logger
import java.lang.IllegalStateException
import java.util.PriorityQueue
import java.util.concurrent.atomic.AtomicInteger

class GlobalAggregationCalculator(
private var lastBlockNumber: ULong,
Expand All @@ -24,9 +24,6 @@ class GlobalAggregationCalculator(
b1.startBlockNumber.compareTo(b2.startBlockNumber)
}

private val aggregationSizeInBlocks = AtomicInteger(0)
private val aggregationSizeInBatches = AtomicInteger(0)
private val aggregationSizeInBlobs = AtomicInteger(0)
private val blobsCounter: Counter = metricsFacade.createCounter(
category = LineaMetricsCategory.AGGREGATION,
name = "calculator.blobs.accepted",
Expand Down Expand Up @@ -65,30 +62,6 @@ class GlobalAggregationCalculator(
pendingBlobs.size
}
)
metricsFacade.createGauge(
category = LineaMetricsCategory.AGGREGATION,
name = "blocks.size",
description = "Number of blocks in each aggregation",
measurementSupplier = {
aggregationSizeInBlocks.get()
}
)
metricsFacade.createGauge(
category = LineaMetricsCategory.AGGREGATION,
name = "batches.size",
description = "Number of batches in each aggregation",
measurementSupplier = {
aggregationSizeInBatches.get()
}
)
metricsFacade.createGauge(
category = LineaMetricsCategory.AGGREGATION,
name = "blobs.size",
description = "Number of blobs in each aggregation",
measurementSupplier = {
aggregationSizeInBlobs.get()
}
)
}

private fun processBlob(blobCounters: BlobCounters) {
Expand Down Expand Up @@ -172,26 +145,18 @@ class GlobalAggregationCalculator(
endBlockNumber = blobsInUpdatedAggregation.last().endBlockNumber
)

val blocksCount = updatedAggregation.blocksRange.count()
val batchesCount = blobsInUpdatedAggregation.sumOf { it.numberOfBatches }.toInt()
val blobsCount = blobsInUpdatedAggregation.size

log.info(
"aggregation: trigger={} aggregation={} updatedAggregation={} " +
"blobsCount={} batchesCount={} blobs={} aggregationSizeMultiple={}",
aggregationTrigger.aggregationTriggerType.name,
aggregation.intervalString(),
updatedAggregation.intervalString(),
blobsCount,
batchesCount,
blobsInUpdatedAggregation.size,
blobsInUpdatedAggregation.sumOf { it.numberOfBatches },
blobsInUpdatedAggregation.map { it.intervalString() },
aggregationSizeMultipleOf
)

aggregationSizeInBlocks.set(blocksCount)
aggregationSizeInBatches.set(batchesCount)
aggregationSizeInBlobs.set(blobsCount)

// Reset the trigger calculators now that we have a valid aggregation to handle
resetTriggerCalculators()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import org.apache.logging.log4j.Logger
import tech.pegasys.teku.infrastructure.async.SafeFuture
import java.util.concurrent.CompletableFuture
import java.util.concurrent.LinkedBlockingDeque
import java.util.concurrent.atomic.AtomicInteger
import kotlin.time.Duration

class BlobCompressionProofCoordinator(
Expand All @@ -39,9 +38,6 @@ class BlobCompressionProofCoordinator(
private val blobsToHandle = LinkedBlockingDeque<Blob>(defaultQueueCapacity)
private var timerId: Long? = null
private lateinit var blobPollingAction: Handler<Long>

private val blobSizeInBlocks = AtomicInteger(0)
private val blobSizeInBatches = AtomicInteger(0)
private val blobsCounter = metricsFacade.createCounter(
category = LineaMetricsCategory.BLOB,
name = "counter",
Expand All @@ -55,18 +51,6 @@ class BlobCompressionProofCoordinator(
description = "Size of blob compression proving queue",
measurementSupplier = { blobsToHandle.size }
)
metricsFacade.createGauge(
category = LineaMetricsCategory.BLOB,
name = "blocks.size",
description = "Number of blocks in each blob",
measurementSupplier = { blobSizeInBlocks.get() }
)
metricsFacade.createGauge(
category = LineaMetricsCategory.BLOB,
name = "batches.size",
description = "Number of batches in each blob",
measurementSupplier = { blobSizeInBatches.get() }
)
}

data class Config(
Expand Down Expand Up @@ -183,8 +167,6 @@ class BlobCompressionProofCoordinator(
blobsToHandle.size,
blob.conflations.toBlockIntervalsString()
)
blobSizeInBlocks.set(blob.blocksRange.count())
blobSizeInBatches.set(blob.conflations.size)
blobsToHandle.put(blob)
log.trace("Blob was added to the handling queue {}", blob)
return SafeFuture.completedFuture(Unit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import org.apache.logging.log4j.Logger
import tech.pegasys.teku.infrastructure.async.SafeFuture
import java.util.concurrent.PriorityBlockingQueue
import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicInteger

class ConflationServiceImpl(
private val calculator: TracesConflationCalculator,
Expand All @@ -32,7 +31,7 @@ class ConflationServiceImpl(
}

internal val blocksToConflate = PriorityBlockingQueue<PayloadAndBlockCounters>()
private val batchSizeInBlocks = AtomicInteger(0)

private val blocksCounter = metricsFacade.createCounter(
category = LineaMetricsCategory.CONFLATION,
name = "blocks.imported",
Expand All @@ -52,12 +51,6 @@ class ConflationServiceImpl(
description = "Number of blocks in conflation queue",
measurementSupplier = { blocksToConflate.size }
)
metricsFacade.createGauge(
category = LineaMetricsCategory.CONFLATION,
name = "blocks.size",
description = "Number of blocks in each conflated batch",
measurementSupplier = { batchSizeInBlocks.get() }
)
calculator.onConflatedBatch(this::handleConflation)
}

Expand All @@ -70,8 +63,6 @@ class ConflationServiceImpl(
conflation.tracesCounters,
conflation.blocksRange.joinToString(",", "[", "]") { it.toString() }
)
batchSizeInBlocks.set(conflation.blocksRange.count())

val blocksToConflate =
blocksInProgress
.filter { it.number in conflation.blocksRange }
Expand Down

0 comments on commit 97765c3

Please sign in to comment.