This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/incubator-skywalking-oal-tool.git
The following commit(s) were added to refs/heads/master by this push:
new 1e5132e Fix format and add Pxx for global
1e5132e is described below
commit 1e5132e177bff3dd9970bb547710d62f7b8bba07
Author: Wu Sheng <[email protected]>
AuthorDate: Tue Sep 11 11:02:53 2018 +0800
Fix format and add Pxx for global
---
.../src/main/resources/code-templates/AllDispatcherTemplate.ftl | 2 +-
.../src/main/resources/code-templates/IndicatorImplementor.ftl | 7 +++++++
oal-parser/src/test/resources/oal_test.oal | 4 ++++
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git
a/oal-parser/src/main/resources/code-templates/AllDispatcherTemplate.ftl
b/oal-parser/src/main/resources/code-templates/AllDispatcherTemplate.ftl
index 2893041..d821002 100644
--- a/oal-parser/src/main/resources/code-templates/AllDispatcherTemplate.ftl
+++ b/oal-parser/src/main/resources/code-templates/AllDispatcherTemplate.ftl
@@ -44,7 +44,7 @@ public class AllDispatcher implements SourceDispatcher<All> {
<#list allIndicators as indicator>
private void do${indicator.metricName}(All source) {
- ${indicator.metricName}Indicator indicator = new
${indicator.metricName}Indicator();
+ ${indicator.metricName}Indicator indicator = new
${indicator.metricName}Indicator();
<#if indicator.filterExpressions??>
<#list indicator.filterExpressions as filterExpression>
diff --git
a/oal-parser/src/main/resources/code-templates/IndicatorImplementor.ftl
b/oal-parser/src/main/resources/code-templates/IndicatorImplementor.ftl
index 333713e..b88024c 100644
--- a/oal-parser/src/main/resources/code-templates/IndicatorImplementor.ftl
+++ b/oal-parser/src/main/resources/code-templates/IndicatorImplementor.ftl
@@ -19,8 +19,15 @@
package
org.apache.skywalking.oap.server.core.analysis.generated.${packageName};
import java.util.*;
+<#if (fieldsFromSource?size>0) >
import lombok.*;
+</#if>
+<#list fieldsFromSource as sourceField>
+ <#if sourceField.isID()>
import org.apache.skywalking.oap.server.core.Const;
+ <#break>
+ </#if>
+</#list>
import org.apache.skywalking.oap.server.core.alarm.AlarmMeta;
import org.apache.skywalking.oap.server.core.alarm.AlarmSupported;
import org.apache.skywalking.oap.server.core.analysis.indicator.*;
diff --git a/oal-parser/src/test/resources/oal_test.oal
b/oal-parser/src/test/resources/oal_test.oal
index 22e4347..17634d2 100644
--- a/oal-parser/src/test/resources/oal_test.oal
+++ b/oal-parser/src/test/resources/oal_test.oal
@@ -17,6 +17,10 @@
*/
All_p99 = from(All.latency).p99(10);
+All_p95 = from(All.latency).p95(10);
+All_p90 = from(All.latency).p90(10);
+All_p75 = from(All.latency).p75(10);
+All_p50 = from(All.latency).p50(10);
Service_Avg = from(Service.latency).longAvg();