daml/ledger/metrics/BUILD.bazel
Stefano Baghino 26263b6999
Instrument command service queues [KVL-519] (#7576)
* [KVL-519] Instrument command service queues

changelog_begin
changelog_end

* Instrument max-in-flight queue

* Document inputBuffer and maxInFlight metrics

changelog_begin
[Sandbox] New metrics tracking the pending submissions and completions on the
CommandService. Check out the Metrics session in the sandbox documentation
for more details. The new metrics are input_buffer_size, input_buffer_saturation,
max_in_flight_size and max_in_flight_saturation.
changelog_end

* Fix compilations issues (1)

* Fix title underline in docs

* Refactoring of InstrumentedSource

- Rename saturation/size to length/capacity to make it more obvious what they are.

- Move the InstrumentedSource to ledger/metrics. Fits there better, with the utilities
  there already for futures. Arguable both should move into libs-scala package at some point though.

- Expand the tests and make the tests less flaky. 200 runs complete fine now.

- Inc/dec the capacity counter within InstrumentedSource.

* Add missing copyright header

* Reformat

* Update ledger/metrics/src/test/scala/com/daml/metrics/InstrumentedSourceSpec.scala

Co-authored-by: hanshoglund-da <67470727+hanshoglund-da@users.noreply.github.com>

* Fix title underline in docs (again)

Co-authored-by: Jussi Maki <jussi.maki@digitalasset.com>
Co-authored-by: hanshoglund-da <67470727+hanshoglund-da@users.noreply.github.com>
2020-10-07 11:54:23 +00:00

46 lines
1.4 KiB
Python

# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
load(
"//bazel_tools:scala.bzl",
"da_scala_library",
"da_scala_test_suite",
)
da_scala_library(
name = "metrics",
srcs = glob(["src/main/scala/**/*.scala"]),
resources = glob(["src/main/resources/**/*"]),
tags = ["maven_coordinates=com.daml:metrics:__VERSION__"],
visibility = [
"//visibility:public",
],
runtime_deps = [],
deps = [
"//libs-scala/concurrent",
"@maven//:com_typesafe_akka_akka_actor_2_12",
"@maven//:com_typesafe_akka_akka_stream_2_12",
"@maven//:io_dropwizard_metrics_metrics_core",
"@maven//:io_dropwizard_metrics_metrics_jvm",
"@maven//:org_scalaz_scalaz_core_2_12",
],
)
da_scala_test_suite(
name = "metrics-tests",
size = "small",
srcs = glob(["src/test/scala/**/*.scala"]),
deps = [
":metrics",
"//ledger-api/rs-grpc-akka",
"//ledger-api/rs-grpc-bridge",
"//ledger-api/testing-utils",
"//libs-scala/concurrent",
"@maven//:com_typesafe_akka_akka_actor_2_12",
"@maven//:com_typesafe_akka_akka_stream_2_12",
"@maven//:io_dropwizard_metrics_metrics_core",
"@maven//:org_scalactic_scalactic_2_12",
"@maven//:org_scalatest_scalatest_2_12",
],
)