message: Separate counters for started and completed tasks.
diff: @@ -26,13 +26,13 @@ impl StorageMetrics {
  pub(super) fn inc_sync_task_limiter_in_flight_counter(&self) {
  if let Some(metrics) = &self.0 {
  - metrics.sync_task_limiter_in_flight_counter.inc();
  + metrics.sync_task_limiter_started_counter.inc();
  }
  }
  pub(super) fn dec_sync_task_limiter_in_flight_counter(&self) {
  if let Some(metrics) = &self.0 {
  - metrics.sync_task_limiter_in_flight_counter.inc_by(-1.0);
  + metrics.sync_task_limiter_completed_counter.inc();
  }
  }
  @@ -47,9 +47,10 @@ impl Drop for StorageMetrics {
  fn drop(&mut self) {
  if let Some(metrics) = &mut self.0 {
  unregister_metric!(metrics.registry, metrics.sync_task_limiter_waiting_millis);
  + unregister_metric!(metrics.registry, metrics.sync_task_limiter_started_counter);
  unregister_metric!(
  metrics.registry,
  - metrics.sync_task_limiter_in_flight_counter
  + metrics.sync_task_limiter_completed_counter
  );
  }
  }
  @@ -57,7 +58,8 @@ impl Drop for StorageMetrics {
  #[derive(Debug)]
  struct Metrics {
  - pub(crate) sync_task_limiter_in_flight_counter: Counter,
  + pub(crate) sync_task_limiter_started_counter: Counter,
  + pub(crate) sync_task_limiter_completed_counter: Counter,
  pub(crate) sync_task_limiter_waiting_millis: Histogram,
  /// Reference to the registry for unregistering.
  registry: Registry,
  @@ -71,14 +73,21 @@ impl Metrics {
  EXPONENTIAL_BUCKET_COUNT,
  )?;
  - let sync_task_limiter_in_flight_counter = Counter::new(
  - "storage_sync_task_limiter_in_flight_count",
  - "number of currently awaiting tasks on the semaphore",
  + let sync_task_limiter_started_counter = Counter::new(
  + "storage_sync_task_limiter_started_count",
  + "number started tasks",
  )?;
  - registry.register(Box::new(sync_task_limiter_in_flight_counter.clone()))?;
  + registry.register(Box::new(sync_task_limiter_started_counter.clone()))?;
  +
  + let sync_task_limiter_completed_counter = Counter::new(
  + "storage_sync_task_limiter_completed_counter",
  + "number completed tasks",
  + )?;
  + registry.register(Box::new(sync_task_limiter_completed_counter.clone()))?;
  Ok(Metrics {
  - sync_task_limiter_in_flight_counter,
  + sync_task_limiter_started_counter,
  + sync_task_limiter_completed_counter,
  sync_task_limiter_waiting_millis: utils::register_histogram_metric(
  registry,
  "storage_sync_task_limiter_waiting_millis",
  