Skip to content

Commit

Permalink
[DPP-438] Change open-ended metric names into static ones (by removin…
Browse files Browse the repository at this point in the history
…g partyName part) (#10706)

* [DPP-438] Change open-ended metric names into static ones (by removing partyName part)

CHANGELOG_BEGIN
CHANGELOG_END

* revert changes in Ctx.scala

* 1
  • Loading branch information
pbatko-da authored Aug 31, 2021
1 parent 0c82006 commit bdc511e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
15 changes: 5 additions & 10 deletions ledger/metrics/src/main/scala/com/daml/metrics/Metrics.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,11 @@ final class Metrics(val registry: MetricRegistry) {
val validSubmissions: Meter =
registry.meter(Prefix :+ "valid_submissions")

def inputBufferLength(firstParty: String): Counter =
registry.counter(Prefix :+ firstParty :+ "input_buffer_length")
def inputBufferCapacity(firstParty: String): Counter =
registry.counter(Prefix :+ firstParty :+ "input_buffer_capacity")
def inputBufferDelay(firstParty: String): Timer =
registry.timer(Prefix :+ firstParty :+ "input_buffer_delay")
def maxInFlightLength(firstParty: String): Counter =
registry.counter(Prefix :+ firstParty :+ "max_in_flight_length")
def maxInFlightCapacity(firstParty: String): Counter =
registry.counter(Prefix :+ firstParty :+ "max_in_flight_capacity")
val inputBufferLength: Counter = registry.counter(Prefix :+ "input_buffer_length")
val inputBufferCapacity: Counter = registry.counter(Prefix :+ "input_buffer_capacity")
val inputBufferDelay: Timer = registry.timer(Prefix :+ "input_buffer_delay")
val maxInFlightLength: Counter = registry.counter(Prefix :+ "max_in_flight_length")
val maxInFlightCapacity: Counter = registry.counter(Prefix :+ "max_in_flight_capacity")
}

object execution {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,6 @@ private[apiserver] object ApiCommandService {
): Future[Tracker] = {
// Note: command completions are returned as long as at least one of the original submitters
// is specified in the command completion request.
// Use just name of first party for open-ended metrics to avoid unbounded metrics name for multiple parties
val metricsPrefixFirstParty = key.parties.min
for {
ledgerEnd <- completionServices.getCompletionEnd().map(_.getOffset)
} yield {
Expand Down Expand Up @@ -265,16 +263,16 @@ private[apiserver] object ApiCommandService {
)
val trackingFlow = MaxInFlight(
configuration.maxCommandsInFlight,
capacityCounter = metrics.daml.commands.maxInFlightCapacity(metricsPrefixFirstParty),
lengthCounter = metrics.daml.commands.maxInFlightLength(metricsPrefixFirstParty),
capacityCounter = metrics.daml.commands.maxInFlightCapacity,
lengthCounter = metrics.daml.commands.maxInFlightLength,
).joinMat(commandTrackerFlow)(Keep.right)

QueueBackedTracker(
trackingFlow,
configuration.inputBufferSize,
capacityCounter = metrics.daml.commands.inputBufferCapacity(metricsPrefixFirstParty),
lengthCounter = metrics.daml.commands.inputBufferLength(metricsPrefixFirstParty),
delayTimer = metrics.daml.commands.inputBufferDelay(metricsPrefixFirstParty),
capacityCounter = metrics.daml.commands.inputBufferCapacity,
lengthCounter = metrics.daml.commands.inputBufferLength,
delayTimer = metrics.daml.commands.inputBufferDelay,
)
}
}
Expand Down

0 comments on commit bdc511e

Please sign in to comment.