[
https://issues.apache.org/jira/browse/BEAM-4553?focusedWorklogId=151711&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-151711
]
ASF GitHub Bot logged work on BEAM-4553:
----------------------------------------
Author: ASF GitHub Bot
Created on: 05/Oct/18 17:06
Start Date: 05/Oct/18 17:06
Worklog Time Spent: 10m
Work Description: aromanenko-dev commented on a change in pull request
#6569: [BEAM-4553] Implement graphite sink for MetricsPusher and refactor
MetricsHttpSink test
URL: https://github.com/apache/beam/pull/6569#discussion_r223072802
##########
File path:
runners/extensions-java/metrics/src/test/java/org/apache/beam/runners/extensions/metrics/CustomMetricQueryResults.java
##########
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beam.runners.extensions.metrics;
+
+import java.util.Collections;
+import java.util.List;
+import org.apache.beam.sdk.metrics.DistributionResult;
+import org.apache.beam.sdk.metrics.GaugeResult;
+import org.apache.beam.sdk.metrics.MetricName;
+import org.apache.beam.sdk.metrics.MetricQueryResults;
+import org.apache.beam.sdk.metrics.MetricResult;
+import org.apache.beam.sdk.metrics.MetricsSink;
+import org.joda.time.Instant;
+
+/** Test class to be used as a input to {@link MetricsSink} implementations
tests. */
+class CustomMetricQueryResults implements MetricQueryResults {
+
+ private final boolean isCommittedSupported;
+
+ CustomMetricQueryResults(boolean isCommittedSupported) {
+ this.isCommittedSupported = isCommittedSupported;
+ }
+
+ @Override
+ public List<MetricResult<Long>> getCounters() {
+ return Collections.singletonList(
+ new MetricResult<Long>() {
+
+ @Override
+ public MetricName getName() {
+ return MetricName.named("ns1", "n1");
+ }
+
+ @Override
+ public String getStep() {
+ return "s1";
+ }
+
+ @Override
+ public Long getCommitted() {
+ if (!isCommittedSupported) {
+ // This is what getCommitted code is like for
AccumulatedMetricResult on runners
+ // that do not support committed metrics
+ throw new UnsupportedOperationException(
+ "This runner does not currently support committed"
+ + " metrics results. Please use 'attempted' instead.");
+ }
+ return 10L;
Review comment:
What this number (and below) means? Is it test values?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 151711)
Time Spent: 1h (was: 50m)
> Implement a Graphite sink for the metrics pusher
> ------------------------------------------------
>
> Key: BEAM-4553
> URL: https://issues.apache.org/jira/browse/BEAM-4553
> Project: Beam
> Issue Type: Sub-task
> Components: runner-extensions-metrics
> Reporter: Etienne Chauchot
> Assignee: Etienne Chauchot
> Priority: Major
> Time Spent: 1h
> Remaining Estimate: 0h
>
> Today only a REST Http sink that sends raw json metrics using POST request to
> a http server is available. It is more a POC sink. It would be good to code
> the first real metrics sink. Some of the most popular is Graphite.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)