Skip to content

Commit

Permalink
Merge pull request #809 from ChandraAddala/metrics-search-meter
Browse files Browse the repository at this point in the history
Adding histogram for metrics search results size
  • Loading branch information
ChandraAddala committed May 18, 2017
2 parents be582d1 + 1cff629 commit 105246b
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -35,6 +35,7 @@ public abstract class AbstractElasticIO implements DiscoveryIO {
protected final Histogram batchHistogram = Metrics.histogram(getClass(), "Batch Sizes");
protected Meter classCastExceptionMeter = Metrics.meter(getClass(), "Failed Cast to IMetric");
protected Histogram queryBatchHistogram = Metrics.histogram(getClass(), "Query Batch Size");
private final Histogram searchResultsSizeHistogram = Metrics.histogram(getClass(), "Metrics search results size");

public static String METRICS_TOKENS_AGGREGATE = "metric_tokens";
public static String ELASTICSEARCH_INDEX_NAME_WRITE = Configuration.getInstance().getStringProperty(ElasticIOConfig.ELASTICSEARCH_INDEX_NAME_WRITE);
Expand Down Expand Up @@ -91,7 +92,7 @@ private List<SearchResult> searchESByIndexes(String tenant, List<String> queries
multiSearchCtx.stop();
}


searchResultsSizeHistogram.update(response.getHits().getHits().length);
for (SearchHit hit : response.getHits().getHits()) {
SearchResult result = convertHitToMetricDiscoveryResult(hit);
results.add(result);
Expand Down

0 comments on commit 105246b

Please sign in to comment.