You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2018/08/27 09:02:23 UTC

[incubator-servicecomb-docs] 03/05: update java-chassis-reference/en_US/general-development/metrics.md

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

liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-docs.git

commit 4aae6e377372d32c43ea1acff77989986eeee3f8
Author: DeanLee <li...@huawei.com>
AuthorDate: Mon Aug 27 11:22:18 2018 +0800

    update java-chassis-reference/en_US/general-development/metrics.md
---
 .../en_US/general-development/metrics.md           | 98 ++++++++++------------
 1 file changed, 46 insertions(+), 52 deletions(-)

diff --git a/java-chassis-reference/en_US/general-development/metrics.md b/java-chassis-reference/en_US/general-development/metrics.md
old mode 100644
new mode 100755
index 5efab37..b9e3883
--- a/java-chassis-reference/en_US/general-development/metrics.md
+++ b/java-chassis-reference/en_US/general-development/metrics.md
@@ -1,51 +1,51 @@
-# 一、Metrics介绍
+# First, the introduction of Metrics
 
 ![](/assets/metrics/logicDiagram.png)
 
-1. 基于[netflix spectator](https://github.com/Netflix/spectator)
-2. Foundation-metrics通过SPI机制加载所有MetricsInitializer实现,实现者可以通过MetricsInitializer中的getOrder规划执行顺序,order数字越小,越先执行。
-3. Metrics-core实现3类MetricsInitializer:
-   1. DefaultRegistryInitializer: 实例化并注册spectator-reg-servo,设置较小的order,保证比下面2类MetricsInitializer先执行
-   2. Meters Initializer: 实现TPS、时延、线程池、jvm资源等等数据的统计
-   3. Publisher: 输出统计结果,内置了日志输出,以及通过RESTful接口输出
-4. Metrics-prometheus提供与prometheus对接的能力
+1. Based on [netflix spectator](https://github.com/Netflix/spectator)
+2. Foundation-metrics loads all MetricsInitializer implementations via the SPI mechanism. Implementers can use the getOrder in the MetricsInitializer to plan the execution order. The smaller the order number, the earlier it will be executed.
+3. Metrics-core implements 3 types of MetricsInitializer:
+  1. DefaultRegistryInitializer: Instantiate and register spectator-reg-servo, set a smaller order, and ensure that it is executed before the following two types of MetricsInitializer
+  2. Meters Initializer: Statistics of data such as TPS, delay, thread pool, jvm resources, etc.
+  3. Publisher: Output statistics, built-in log output, and output via RESTful interface
+  4. Metrics-prometheus provides the ability to interface with prometheus
 
-# 二、统计项汇总
+# Second, the summary of statistical items
 <table border="1" style="font-size: 8px">
   <tr>
     <th>Name</th>
     <th>Tag keys</th>
     <th>Tag values</th>
-    <th style="min-width: 450px">含义</th>
+    <th style="min-width: 450px">meaning</th>
   </tr>
   <tr>
     <td rowspan="11">servicecomb.invocation</td>
     <td>role</td>
     <td>CONSUMER、PRODUCER</td>
-    <td>是CONSUMER还是PRODUCER端的统计</td>
+    <td>Is the CONSUMER or the statistics of the PRODUCER side?</td>
   </tr>
   <tr>
     <td>operation</td>
     <td>${microserviceName}.${schemaId}.${operationName}</td>
-    <td>调用的方法名</td>
+    <td>Method name</td>
   </tr>
   <tr>
     <td>transport</td>
-    <td>highway或rest</td>
-    <td>调用是在哪个传输通道上发生的</td>
+    <td>highway or rest</td>
+    <td>On which transmission channel the call occurs</td>
   </tr>
   <tr>
     <td rowspan="3">stage</td>
     <td>total</td>
-    <td>全流程的统计</td>
+    <td>Full process statistics</td>
   </tr>
   <tr>
     <td>queue</td>
-    <td>仅在producer端使用线程池时有意义表示调用在producer线程池中排队的统计</td>
+    <td>It only makes sense to call the statistics queued in the producer thread pool when using the thread pool on the producer side.</td>
   </tr>
   <tr>
     <td>execution</td>
-    <td>仅在producer端有意义表示业务逻辑执行的统计</td>
+    <td>Statistically representing the execution of business logic only on the producer side</td>
   </tr>
   <tr>
     <td>status</td>
@@ -55,55 +55,54 @@
   <tr>
     <td rowspan="4">statistic</td>
     <td>count</td>
-    <td>平均每秒调用次数,即TPS<br>count=统计周期内的调用次数/周期(秒)</td>
+    <td>Average number of calls per second, ie TPS<br>count=Number of calls/cycles in the statistical period (seconds)</td>
   </tr>
   <tr>
     <td>totalAmount</td>
-    <td>单位为秒<br>totalAmount=统计周期内的调用耗时总时长/周期(秒)<br>totalAmount除以count即可得到平均时延</td>
+    <td> in seconds<br>totalAmount=Total timeout/cycle (in seconds) for calls in the statistical period<br>totalAmount divided by count to get the average delay</td>
   </tr>
   <tr>
     <td>totalOfSquares </td>
-    <td>totalOfSquares=统计周期内的每一个调用耗时的平方之和/周期(秒)</td>
+    <td>totalOfSquares=sum of squares of each call in the statistical period/cycle (seconds)</td>
   </tr>
   <tr>
     <td>max</td>
-    <td>统计周期内最大的调用耗时,单位为秒</td>
+    <td>The maximum call time in the statistical period, in seconds</td>
   </tr>
   <tr>
     <td>threadpool.taskCount</td>
     <td rowspan="7">id</td>
     <td rowspan="7">${threadPoolName}</td>
-    <td>统计周期内平均每秒提交的任务数<br>taskCount=(completed + queue + active)/周期(秒)</td>
+    <td>Average number of tasks submitted per second during the statistical period<br>taskCount=(completed + queue + active)/period (seconds)</td>
   </tr>
   <tr>
     <td>threadpool.completedTaskCount </td>
-    <td>统计周期内平均每秒完成的任务数<br>completedTaskCount=completed/周期(秒)</td>
+    <td>The average number of tasks completed per second during the statistical period<br>completedTaskCount=completed/cycle (seconds)</td>
   </tr>
   <tr>
     <td>threadpool.currentThreadsBusy </td>
-    <td>当前的活动线程数,即当前正在执行的任务数</td>
-  </tr>
+    <td>The current number of active threads, ie the number of tasks currently being executed</td>
   <tr>
     <td>threadpool.maxThreads </td>
-    <td>最大允许的线程数</td>
+    <td>Maximum number of threads allowed</td>
   </tr>
   <tr>
     <td>threadpool.poolSize </td>
-    <td>当前实际线程数</td>
+    <td>The current actual number of threads</td>
   </tr>
   <tr>
     <td>threadpool.corePoolSize  </td>
-    <td>最小线程数</td>
+    <td>Minimum number of threads</td>
   </tr>
   <tr>
     <td>threadpool.queueSize </td>
-    <td>当前正在排队的任务数</td>
+    <td>Number of tasks currently queued</td>
   </tr>
 </table>
 
-# 三、使用方法
+# Third, how to use.
 
-1.Maven依赖
+1.Maven dependence.
 
 ```
 <dependency>
@@ -113,18 +112,18 @@
 </dependency>
 ```
 
-_注:请将version字段修改为实际版本号;如果版本号已经在dependencyManagement中声明,则这里不必写版本号_
+_Note: Please change the version field to the actual version number; if the version number has been declared in the dependencyManagement, then you do not have to write the version number here_
 
-2.配置说明
+2. Configuration instructions
 
-| 配置项 | 默认值 | 含义 |
+| Configuration Item | Default | Meaning |
 | :--- | :--- | :--- |
-| Servicecomb.metrics.window\_time | 60000 | 统计周期,单位为毫秒TPS、时延等等周期性的数据,每周期更新一次,在周期内获取到的值,实际是上一周期的值 |
-| servicecomb.metrics.publisher.defaultLog.enabled | false | 是否输出默认的统计日志 |
+| Servicecomb.metrics.window\_time | 60000 | Statistical period, in milliseconds TPS, delay, etc. Periodic data, updated once per cycle, the value obtained in the cycle, actually the value of the previous cycle |
+| servicecomb.metrics.publisher.defaultLog.enabled | false | Whether to output the default statistics log |
 
-3.通过RESTful访问
-只要微服务开放了rest端口,则使用浏览器访问http://ip:port/metrics 即可,
-将会得到下面格式的json数据:
+3. Access via RESTful
+As long as the microservices open the rest port, use a browser to access http://ip:port/metrics.
+will get json data in the following format:
 
 ```
 {
@@ -174,20 +173,15 @@ _注:请将version字段修改为实际版本号;如果版本号已经在dep
 ```
 
 
-# 四、业务定制
-
-因为ServiceComb已经初始化了servo的registry,所以业务不必再创建registry
-
-实现MetricsInitializer接口,定义业务级的Meters,或实现定制的Publisher,再通过SPI机制声明自己的实现即可。
-
-1.Meters:  
-  创建Meters能力均由spectator提供,可查阅[netflix spectator](https://github.com/Netflix/spectator)文档
-  
-2.Publisher:
-周期性输出的场景,比如日志场景,通过eventBus订阅org.apache.servicecomb.foundation.metrics.PolledEvent,PolledEvent.getMeters()即是本周期的统计结果
-非周期性输出的场景,比如通过RESTful接口访问,通过globalRegistry.iterator()即可得到本周期的统计结果
-
+# Fourth, business customization
 
+Because ServiceComb has initialized the registry's registry, the business no longer has to create a registry.
 
+Implement the MetricsInitializer interface, define the business-level Meters, or implement a custom Publisher, and then declare your implementation through the SPI mechanism.
 
+1.Meters:
+Creating Meters capabilities is provided by spectator, available in the [netflix spectator] (https://github.com/Netflix/spectator) documentation
 
+2.Publisher:
+Periodically output scenarios, such as log scenarios, subscribe to org.apache.servicecomb.foundation.metrics.PolledEvent via eventBus, PolledEvent.getMeters() is the statistical result of this cycle.
+Non-periodic output scenarios, such as access through the RESTful interface, the statistical results of this cycle can be obtained through globalRegistry.iterator()