public void observeComputeEngineTaskDuration(long durationInSeconds, String taskType, String projectKey) {
    ceTasksRunningDuration.labels(taskType, projectKey).observe(durationInSeconds);
  }
@Test
  public void observeComputeEngineTaskDurationTest() {
    ServerMonitoringMetrics metrics = new ServerMonitoringMetrics();
    String[] labelNames = {"task_type", "project_key"};
    String[] labelValues = {"REPORT", "projectKey"};

    metrics.observeComputeEngineTaskDuration(10, labelValues[0], labelValues[1]);

    assertThat(CollectorRegistry.defaultRegistry.getSampleValue("sonarqube_compute_engine_tasks_running_duration_seconds_sum",
      labelNames, labelValues)).isEqualTo(10);
  }