You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@nemo.apache.org by GitBox <gi...@apache.org> on 2021/07/28 06:27:23 UTC

[GitHub] [incubator-nemo] Lemarais opened a new pull request #313: [WIP] Recode Metrics associated with stream processing

Lemarais opened a new pull request #313:
URL: https://github.com/apache/incubator-nemo/pull/313


   JIRA: [NEMO-###: TITLE](https://issues.apache.org/jira/projects/NEMO/issues/NEMO-###)
   
   **Major changes:**
   - 
   
   **Minor changes to note:**
   - record the number of processed tuples per task.
   - record the delay of watermark
   
   **Tests for the changes:**
   - 
   
   **Other comments:**
   - 
   
   Closes #GITHUB_PR_NUMBER
   


-- 
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: notifications-unsubscribe@nemo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nemo] sonarcloud[bot] removed a comment on pull request #313: [WIP] Recode Metrics associated with stream processing

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] removed a comment on pull request #313:
URL: https://github.com/apache/incubator-nemo/pull/313#issuecomment-888047511


   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; ![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=CODE_SMELL)
   
   [![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=org.apache.nemo%3Anemo-project&pullRequest=313) No Coverage information  
   [![No Duplication information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/NoDuplicationInfo-16px.png 'No Duplication information')](https://sonarcloud.io/component_measures?id=org.apache.nemo%3Anemo-project&pullRequest=313&metric=duplicated_lines_density&view=list) No Duplication information
   
   


-- 
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: notifications-unsubscribe@nemo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nemo] wonook commented on a change in pull request #313: [WIP] Recode Metrics associated with stream processing

Posted by GitBox <gi...@apache.org>.
wonook commented on a change in pull request #313:
URL: https://github.com/apache/incubator-nemo/pull/313#discussion_r678010909



##########
File path: runtime/common/src/main/java/org/apache/nemo/runtime/common/metric/StreamMetric.java
##########
@@ -0,0 +1,75 @@
+/*
+ * 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.nemo.runtime.common.metric;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.nemo.common.Pair;
+import org.apache.nemo.common.dag.DAG;
+import org.apache.nemo.common.exception.MetricException;
+import org.apache.nemo.common.ir.IRDAG;
+import org.apache.nemo.common.ir.vertex.SourceVertex;
+import org.apache.nemo.runtime.common.plan.Stage;
+import org.apache.nemo.runtime.common.plan.StageEdge;
+import org.apache.nemo.runtime.common.state.PlanState;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Metric associated with stream. it is periodically recorded.
+ */
+public class StreamMetric implements Serializable {
+  private final String id;
+  private long timestamp = -1;
+  private Counter numOfProcessedTuples;
+
+  /**
+   * Constructor with the designated id.
+   *
+   * @param id the id.
+   */
+  public StreamMetric(final String id) {
+    this.id = id;
+    this.numOfProcessedTuples = new Counter();
+  }
+
+  public String getId() {
+    return id;
+  }
+
+  public long getTimestamp() {
+    return timestamp;
+  }
+
+  public Counter getNumOfProcessedTuples() {
+    return numOfProcessedTuples;
+  }
+
+  public void setNumOfProcessedTuples(Counter numOfTuples) {
+    this.numOfProcessedTuples = numOfTuples;
+  }

Review comment:
       Can we also have the bytes number?

##########
File path: runtime/executor/src/main/java/org/apache/nemo/runtime/executor/task/TaskExecutor.java
##########
@@ -102,7 +111,8 @@ public TaskExecutor(final Task task,
                       final IntermediateDataIOFactory intermediateDataIOFactory,
                       final BroadcastManagerWorker broadcastManagerWorker,
                       final MetricMessageSender metricMessageSender,
-                      final PersistentConnectionToMasterMap persistentConnectionToMasterMap) {
+                      final PersistentConnectionToMasterMap persistentConnectionToMasterMap,
+                      final int streamMetricPeriod) {

Review comment:
       streamMetricRecordPeriod?

##########
File path: runtime/executor/src/main/java/org/apache/nemo/runtime/executor/task/TaskExecutor.java
##########
@@ -123,9 +133,28 @@ public TaskExecutor(final Task task,
     this.dataFetchers = pair.left();
     this.sortedHarnesses = pair.right();
 
+    this.streamMetricMap = new HashMap<>();
+    for (final DataFetcher dataFetcher : dataFetchers) {
+      String sourceVertexId = dataFetcher.getDataSource().getId();
+      this.streamMetricMap.put(sourceVertexId, new StreamMetric(sourceVertexId));
+    }
+
+    if (streamMetricPeriod > 0) {
+      this.periodicMetricService = Executors.newScheduledThreadPool(1);
+      this.periodicMetricService.scheduleAtFixedRate(this::saveMetric, 0, streamMetricPeriod, TimeUnit.MILLISECONDS);
+    }
     this.timeSinceLastExecution = System.currentTimeMillis();
   }
 
+  // Send stream metric to the runtime master
+  private void saveMetric() {

Review comment:
       Shouldn't the counter be reset upon every reset, in order to calculate the # of elements per streamMetricPeriod?

##########
File path: runtime/executor/src/main/java/org/apache/nemo/runtime/executor/task/TaskExecutor.java
##########
@@ -123,9 +133,28 @@ public TaskExecutor(final Task task,
     this.dataFetchers = pair.left();
     this.sortedHarnesses = pair.right();
 
+    this.streamMetricMap = new HashMap<>();
+    for (final DataFetcher dataFetcher : dataFetchers) {
+      String sourceVertexId = dataFetcher.getDataSource().getId();
+      this.streamMetricMap.put(sourceVertexId, new StreamMetric(sourceVertexId));
+    }
+
+    if (streamMetricPeriod > 0) {
+      this.periodicMetricService = Executors.newScheduledThreadPool(1);
+      this.periodicMetricService.scheduleAtFixedRate(this::saveMetric, 0, streamMetricPeriod, TimeUnit.MILLISECONDS);
+    }
     this.timeSinceLastExecution = System.currentTimeMillis();
   }
 
+  // Send stream metric to the runtime master
+  private void saveMetric() {

Review comment:
       Also, I think the name should be `saveStreamMetric()`




-- 
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: notifications-unsubscribe@nemo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nemo] sonarcloud[bot] commented on pull request #313: [WIP] Recode Metrics associated with stream processing

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #313:
URL: https://github.com/apache/incubator-nemo/pull/313#issuecomment-888047511


   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; ![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=CODE_SMELL)
   
   [![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=org.apache.nemo%3Anemo-project&pullRequest=313) No Coverage information  
   [![No Duplication information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/NoDuplicationInfo-16px.png 'No Duplication information')](https://sonarcloud.io/component_measures?id=org.apache.nemo%3Anemo-project&pullRequest=313&metric=duplicated_lines_density&view=list) No Duplication information
   
   


-- 
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: notifications-unsubscribe@nemo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nemo] sonarcloud[bot] commented on pull request #313: [WIP] Recode Metrics associated with stream processing

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #313:
URL: https://github.com/apache/incubator-nemo/pull/313#issuecomment-894837330


   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; ![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=org.apache.nemo%3Anemo-project&pullRequest=313&resolved=false&types=CODE_SMELL)
   
   [![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=org.apache.nemo%3Anemo-project&pullRequest=313) No Coverage information  
   [![No Duplication information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/NoDuplicationInfo-16px.png 'No Duplication information')](https://sonarcloud.io/component_measures?id=org.apache.nemo%3Anemo-project&pullRequest=313&metric=duplicated_lines_density&view=list) No Duplication information
   
   


-- 
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: notifications-unsubscribe@nemo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nemo] Lemarais closed pull request #313: [WIP] Recode Metrics associated with stream processing

Posted by GitBox <gi...@apache.org>.
Lemarais closed pull request #313:
URL: https://github.com/apache/incubator-nemo/pull/313


   


-- 
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: notifications-unsubscribe@nemo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org