You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@skywalking.apache.org by wu...@apache.org on 2018/06/28 02:39:55 UTC

[incubator-skywalking] branch oap-languages updated: Remove `import`, make the metric pure.

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

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


The following commit(s) were added to refs/heads/oap-languages by this push:
     new c09f579  Remove `import`, make the metric pure.
c09f579 is described below

commit c09f579f684a3c975247f68604f6cc4ad8979bc5
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Thu Jun 28 10:39:49 2018 +0800

    Remove `import`, make the metric pure.
---
 docs/en/OAP/README.md | 27 +++++++++++----------------
 1 file changed, 11 insertions(+), 16 deletions(-)

diff --git a/docs/en/OAP/README.md b/docs/en/OAP/README.md
index 5397e1a..50e9c9c 100644
--- a/docs/en/OAP/README.md
+++ b/docs/en/OAP/README.md
@@ -11,16 +11,14 @@ learn and use.
 ### Grammar
 Scripts should be named as `*.oal`
 ```
-import(SCOPE)
 
-VAR = from(FIELD[, [OTHER_FIELD | 1] *])
+VAR = from(SCOPE.(* | [FIELD][,FIELD ...]))
 [.filter(FIELD OP [INT | STRING])]
-.FUNCTION([PARAM][,OTHER_PARAM]*)
+.FUNCTION([PARAM][, PARAM ...])
 ```
 
 #### Scope
-**SCOPE** in (`All`, `Service`, `ServiceInst`, `Endpoint`), and only can import a single SCOPE.
-Can't and should not aggregate metric on different scope.
+**SCOPE** in (`All`, `Service`, `ServiceInst`, `Endpoint`, `ServiceRelation`, `ServiceRelation`, `EndpointRelation`).
 
 #### Field
 TODO
@@ -47,31 +45,28 @@ All metric data will be grouped by Scope.ID and min-level TimeBucket.
 
 ### Examples
 ```
-import(Endpoint)
-
 // Caculate p99 of both endpoint1 and endpoint2
-endpoint_p99 = from(latency).filter(name in ("endpoint1", "endpoint2")).summary(0.99)
+endpoint_p99 = from(Endpoint.latency).filter(name in ("endpoint1", "endpoint2")).summary(0.99)
 
 // Caculate p99 of endpoint name started with `serv`
-serv_endpoint_p99 = from(latency).filter(name like ("serv%")).summary(0.99)
+serv_endpoint_p99 = from(Endpoint.latency).filter(name like ("serv%")).summary(0.99)
 
 // Caculate the avg response time of each endpoint
-endpoint_avg = from(latency).avg()
+endpoint_avg = from(Endpoint.latency).avg()
 
 // Caculate the histogram of each endpoint by 50 ms steps.
 // Always thermodynamic diagram in UI matches this metric. 
-endpoint_histogram = from(latency).histogram(50)
+endpoint_histogram = from(Endpoint.latency).histogram(50)
 
 // Caculate the percent of response status is true, for each service.
-endpoint_success = from(1).filter(status = "true").percent()
+endpoint_success = from(Endpoint.*).filter(status = "true").percent()
 
 // Caculate the percent of response code in [200, 299], for each service.
-endpoint_200 = from(1).filter(responseCode like "2%").percent()
+endpoint_200 = from(Endpoint.*).filter(responseCode like "2%").percent()
 
 // Caculate the percent of response code in [500, 599], for each service.
-endpoint_500 = from(1).filter(responseCode like "5%").percent()
+endpoint_500 = from(Endpoint.*).filter(responseCode like "5%").percent()
 
 // Caculate the sum of calls for each service.
-endpointCalls = from(1).sum()
-
+endpointCalls = from(Endpoint.*).sum()
 ```
\ No newline at end of file