RocMarshal commented on a change in pull request #17902:
URL: https://github.com/apache/flink/pull/17902#discussion_r758396469
##########
File path: docs/content.zh/docs/ops/metrics.md
##########
@@ -28,26 +28,26 @@ under the License.
# 指标
-Flink exposes a metric system that allows gathering and exposing metrics to
external systems.
+Flink 公开了一个指标系统,允许收集和公开指标给外部系统。
-## Registering metrics
+## 注册指标
-You can access the metric system from any user function that extends
[RichFunction]({{< ref "docs/dev/datastream/user_defined_functions"
>}}#rich-functions) by calling `getRuntimeContext().getMetricGroup()`.
-This method returns a `MetricGroup` object on which you can create and
register new metrics.
+你可以通过调用从 [RichFunction]({{< ref "docs/dev/datastream/user_defined_functions"
>}}#rich-functions)
Review comment:
```suggestion
你可以通过调用任意继承 [RichFunction]({{< ref
"docs/dev/datastream/user_defined_functions" >}}#rich-functions)
```
##########
File path: docs/content.zh/docs/ops/metrics.md
##########
@@ -28,26 +28,26 @@ under the License.
# 指标
-Flink exposes a metric system that allows gathering and exposing metrics to
external systems.
+Flink 公开了一个指标系统,允许收集和公开指标给外部系统。
-## Registering metrics
+## 注册指标
-You can access the metric system from any user function that extends
[RichFunction]({{< ref "docs/dev/datastream/user_defined_functions"
>}}#rich-functions) by calling `getRuntimeContext().getMetricGroup()`.
-This method returns a `MetricGroup` object on which you can create and
register new metrics.
+你可以通过调用从 [RichFunction]({{< ref "docs/dev/datastream/user_defined_functions"
>}}#rich-functions)
+扩展的任何用户函数的 `getRuntimeContext().getMetricGroup()` 方法访问指标系统。
Review comment:
```suggestion
的用户函数 `getRuntimeContext().getMetricGroup()` 方法访问指标系统。
```
Only minor comment.
##########
File path: docs/content.zh/docs/ops/metrics.md
##########
@@ -28,26 +28,26 @@ under the License.
# 指标
-Flink exposes a metric system that allows gathering and exposing metrics to
external systems.
+Flink 公开了一个指标系统,允许收集和公开指标给外部系统。
-## Registering metrics
+## 注册指标
Review comment:
missing link tag ?
The same case should be noted below.
##########
File path: docs/content.zh/docs/ops/metrics.md
##########
@@ -188,17 +177,16 @@ new class MyMapper extends RichMapFunction[String,String]
{
value
}
}
-
```
{{< /tab >}}
{{< /tabs >}}
-Note that reporters will turn the exposed object into a `String`, which means
that a meaningful `toString()` implementation is required.
+请注意报告会将暴露的对象变成字符串,这意味着实现类需要一个有意义的 `toString()` 方法。
-#### Histogram
+### 直方图 Histogram
-A `Histogram` measures the distribution of long values.
-You can register one by calling `histogram(String name, Histogram histogram)`
on a `MetricGroup`.
+直方图 `Histogram` 测量长值的分布。
Review comment:
Maybe you could do it in a better way.
##########
File path: docs/content.zh/docs/ops/metrics.md
##########
@@ -238,13 +225,13 @@ class MyMapper extends RichMapFunction[Long,Long] {
value
}
}
-
```
{{< /tab >}}
{{< /tabs >}}
-Flink does not provide a default implementation for `Histogram`, but offers a
{{< gh_link
file="flink-metrics/flink-metrics-dropwizard/src/main/java/org/apache/flink/dropwizard/metrics/DropwizardHistogramWrapper.java"
name="Wrapper" >}} that allows usage of Codahale/DropWizard histograms.
-To use this wrapper add the following dependency in your `pom.xml`:
+Flink 没有为直方图提供默认的实现类,但提供了允许使用 Codahale/DropWizard 直方图的
+{{<gh_link
file="flink-metrics/flink-metrics-dropwizard/src/main/java/org/apache/flink/dropwizard/metrics/DropwizardHistogramWrapper.java"
name="Wrapper">}}。
+要使用此包装类,请在你的 `pom.xml` 中添加依赖:
Review comment:
```suggestion
如果要使用此包装类,请在你的 `pom.xml` 中添加如下依赖:
```
##########
File path: docs/content.zh/docs/ops/metrics.md
##########
@@ -347,13 +331,15 @@ class MyMapper extends RichMapFunction[Long,Long] {
value
}
}
-
```
{{< /tab >}}
{{< /tabs >}}
-Flink offers a {{< gh_link
file="flink-metrics/flink-metrics-dropwizard/src/main/java/org/apache/flink/dropwizard/metrics/DropwizardMeterWrapper.java"
name="Wrapper" >}} that allows usage of Codahale/DropWizard meters.
-To use this wrapper add the following dependency in your `pom.xml`:
+Flink 提供了一个
+{{<gh_link
file="flink-metrics/flink-metrics-dropwizard/src/main/java/org/apache/flink/dropwizard/metrics/DropwizardMeterWrapper.java"
name="Wrapper">}}
+,允许使用 Codahale/DropWizard 仪表。
+要使用此仪表,请在你的 `pom.xml` 中添加:
Review comment:
Same as mentioned above.
##########
File path: docs/content.zh/docs/ops/metrics.md
##########
@@ -28,26 +28,26 @@ under the License.
# 指标
-Flink exposes a metric system that allows gathering and exposing metrics to
external systems.
+Flink 公开了一个指标系统,允许收集和公开指标给外部系统。
-## Registering metrics
+## 注册指标
-You can access the metric system from any user function that extends
[RichFunction]({{< ref "docs/dev/datastream/user_defined_functions"
>}}#rich-functions) by calling `getRuntimeContext().getMetricGroup()`.
-This method returns a `MetricGroup` object on which you can create and
register new metrics.
+你可以通过调用从 [RichFunction]({{< ref "docs/dev/datastream/user_defined_functions"
>}}#rich-functions)
+扩展的任何用户函数的 `getRuntimeContext().getMetricGroup()` 方法访问指标系统。
+此方法返回一个 `MetricGroup` 对象,你可以在该对象上创建和注册新指标。
-### Metric types
+## 指标类型
-Flink supports `Counters`, `Gauges`, `Histograms` and `Meters`.
+Flink 支持计数器 `Counters`,量表 `Gauges`,直方图 `Histogram` 和仪表 `Meters`。
-#### Counter
+### 计数器 Counter
-A `Counter` is used to count something. The current value can be in- or
decremented using `inc()/inc(long n)` or `dec()/dec(long n)`.
-You can create and register a `Counter` by calling `counter(String name)` on a
`MetricGroup`.
+计数器 `Counter` 用于计算。当前值可以使用 `inc()/inc(long n)` 递增或使用 `dec()/dec(long n)`
递减。你可以在
Review comment:
```suggestion
计数器 `Counter` 用于计数。当前值可以使用 `inc()/inc(long n)` 增加计数值或使用 `dec()/dec(long n)`
减小计数值。你可以在
```
##########
File path: docs/content.zh/docs/ops/metrics.md
##########
@@ -28,26 +28,26 @@ under the License.
# 指标
-Flink exposes a metric system that allows gathering and exposing metrics to
external systems.
+Flink 公开了一个指标系统,允许收集和公开指标给外部系统。
-## Registering metrics
+## 注册指标
-You can access the metric system from any user function that extends
[RichFunction]({{< ref "docs/dev/datastream/user_defined_functions"
>}}#rich-functions) by calling `getRuntimeContext().getMetricGroup()`.
-This method returns a `MetricGroup` object on which you can create and
register new metrics.
+你可以通过调用从 [RichFunction]({{< ref "docs/dev/datastream/user_defined_functions"
>}}#rich-functions)
+扩展的任何用户函数的 `getRuntimeContext().getMetricGroup()` 方法访问指标系统。
+此方法返回一个 `MetricGroup` 对象,你可以在该对象上创建和注册新指标。
-### Metric types
+## 指标类型
-Flink supports `Counters`, `Gauges`, `Histograms` and `Meters`.
+Flink 支持计数器 `Counters`,量表 `Gauges`,直方图 `Histogram` 和仪表 `Meters`。
Review comment:
计数器,量表,直方图 和仪表 -> What about keeping original content?
##########
File path: docs/content.zh/docs/ops/metrics.md
##########
@@ -28,26 +28,26 @@ under the License.
# 指标
-Flink exposes a metric system that allows gathering and exposing metrics to
external systems.
+Flink 公开了一个指标系统,允许收集和公开指标给外部系统。
-## Registering metrics
+## 注册指标
-You can access the metric system from any user function that extends
[RichFunction]({{< ref "docs/dev/datastream/user_defined_functions"
>}}#rich-functions) by calling `getRuntimeContext().getMetricGroup()`.
-This method returns a `MetricGroup` object on which you can create and
register new metrics.
+你可以通过调用从 [RichFunction]({{< ref "docs/dev/datastream/user_defined_functions"
>}}#rich-functions)
+扩展的任何用户函数的 `getRuntimeContext().getMetricGroup()` 方法访问指标系统。
+此方法返回一个 `MetricGroup` 对象,你可以在该对象上创建和注册新指标。
-### Metric types
+## 指标类型
Review comment:
reduce a '#' ?
Could you give a explain for the chage ?
Glad to see the reason.
##########
File path: docs/content.zh/docs/ops/metrics.md
##########
@@ -299,15 +285,14 @@ class MyMapper extends RichMapFunction[Long, Long] {
value
}
}
-
```
{{< /tab >}}
{{< /tabs >}}
-#### Meter
+### 仪表 Meter
-A `Meter` measures an average throughput. An occurrence of an event can be
registered with the `markEvent()` method. Occurrence of multiple events at the
same time can be registered with `markEvent(long n)` method.
-You can register a meter by calling `meter(String name, Meter meter)` on a
`MetricGroup`.
+仪表 `Meter` 测量的是平均吞吐量。一个事件的发生率可以用 `markEvent()` 方法来注册。多个事件的发生率可以用
`markEvent(long n)` 方法注册。
Review comment:
Here's a little odd.
You would consider free translation, not just literal translation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]