use of com.linkedin.thirdeye.datalayer.bao.MetricConfigManager in project pinot by linkedin.
the class ThirdEyeUtils method substituteMetricIdsForMetrics.
// TODO: Write parser instead of looking for occurrence of every metric
public static String substituteMetricIdsForMetrics(String metricExpression, String dataset) {
MetricConfigManager metricConfigDAO = DAO_REGISTRY.getMetricConfigDAO();
List<MetricConfigDTO> metricConfigs = metricConfigDAO.findByDataset(dataset);
for (MetricConfigDTO metricConfig : metricConfigs) {
if (metricConfig.isDerived()) {
continue;
}
String metricName = metricConfig.getName();
metricExpression = metricExpression.replaceAll(metricName, MetricConfigBean.DERIVED_METRIC_ID_PREFIX + metricConfig.getId());
}
return metricExpression;
}
Aggregations