You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by al...@apache.org on 2017/05/12 00:12:01 UTC
[07/19] beam git commit: Add internal comments to metrics
Add internal comments to metrics
Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/a6543abb
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/a6543abb
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/a6543abb
Branch: refs/heads/release-2.0.0
Commit: a6543abb37e65fe6c7afcaf3ea670c75aee1f7d0
Parents: 6d02da0
Author: Ahmet Altay <al...@google.com>
Authored: Thu May 11 14:50:33 2017 -0700
Committer: Ahmet Altay <al...@google.com>
Committed: Thu May 11 16:20:36 2017 -0700
----------------------------------------------------------------------
sdks/python/apache_beam/metrics/__init__.py | 1 +
sdks/python/apache_beam/metrics/cells.py | 2 ++
sdks/python/apache_beam/metrics/execution.py | 6 ++----
sdks/python/apache_beam/metrics/metric.py | 4 ++++
sdks/python/apache_beam/metrics/metricbase.py | 2 ++
5 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/beam/blob/a6543abb/sdks/python/apache_beam/metrics/__init__.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/metrics/__init__.py b/sdks/python/apache_beam/metrics/__init__.py
index 164d1a8..8ce7bbb 100644
--- a/sdks/python/apache_beam/metrics/__init__.py
+++ b/sdks/python/apache_beam/metrics/__init__.py
@@ -15,3 +15,4 @@
# limitations under the License.
#
from apache_beam.metrics.metric import Metrics
+from apache_beam.metrics.metric import MetricsFilter
http://git-wip-us.apache.org/repos/asf/beam/blob/a6543abb/sdks/python/apache_beam/metrics/cells.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/metrics/cells.py b/sdks/python/apache_beam/metrics/cells.py
index fbe3ad3..ba840f7 100644
--- a/sdks/python/apache_beam/metrics/cells.py
+++ b/sdks/python/apache_beam/metrics/cells.py
@@ -29,6 +29,8 @@ import threading
from apache_beam.metrics.metricbase import Counter
from apache_beam.metrics.metricbase import Distribution
+__all__ = ['DistributionResult']
+
class CellCommitState(object):
"""For internal use only; no backwards-compatibility guarantees.
http://git-wip-us.apache.org/repos/asf/beam/blob/a6543abb/sdks/python/apache_beam/metrics/execution.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/metrics/execution.py b/sdks/python/apache_beam/metrics/execution.py
index a06ec0c..675e49c 100644
--- a/sdks/python/apache_beam/metrics/execution.py
+++ b/sdks/python/apache_beam/metrics/execution.py
@@ -24,7 +24,7 @@ Available classes:
- MetricKey - Internal key for a metric.
- MetricResult - Current status of a metric's updates/commits.
-- MetricsEnvironment - Keeps track of MetricsContainer and other metrics
+- _MetricsEnvironment - Keeps track of MetricsContainer and other metrics
information for every single execution working thread.
- MetricsContainer - Holds the metrics of a single step and a single
unit-of-commit (bundle).
@@ -36,9 +36,7 @@ from apache_beam.metrics.cells import CounterCell, DistributionCell
class MetricKey(object):
- """
-
- Key used to identify instance of metric cell.
+ """Key used to identify instance of metric cell.
Metrics are internally keyed by the step name they associated with and
the name of the metric.
http://git-wip-us.apache.org/repos/asf/beam/blob/a6543abb/sdks/python/apache_beam/metrics/metric.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/metrics/metric.py b/sdks/python/apache_beam/metrics/metric.py
index 33db4e1..f99c0c4 100644
--- a/sdks/python/apache_beam/metrics/metric.py
+++ b/sdks/python/apache_beam/metrics/metric.py
@@ -30,6 +30,8 @@ from apache_beam.metrics.execution import MetricsEnvironment
from apache_beam.metrics.metricbase import Counter, Distribution
from apache_beam.metrics.metricbase import MetricName
+__all__ = ['Metrics', 'MetricsFilter']
+
class Metrics(object):
"""Lets users create/access metric objects during pipeline execution."""
@@ -146,6 +148,8 @@ class MetricResults(object):
class MetricsFilter(object):
"""Simple object to filter metrics results.
+ This class is experimental. No backwards-compatibility guarantees.
+
If filters by matching a result's step-namespace-name with three internal
sets. No execution/matching logic is added to this object, so that it may
be used to construct arguments as an RPC request. It is left for runners
http://git-wip-us.apache.org/repos/asf/beam/blob/a6543abb/sdks/python/apache_beam/metrics/metricbase.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/metrics/metricbase.py b/sdks/python/apache_beam/metrics/metricbase.py
index fa0ca75..699f29c 100644
--- a/sdks/python/apache_beam/metrics/metricbase.py
+++ b/sdks/python/apache_beam/metrics/metricbase.py
@@ -30,6 +30,8 @@ Available classes:
- MetricName - Namespace and name used to refer to a Metric.
"""
+__all__ = ['Metric', 'Counter', 'Distribution', 'MetricName']
+
class MetricName(object):
"""The name of a metric.