public Map getMetrics()

in src/main/java/com/google/cloud/dfmetrics/pipelinemanager/MetricsManager.java [201:221]


  public Map<String, Double> getMetrics(String jobType, @Nullable ResourcePricing resourcePricing)
      throws IOException {
    LOG.info("Getting metrics for {} under {}", job().getId(), job().getProjectId());
    List<MetricUpdate> metrics =
        jobsClient()
            .getMetrics(job().getProjectId(), job().getLocation(), job().getId())
            .execute()
            .getMetrics();

    Map<String, Double> parsedMetrics = filterAndParseMetrics(metrics);
    LOG.info(
        "Sleeping for {} seconds to query Dataflow monitoring metrics.",
        monitoringMetricsWaitDuration().toSeconds());
    try {
      Thread.sleep(monitoringMetricsWaitDuration().toMillis());
    } catch (InterruptedException e) {
      throw new RuntimeException(e);
    }
    addComputedMetrics(parsedMetrics, jobType, resourcePricing);
    return parsedMetrics;
  }