This is an automated email from the ASF dual-hosted git repository.

huijun pushed a commit to branch huijunw/healthmgrmetrics
in repository https://gitbox.apache.org/repos/asf/incubator-heron.git


The following commit(s) were added to refs/heads/huijunw/healthmgrmetrics by 
this push:
     new 3d2caea  rename metricsPublisher
3d2caea is described below

commit 3d2caea69f54a8eecdc834c701fbe77a1fef8808
Author: Huijun Wu <huij...@twitter.com>
AuthorDate: Thu Apr 12 15:02:04 2018 -0700

    rename metricsPublisher
---
 .../src/java/org/apache/heron/healthmgr/HealthManager.java   | 12 ++++++------
 .../heron/healthmgr/detectors/BackPressureDetector.java      |  8 ++++----
 .../heron/healthmgr/diagnosers/SlowInstanceDiagnoser.java    |  8 ++++----
 .../heron/healthmgr/resolvers/RestartContainerResolver.java  | 10 +++++-----
 .../apache/heron/healthmgr/sensors/BackPressureSensor.java   |  8 ++++----
 5 files changed, 23 insertions(+), 23 deletions(-)

diff --git 
a/heron/healthmgr/src/java/org/apache/heron/healthmgr/HealthManager.java 
b/heron/healthmgr/src/java/org/apache/heron/healthmgr/HealthManager.java
index eb422f7..3e9c3fc 100644
--- a/heron/healthmgr/src/java/org/apache/heron/healthmgr/HealthManager.java
+++ b/heron/healthmgr/src/java/org/apache/heron/healthmgr/HealthManager.java
@@ -215,11 +215,11 @@ public class HealthManager {
     metricsUrl = getOptionValue(cmd, CliArgs.METRIC_SOURCE_URL, metricsUrl);
 
     // metrics reporting thread
-    HealthManagerMetrics publishingMetricsRunnable =
+    HealthManagerMetrics publishingMetrics =
         new HealthManagerMetrics(Integer.valueOf(getOptionValue(cmd, 
CliArgs.METRICSMGR_PORT)));
 
     AbstractModule module
-        = buildBaseModule(metricsUrl, metricSourceClassName, 
publishingMetricsRunnable);
+        = buildBaseModule(metricsUrl, metricSourceClassName, 
publishingMetrics);
     HealthManager healthManager = new HealthManager(config, module);
 
     LOG.info("Initializing health manager");
@@ -230,13 +230,13 @@ public class HealthManager {
     ScheduledFuture<?> future = policyExecutor.start();
 
     LOG.info("Starting Health Manager metric posting thread");
-    new Thread(publishingMetricsRunnable).start();
+    new Thread(publishingMetrics).start();
 
     try {
       future.get();
     } finally {
       policyExecutor.destroy();
-      publishingMetricsRunnable.close();
+      publishingMetrics.close();
     }
   }
 
@@ -327,7 +327,7 @@ public class HealthManager {
 
   @VisibleForTesting
   static AbstractModule buildBaseModule(final String sourceUrl, final String 
type,
-                                        final HealthManagerMetrics 
publishingMetricsRunnable) {
+                                        final HealthManagerMetrics 
publishingMetrics) {
     return new AbstractModule() {
       @Override
       protected void configure() {
@@ -338,7 +338,7 @@ public class HealthManager {
             .annotatedWith(Names.named(CONF_METRICS_SOURCE_TYPE))
             .toInstance(type);
         bind(HealthManagerMetrics.class)
-            .toInstance(publishingMetricsRunnable);
+            .toInstance(publishingMetrics);
       }
     };
   }
diff --git 
a/heron/healthmgr/src/java/org/apache/heron/healthmgr/detectors/BackPressureDetector.java
 
b/heron/healthmgr/src/java/org/apache/heron/healthmgr/detectors/BackPressureDetector.java
index d9cc7b3..a0edb7c 100644
--- 
a/heron/healthmgr/src/java/org/apache/heron/healthmgr/detectors/BackPressureDetector.java
+++ 
b/heron/healthmgr/src/java/org/apache/heron/healthmgr/detectors/BackPressureDetector.java
@@ -41,13 +41,13 @@ public class BackPressureDetector extends BaseDetector {
 
   private static final Logger LOG = 
Logger.getLogger(BackPressureDetector.class.getName());
   private final int noiseFilterMillis;
-  private HealthManagerMetrics publishingMetricsRunnable;
+  private HealthManagerMetrics publishingMetrics;
 
   @Inject
   BackPressureDetector(HealthPolicyConfig policyConfig,
-                       HealthManagerMetrics publishingMetricsRunnable) {
+                       HealthManagerMetrics publishingMetrics) {
     noiseFilterMillis = (int) policyConfig.getConfig(CONF_NOISE_FILTER, 20);
-    this.publishingMetricsRunnable = publishingMetricsRunnable;
+    this.publishingMetrics = publishingMetrics;
   }
 
   /**
@@ -58,7 +58,7 @@ public class BackPressureDetector extends BaseDetector {
    */
   @Override
   public Collection<Symptom> detect(Collection<Measurement> measurements) {
-    publishingMetricsRunnable.executeDetectorIncr(BACK_PRESSURE_DETECTOR);
+    publishingMetrics.executeDetectorIncr(BACK_PRESSURE_DETECTOR);
 
     Collection<Symptom> result = new ArrayList<>();
     Instant now = context.checkpoint();
diff --git 
a/heron/healthmgr/src/java/org/apache/heron/healthmgr/diagnosers/SlowInstanceDiagnoser.java
 
b/heron/healthmgr/src/java/org/apache/heron/healthmgr/diagnosers/SlowInstanceDiagnoser.java
index ffc31f6..1b2fdf6 100644
--- 
a/heron/healthmgr/src/java/org/apache/heron/healthmgr/diagnosers/SlowInstanceDiagnoser.java
+++ 
b/heron/healthmgr/src/java/org/apache/heron/healthmgr/diagnosers/SlowInstanceDiagnoser.java
@@ -38,16 +38,16 @@ public class SlowInstanceDiagnoser extends BaseDiagnoser {
   public static final String SLOW_INSTANCE_DIAGNOSER = "SlowInstanceDiagnoser";
   private static final Logger LOG = 
Logger.getLogger(SlowInstanceDiagnoser.class.getName());
 
-  private HealthManagerMetrics publishingMetricsRunnable;
+  private HealthManagerMetrics publishingMetrics;
 
   @Inject
-  public SlowInstanceDiagnoser(HealthManagerMetrics publishingMetricsRunnable) 
{
-    this.publishingMetricsRunnable = publishingMetricsRunnable;
+  public SlowInstanceDiagnoser(HealthManagerMetrics publishingMetrics) {
+    this.publishingMetrics = publishingMetrics;
   }
 
   @Override
   public Collection<Diagnosis> diagnose(Collection<Symptom> symptoms) {
-    publishingMetricsRunnable.executeDiagnoserIncr(SLOW_INSTANCE_DIAGNOSER);
+    publishingMetrics.executeDiagnoserIncr(SLOW_INSTANCE_DIAGNOSER);
 
     Collection<Diagnosis> diagnoses = new ArrayList<>();
     SymptomsTable symptomsTable = SymptomsTable.of(symptoms);
diff --git 
a/heron/healthmgr/src/java/org/apache/heron/healthmgr/resolvers/RestartContainerResolver.java
 
b/heron/healthmgr/src/java/org/apache/heron/healthmgr/resolvers/RestartContainerResolver.java
index 8d5ab8d..bf9b3cb 100644
--- 
a/heron/healthmgr/src/java/org/apache/heron/healthmgr/resolvers/RestartContainerResolver.java
+++ 
b/heron/healthmgr/src/java/org/apache/heron/healthmgr/resolvers/RestartContainerResolver.java
@@ -46,17 +46,17 @@ public class RestartContainerResolver implements IResolver {
   private final String topologyName;
   private final ISchedulerClient schedulerClient;
   private ExecutionContext context;
-  private HealthManagerMetrics publishingMetricsRunnable;
+  private HealthManagerMetrics publishingMetrics;
 
   @Inject
   public RestartContainerResolver(@Named(CONF_TOPOLOGY_NAME) String 
topologyName,
                                   EventManager eventManager,
                                   ISchedulerClient schedulerClient,
-                                  HealthManagerMetrics 
publishingMetricsRunnable) {
+                                  HealthManagerMetrics publishingMetrics) {
     this.topologyName = topologyName;
     this.eventManager = eventManager;
     this.schedulerClient = schedulerClient;
-    this.publishingMetricsRunnable = publishingMetricsRunnable;
+    this.publishingMetrics = publishingMetrics;
   }
 
   @Override
@@ -66,7 +66,7 @@ public class RestartContainerResolver implements IResolver {
 
   @Override
   public Collection<Action> resolve(Collection<Diagnosis> diagnosis) {
-    publishingMetricsRunnable.executeResolver(RESTART_CONTAINER_RESOLVER);
+    publishingMetrics.executeResolver(RESTART_CONTAINER_RESOLVER);
 
     List<Action> actions = new ArrayList<>();
 
@@ -104,7 +104,7 @@ public class RestartContainerResolver implements IResolver {
               .setTopologyName(topologyName)
               .build());
       LOG.info("Restarted container result: " + b);
-      publishingMetricsRunnable.executeIncr("RestartContainer");
+      publishingMetrics.executeIncr("RestartContainer");
     });
 
     LOG.info("Broadcasting container restart event");
diff --git 
a/heron/healthmgr/src/java/org/apache/heron/healthmgr/sensors/BackPressureSensor.java
 
b/heron/healthmgr/src/java/org/apache/heron/healthmgr/sensors/BackPressureSensor.java
index 7c5d298..7bc7ea6 100644
--- 
a/heron/healthmgr/src/java/org/apache/heron/healthmgr/sensors/BackPressureSensor.java
+++ 
b/heron/healthmgr/src/java/org/apache/heron/healthmgr/sensors/BackPressureSensor.java
@@ -39,19 +39,19 @@ public class BackPressureSensor extends BaseSensor {
   private final MetricsProvider metricsProvider;
   private final PackingPlanProvider packingPlanProvider;
   private final TopologyProvider topologyProvider;
-  private HealthManagerMetrics publishingMetricsRunnable;
+  private HealthManagerMetrics publishingMetrics;
 
   @Inject
   public BackPressureSensor(PackingPlanProvider packingPlanProvider,
                             TopologyProvider topologyProvider,
                             HealthPolicyConfig policyConfig,
                             MetricsProvider metricsProvider,
-                            HealthManagerMetrics publishingMetricsRunnable) {
+                            HealthManagerMetrics publishingMetrics) {
     super(policyConfig, METRIC_BACK_PRESSURE.text(), 
BackPressureSensor.class.getSimpleName());
     this.packingPlanProvider = packingPlanProvider;
     this.topologyProvider = topologyProvider;
     this.metricsProvider = metricsProvider;
-    this.publishingMetricsRunnable = publishingMetricsRunnable;
+    this.publishingMetrics = publishingMetrics;
   }
 
   /**
@@ -61,7 +61,7 @@ public class BackPressureSensor extends BaseSensor {
    */
   @Override
   public Collection<Measurement> fetch() {
-    publishingMetricsRunnable.executeSensorIncr(BACKPRESSURE_SENSOR);
+    publishingMetrics.executeSensorIncr(BACKPRESSURE_SENSOR);
 
     Collection<Measurement> result = new ArrayList<>();
     Instant now = context.checkpoint();

-- 
To stop receiving notification emails like this one, please contact
hui...@apache.org.

Reply via email to