Exemple #1
0
 internal static void UnregisterContainerMetrics(Org.Apache.Hadoop.Yarn.Server.Nodemanager.Containermanager.Monitor.ContainerMetrics
                                                 cm)
 {
     lock (typeof(ContainerMetrics))
     {
         cm.metricsSystem.UnregisterSource(cm.recordInfo.Name());
         Sharpen.Collections.Remove(usageMetrics, cm.containerId);
     }
 }
Exemple #2
0
 ForContainer(MetricsSystem ms, ContainerId containerId, long flushPeriodMs, long
              delayMs)
 {
     lock (typeof(ContainerMetrics))
     {
         Org.Apache.Hadoop.Yarn.Server.Nodemanager.Containermanager.Monitor.ContainerMetrics
             metrics = usageMetrics[containerId];
         if (metrics == null)
         {
             metrics = new Org.Apache.Hadoop.Yarn.Server.Nodemanager.Containermanager.Monitor.ContainerMetrics
                           (ms, containerId, flushPeriodMs, delayMs).Tag(RecordInfo, containerId);
             // Register with the MetricsSystems
             if (ms != null)
             {
                 metrics = ms.Register(SourceName(containerId), "Metrics for container: " + containerId
                                       , metrics);
             }
             usageMetrics[containerId] = metrics;
         }
         return(metrics);
     }
 }