You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2019/03/25 21:15:14 UTC

[incubator-skywalking] branch oal-deactive updated: Add disable document.

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch oal-deactive
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking.git


The following commit(s) were added to refs/heads/oal-deactive by this push:
     new 971dd4f  Add disable document.
971dd4f is described below

commit 971dd4fb6797af4569e82b13d188077450ec4b2c
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Mon Mar 25 14:15:05 2019 -0700

    Add disable document.
---
 docs/en/concepts-and-designs/oal.md                      | 16 +++++++++++++++-
 .../src/main/resources/official_analysis.oal             |  7 ++++---
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/docs/en/concepts-and-designs/oal.md b/docs/en/concepts-and-designs/oal.md
index e40a40b..cf14916 100644
--- a/docs/en/concepts-and-designs/oal.md
+++ b/docs/en/concepts-and-designs/oal.md
@@ -10,10 +10,13 @@ The OAL scripts will be compiled to normal Java codes in package stage.
 ## Grammar
 Scripts should be named as `*.oal`
 ```
-
+// Declare the metric.
 METRIC_NAME = from(SCOPE.(* | [FIELD][,FIELD ...]))
 [.filter(FIELD OP [INT | STRING])]
 .FUNCTION([PARAM][, PARAM ...])
+
+// Disable hard code 
+disable(METRIC_NAME);
 ```
 
 ## Scope
@@ -67,6 +70,13 @@ All metric data will be grouped by Scope.ID and min-level TimeBucket.
 
 - In `Endpoint` scope, the Scope.ID = Endpoint id (the unique id based on service and its Endpoint)
 
+## Disable
+`Disable` is an advanced statement in OAL, which is only used in certain case.
+Some of the aggregation and metric are defined through core hard codes,
+this `disable` statement is designed for make them de-active,
+such as `segment`, `top_n_database_statement`.
+In default, no one is being disable.
+
 ## Examples
 ```
 // Caculate p99 of both Endpoint1 and Endpoint2
@@ -93,4 +103,8 @@ Endpoint_500 = from(Endpoint.*).filter(responseCode like "5%").percent()
 
 // Caculate the sum of calls for each service.
 EndpointCalls = from(Endpoint.*).sum()
+
+disable(segment);
+disable(endpoint_relation_server_side);
+disable(top_n_database_statement);
 ```
diff --git a/oap-server/generated-analysis/src/main/resources/official_analysis.oal b/oap-server/generated-analysis/src/main/resources/official_analysis.oal
index 3b11ce9..211f296 100644
--- a/oap-server/generated-analysis/src/main/resources/official_analysis.oal
+++ b/oap-server/generated-analysis/src/main/resources/official_analysis.oal
@@ -98,6 +98,7 @@ envoy_total_connections_used = from(EnvoyInstanceMetric.value).filter(metricName
 envoy_parent_connections_used = from(EnvoyInstanceMetric.value).filter(metricName == "server.parent_connections").maxDouble();
 
 // Disable unnecessary hard core sources
-disable(segment);
-disable(endpoint_relation_server_side);
-disable(top_n_database_statement);
\ No newline at end of file
+/////////
+// disable(segment);
+// disable(endpoint_relation_server_side);
+// disable(top_n_database_statement);
\ No newline at end of file