Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C6F40200CAC for ; Fri, 12 May 2017 02:11:57 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C5B13160BCC; Fri, 12 May 2017 00:11:57 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 06131160BCF for ; Fri, 12 May 2017 02:11:56 +0200 (CEST) Received: (qmail 77369 invoked by uid 500); 12 May 2017 00:11:56 -0000 Mailing-List: contact commits-help@beam.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@beam.apache.org Delivered-To: mailing list commits@beam.apache.org Received: (qmail 77031 invoked by uid 99); 12 May 2017 00:11:55 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 May 2017 00:11:55 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A0325E117B; Fri, 12 May 2017 00:11:55 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: altay@apache.org To: commits@beam.apache.org Date: Fri, 12 May 2017 00:12:01 -0000 Message-Id: <9847fa37473742c6ac660caa349c2e82@git.apache.org> In-Reply-To: <350c004faefc4fecb4f6a0d40ff88f35@git.apache.org> References: <350c004faefc4fecb4f6a0d40ff88f35@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [07/19] beam git commit: Add internal comments to metrics archived-at: Fri, 12 May 2017 00:11:58 -0000 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 Authored: Thu May 11 14:50:33 2017 -0700 Committer: Ahmet Altay 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.