mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-05 21:13:14 +00:00
DI - Add metric name in group name (#18634)
This commit is contained in:
parent
7aae60b760
commit
14643f2b50
@ -317,7 +317,8 @@ public interface ElasticSearchDynamicChartAggregatorInterface {
|
|||||||
return new DataInsightCustomChartResult()
|
return new DataInsightCustomChartResult()
|
||||||
.withCount(value)
|
.withCount(value)
|
||||||
.withDay(Double.valueOf(key))
|
.withDay(Double.valueOf(key))
|
||||||
.withGroup(group);
|
.withGroup(group)
|
||||||
|
.withMetric(metric);
|
||||||
return new DataInsightCustomChartResult()
|
return new DataInsightCustomChartResult()
|
||||||
.withCount(value)
|
.withCount(value)
|
||||||
.withGroup(group)
|
.withGroup(group)
|
||||||
|
|||||||
@ -145,11 +145,17 @@ public class ElasticSearchLineChartAggregator
|
|||||||
ParsedTerms parsedTerms = (ParsedTerms) arg;
|
ParsedTerms parsedTerms = (ParsedTerms) arg;
|
||||||
for (Terms.Bucket bucket : parsedTerms.getBuckets()) {
|
for (Terms.Bucket bucket : parsedTerms.getBuckets()) {
|
||||||
for (Aggregation subArg : bucket.getAggregations()) {
|
for (Aggregation subArg : bucket.getAggregations()) {
|
||||||
|
String group;
|
||||||
|
if (lineChart.getMetrics().size() > 1) {
|
||||||
|
group = bucket.getKeyAsString() + " - " + getMetricName(lineChart, subArg.getName());
|
||||||
|
} else {
|
||||||
|
group = bucket.getKeyAsString();
|
||||||
|
}
|
||||||
diChartResults.addAll(
|
diChartResults.addAll(
|
||||||
processAggregations(
|
processAggregations(
|
||||||
List.of(subArg),
|
List.of(subArg),
|
||||||
metricFormulaHolderInternal.get(subArg.getName()).formula,
|
metricFormulaHolderInternal.get(subArg.getName()).formula,
|
||||||
bucket.getKeyAsString(),
|
group,
|
||||||
metricFormulaHolderInternal.get(subArg.getName()).holders,
|
metricFormulaHolderInternal.get(subArg.getName()).holders,
|
||||||
getMetricName(lineChart, subArg.getName())));
|
getMetricName(lineChart, subArg.getName())));
|
||||||
}
|
}
|
||||||
@ -165,11 +171,15 @@ public class ElasticSearchLineChartAggregator
|
|||||||
metricFormulaHolder.get(aggregationList.get(i).getName()) == null
|
metricFormulaHolder.get(aggregationList.get(i).getName()) == null
|
||||||
? new MetricFormulaHolder()
|
? new MetricFormulaHolder()
|
||||||
: metricFormulaHolderInternal.get(aggregationList.get(i).getName());
|
: metricFormulaHolderInternal.get(aggregationList.get(i).getName());
|
||||||
|
String group = null;
|
||||||
|
if (lineChart.getMetrics().size() > 1) {
|
||||||
|
group = getMetricName(lineChart, aggregationList.get(i).getName());
|
||||||
|
}
|
||||||
List<DataInsightCustomChartResult> results =
|
List<DataInsightCustomChartResult> results =
|
||||||
processAggregations(
|
processAggregations(
|
||||||
List.of(aggregationList.get(i)),
|
List.of(aggregationList.get(i)),
|
||||||
formulaHolder.formula,
|
formulaHolder.formula,
|
||||||
null,
|
group,
|
||||||
formulaHolder.holders,
|
formulaHolder.holders,
|
||||||
getMetricName(lineChart, aggregationList.get(i).getName()));
|
getMetricName(lineChart, aggregationList.get(i).getName()));
|
||||||
diChartResults.addAll(results);
|
diChartResults.addAll(results);
|
||||||
|
|||||||
@ -316,7 +316,8 @@ public interface OpenSearchDynamicChartAggregatorInterface {
|
|||||||
return new DataInsightCustomChartResult()
|
return new DataInsightCustomChartResult()
|
||||||
.withCount(value)
|
.withCount(value)
|
||||||
.withDay(Double.valueOf(key))
|
.withDay(Double.valueOf(key))
|
||||||
.withGroup(group);
|
.withGroup(group)
|
||||||
|
.withMetric(metric);
|
||||||
return new DataInsightCustomChartResult()
|
return new DataInsightCustomChartResult()
|
||||||
.withCount(value)
|
.withCount(value)
|
||||||
.withGroup(group)
|
.withGroup(group)
|
||||||
|
|||||||
@ -144,11 +144,17 @@ public class OpenSearchLineChartAggregator implements OpenSearchDynamicChartAggr
|
|||||||
ParsedTerms parsedTerms = (ParsedTerms) arg;
|
ParsedTerms parsedTerms = (ParsedTerms) arg;
|
||||||
for (Terms.Bucket bucket : parsedTerms.getBuckets()) {
|
for (Terms.Bucket bucket : parsedTerms.getBuckets()) {
|
||||||
for (Aggregation subArg : bucket.getAggregations()) {
|
for (Aggregation subArg : bucket.getAggregations()) {
|
||||||
|
String group;
|
||||||
|
if (lineChart.getMetrics().size() > 1) {
|
||||||
|
group = bucket.getKeyAsString() + " - " + getMetricName(lineChart, subArg.getName());
|
||||||
|
} else {
|
||||||
|
group = bucket.getKeyAsString();
|
||||||
|
}
|
||||||
diChartResults.addAll(
|
diChartResults.addAll(
|
||||||
processAggregations(
|
processAggregations(
|
||||||
List.of(subArg),
|
List.of(subArg),
|
||||||
metricFormulaHolderInternal.get(subArg.getName()).formula,
|
metricFormulaHolderInternal.get(subArg.getName()).formula,
|
||||||
bucket.getKeyAsString(),
|
group,
|
||||||
metricFormulaHolderInternal.get(subArg.getName()).holders,
|
metricFormulaHolderInternal.get(subArg.getName()).holders,
|
||||||
getMetricName(lineChart, subArg.getName())));
|
getMetricName(lineChart, subArg.getName())));
|
||||||
}
|
}
|
||||||
@ -164,11 +170,15 @@ public class OpenSearchLineChartAggregator implements OpenSearchDynamicChartAggr
|
|||||||
metricFormulaHolderInternal.get(aggregationList.get(i).getName()) == null
|
metricFormulaHolderInternal.get(aggregationList.get(i).getName()) == null
|
||||||
? new MetricFormulaHolder()
|
? new MetricFormulaHolder()
|
||||||
: metricFormulaHolderInternal.get(aggregationList.get(i).getName());
|
: metricFormulaHolderInternal.get(aggregationList.get(i).getName());
|
||||||
|
String group = null;
|
||||||
|
if (lineChart.getMetrics().size() > 1) {
|
||||||
|
group = getMetricName(lineChart, aggregationList.get(i).getName());
|
||||||
|
}
|
||||||
List<DataInsightCustomChartResult> results =
|
List<DataInsightCustomChartResult> results =
|
||||||
processAggregations(
|
processAggregations(
|
||||||
List.of(aggregationList.get(i)),
|
List.of(aggregationList.get(i)),
|
||||||
formulaHolder.formula,
|
formulaHolder.formula,
|
||||||
null,
|
group,
|
||||||
formulaHolder.holders,
|
formulaHolder.holders,
|
||||||
getMetricName(lineChart, aggregationList.get(i).getName()));
|
getMetricName(lineChart, aggregationList.get(i).getName()));
|
||||||
diChartResults.addAll(results);
|
diChartResults.addAll(results);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user