Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
[AMBARI-25089] NIFI-Hosts dashboard does not show any metrics in Graf…
…ana. (#14)
  • Loading branch information
avijayanhwx committed Feb 11, 2019
1 parent 011e39c commit 8341a3b89465c2cd570b2870b15dbc2ae071c585
Showing 3 changed files with 11 additions and 2 deletions.
@@ -291,6 +291,10 @@ define([
// To speed up querying on templatized dashboards.
var getAllHostData = function (target) {
var instanceId = typeof target.templatedCluster == 'undefined' ? '' : '&instanceId=' + target.templatedCluster;
var appId = target.app;
if ((appId === 'nifi' || appId === 'druid') && !instanceId) {
instanceId = "%"
}
var precision = target.precision === 'default' || typeof target.precision == 'undefined' ? '' : '&precision='
+ target.precision;
var metricAggregator = target.aggregator === "none" ? '' : '._' + target.aggregator;
@@ -60,7 +60,7 @@ public StringBuilder getConditionClause() {
}

String instanceId = getInstanceId();
if (StringUtils.isNotEmpty(instanceId)) {
if (StringUtils.isNotEmpty(instanceId) && !"%".equals(instanceId)) {
if (instanceId.contains("%")) {
appendConjunction = append(sb, appendConjunction, instanceId, " INSTANCE_ID LIKE ?");
} else {
@@ -71,6 +71,11 @@ public StringBuilder getConditionClause() {
return sb;
}

@Override
public String getInstanceId() {
return instanceId == null || "%".equals(instanceId) || instanceId.isEmpty() ? null : instanceId;
}

public boolean isMetricMetadataCondition() {
return isMetricMetadataCondition;
}
@@ -331,7 +331,7 @@ public void testAppInstanceWildcardSanitization() throws IOException, SQLExcepti

uuids = metadataManager.getUuidsForGetMetricQuery(Collections.singletonList("%"),
Collections.singletonList("%"), "%", "%");
Assert.assertTrue(uuids.size() == 6);
Assert.assertTrue(uuids.size() == 9);
}

@Test

0 comments on commit 8341a3b

Please sign in to comment.