コード例 #1
0
 public virtual void DoUpdates(MetricsContext unused)
 {
     lock (this)
     {
         shuffleMetrics.IncrMetric("shuffle_input_bytes", numBytes);
         shuffleMetrics.IncrMetric("shuffle_failed_fetches", numFailedFetches);
         shuffleMetrics.IncrMetric("shuffle_success_fetches", numSuccessFetches);
         if (numCopiers != 0)
         {
             shuffleMetrics.SetMetric("shuffle_fetchers_busy_percent", 100 * ((float)numThreadsBusy
                                                                              / numCopiers));
         }
         else
         {
             shuffleMetrics.SetMetric("shuffle_fetchers_busy_percent", 0);
         }
         numBytes          = 0;
         numSuccessFetches = 0;
         numFailedFetches  = 0;
     }
     shuffleMetrics.Update();
 }
コード例 #2
0
 /// <summary>Push the delta  metrics to the mr.</summary>
 /// <remarks>
 /// Push the delta  metrics to the mr.
 /// The delta is since the last push/interval.
 /// Note this does NOT push to JMX
 /// (JMX gets the info via
 /// <see cref="previousIntervalValue"/>
 /// </remarks>
 /// <param name="mr"/>
 public override void PushMetric(MetricsRecord mr)
 {
     lock (this)
     {
         IntervalHeartBeat();
         try
         {
             mr.IncrMetric(GetName(), GetPreviousIntervalValue());
         }
         catch (Exception e)
         {
             Log.Info("pushMetric failed for " + GetName() + "\n", e);
         }
     }
 }
コード例 #3
0
 /// <summary>Push the delta  metrics to the mr.</summary>
 /// <remarks>
 /// Push the delta  metrics to the mr.
 /// The delta is since the last push/interval.
 /// Note this does NOT push to JMX
 /// (JMX gets the info via
 /// <see cref="GetPreviousIntervalAverageTime()"/>
 /// and
 /// <see cref="GetPreviousIntervalNumOps()"/>
 /// </remarks>
 /// <param name="mr"/>
 public override void PushMetric(MetricsRecord mr)
 {
     lock (this)
     {
         IntervalHeartBeat();
         try
         {
             mr.IncrMetric(GetName() + "_num_ops", GetPreviousIntervalNumOps());
             mr.SetMetric(GetName() + "_avg_time", GetPreviousIntervalAverageTime());
         }
         catch (Exception e)
         {
             Log.Info("pushMetric failed for " + GetName() + "\n", e);
         }
     }
 }
コード例 #4
0
ファイル: JvmMetrics.cs プロジェクト: orf53975/hadoop.net
        private void DoGarbageCollectionUpdates()
        {
            IList <GarbageCollectorMXBean> gcBeans = ManagementFactory.GetGarbageCollectorMXBeans
                                                         ();
            long count      = 0;
            long timeMillis = 0;

            foreach (GarbageCollectorMXBean gcBean in gcBeans)
            {
                count      += gcBean.GetCollectionCount();
                timeMillis += gcBean.GetCollectionTime();
            }
            metrics.IncrMetric("gcCount", (int)(count - gcCount));
            metrics.IncrMetric("gcTimeMillis", (int)(timeMillis - gcTimeMillis));
            gcCount      = count;
            gcTimeMillis = timeMillis;
        }
コード例 #5
0
 /// <summary>
 /// Since this object is a registered updater, this method will be called
 /// periodically, e.g.
 /// </summary>
 /// <remarks>
 /// Since this object is a registered updater, this method will be called
 /// periodically, e.g. every 5 seconds.
 /// </remarks>
 public virtual void DoUpdates(MetricsContext unused)
 {
     lock (this)
     {
         metricsRecord.IncrMetric("maps_launched", numMapTasksLaunched);
         metricsRecord.IncrMetric("maps_completed", numMapTasksCompleted);
         metricsRecord.IncrMetric("reduces_launched", numReduceTasksLaunched);
         metricsRecord.IncrMetric("reduces_completed", numReduceTasksCompleted);
         metricsRecord.IncrMetric("waiting_maps", numWaitingMaps);
         metricsRecord.IncrMetric("waiting_reduces", numWaitingReduces);
         numMapTasksLaunched     = 0;
         numMapTasksCompleted    = 0;
         numReduceTasksLaunched  = 0;
         numReduceTasksCompleted = 0;
         numWaitingMaps          = 0;
         numWaitingReduces       = 0;
     }
     metricsRecord.Update();
 }