public void initializeMetrics()

in encryption/src/main/java/org/apache/solr/update/DirectUpdateHandler2Copy.java [201:281]


  public void initializeMetrics(SolrMetricsContext parentContext, String scope) {
    solrMetricsContext = parentContext.getChildContext(this);
    commitCommands = solrMetricsContext.meter("commits", getCategory().toString(), scope);
    solrMetricsContext.gauge(
      () -> commitTracker.getCommitCount(), true, "autoCommits", getCategory().toString(), scope);
    solrMetricsContext.gauge(
      () -> softCommitTracker.getCommitCount(),
      true,
      "softAutoCommits",
      getCategory().toString(),
      scope);
    if (commitTracker.getDocsUpperBound() > 0) {
      solrMetricsContext.gauge(
        () -> commitTracker.getDocsUpperBound(),
        true,
        "autoCommitMaxDocs",
        getCategory().toString(),
        scope);
    }
    if (commitTracker.getTimeUpperBound() > 0) {
      solrMetricsContext.gauge(
        () -> "" + commitTracker.getTimeUpperBound() + "ms",
        true,
        "autoCommitMaxTime",
        getCategory().toString(),
        scope);
    }
    if (commitTracker.getTLogFileSizeUpperBound() > 0) {
      solrMetricsContext.gauge(
        () -> commitTracker.getTLogFileSizeUpperBound(),
        true,
        "autoCommitMaxSize",
        getCategory().toString(),
        scope);
    }
    if (softCommitTracker.getDocsUpperBound() > 0) {
      solrMetricsContext.gauge(
        () -> softCommitTracker.getDocsUpperBound(),
        true,
        "softAutoCommitMaxDocs",
        getCategory().toString(),
        scope);
    }
    if (softCommitTracker.getTimeUpperBound() > 0) {
      solrMetricsContext.gauge(
        () -> "" + softCommitTracker.getTimeUpperBound() + "ms",
        true,
        "softAutoCommitMaxTime",
        getCategory().toString(),
        scope);
    }
    optimizeCommands = solrMetricsContext.meter("optimizes", getCategory().toString(), scope);
    rollbackCommands = solrMetricsContext.meter("rollbacks", getCategory().toString(), scope);
    splitCommands = solrMetricsContext.meter("splits", getCategory().toString(), scope);
    mergeIndexesCommands = solrMetricsContext.meter("merges", getCategory().toString(), scope);
    expungeDeleteCommands =
      solrMetricsContext.meter("expungeDeletes", getCategory().toString(), scope);
    solrMetricsContext.gauge(
      () -> numDocsPending.longValue(), true, "docsPending", getCategory().toString(), scope);
    solrMetricsContext.gauge(
      () -> addCommands.longValue(), true, "adds", getCategory().toString(), scope);
    solrMetricsContext.gauge(
      () -> deleteByIdCommands.longValue(), true, "deletesById", getCategory().toString(), scope);
    solrMetricsContext.gauge(
      () -> deleteByQueryCommands.longValue(),
      true,
      "deletesByQuery",
      getCategory().toString(),
      scope);
    solrMetricsContext.gauge(
      () -> numErrors.longValue(), true, "errors", getCategory().toString(), scope);

    addCommandsCumulative =
      solrMetricsContext.meter("cumulativeAdds", getCategory().toString(), scope);
    deleteByIdCommandsCumulative =
      solrMetricsContext.meter("cumulativeDeletesById", getCategory().toString(), scope);
    deleteByQueryCommandsCumulative =
      solrMetricsContext.meter("cumulativeDeletesByQuery", getCategory().toString(), scope);
    numErrorsCumulative =
      solrMetricsContext.meter("cumulativeErrors", getCategory().toString(), scope);
  }