mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-02 11:39:12 +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()
|
||||
.withCount(value)
|
||||
.withDay(Double.valueOf(key))
|
||||
.withGroup(group);
|
||||
.withGroup(group)
|
||||
.withMetric(metric);
|
||||
return new DataInsightCustomChartResult()
|
||||
.withCount(value)
|
||||
.withGroup(group)
|
||||
|
||||
@ -145,11 +145,17 @@ public class ElasticSearchLineChartAggregator
|
||||
ParsedTerms parsedTerms = (ParsedTerms) arg;
|
||||
for (Terms.Bucket bucket : parsedTerms.getBuckets()) {
|
||||
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(
|
||||
processAggregations(
|
||||
List.of(subArg),
|
||||
metricFormulaHolderInternal.get(subArg.getName()).formula,
|
||||
bucket.getKeyAsString(),
|
||||
group,
|
||||
metricFormulaHolderInternal.get(subArg.getName()).holders,
|
||||
getMetricName(lineChart, subArg.getName())));
|
||||
}
|
||||
@ -165,11 +171,15 @@ public class ElasticSearchLineChartAggregator
|
||||
metricFormulaHolder.get(aggregationList.get(i).getName()) == null
|
||||
? new MetricFormulaHolder()
|
||||
: metricFormulaHolderInternal.get(aggregationList.get(i).getName());
|
||||
String group = null;
|
||||
if (lineChart.getMetrics().size() > 1) {
|
||||
group = getMetricName(lineChart, aggregationList.get(i).getName());
|
||||
}
|
||||
List<DataInsightCustomChartResult> results =
|
||||
processAggregations(
|
||||
List.of(aggregationList.get(i)),
|
||||
formulaHolder.formula,
|
||||
null,
|
||||
group,
|
||||
formulaHolder.holders,
|
||||
getMetricName(lineChart, aggregationList.get(i).getName()));
|
||||
diChartResults.addAll(results);
|
||||
|
||||
@ -316,7 +316,8 @@ public interface OpenSearchDynamicChartAggregatorInterface {
|
||||
return new DataInsightCustomChartResult()
|
||||
.withCount(value)
|
||||
.withDay(Double.valueOf(key))
|
||||
.withGroup(group);
|
||||
.withGroup(group)
|
||||
.withMetric(metric);
|
||||
return new DataInsightCustomChartResult()
|
||||
.withCount(value)
|
||||
.withGroup(group)
|
||||
|
||||
@ -144,11 +144,17 @@ public class OpenSearchLineChartAggregator implements OpenSearchDynamicChartAggr
|
||||
ParsedTerms parsedTerms = (ParsedTerms) arg;
|
||||
for (Terms.Bucket bucket : parsedTerms.getBuckets()) {
|
||||
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(
|
||||
processAggregations(
|
||||
List.of(subArg),
|
||||
metricFormulaHolderInternal.get(subArg.getName()).formula,
|
||||
bucket.getKeyAsString(),
|
||||
group,
|
||||
metricFormulaHolderInternal.get(subArg.getName()).holders,
|
||||
getMetricName(lineChart, subArg.getName())));
|
||||
}
|
||||
@ -164,11 +170,15 @@ public class OpenSearchLineChartAggregator implements OpenSearchDynamicChartAggr
|
||||
metricFormulaHolderInternal.get(aggregationList.get(i).getName()) == null
|
||||
? new MetricFormulaHolder()
|
||||
: metricFormulaHolderInternal.get(aggregationList.get(i).getName());
|
||||
String group = null;
|
||||
if (lineChart.getMetrics().size() > 1) {
|
||||
group = getMetricName(lineChart, aggregationList.get(i).getName());
|
||||
}
|
||||
List<DataInsightCustomChartResult> results =
|
||||
processAggregations(
|
||||
List.of(aggregationList.get(i)),
|
||||
formulaHolder.formula,
|
||||
null,
|
||||
group,
|
||||
formulaHolder.holders,
|
||||
getMetricName(lineChart, aggregationList.get(i).getName()));
|
||||
diChartResults.addAll(results);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user