Create() 공개 정적인 메소드

Creates a new Metric instance if value is valid, otherwise returns null. Invalid numeric values are negative and NaN/Infinite.
public static Create ( string name, double value, double decayFactor = null ) : Metric
name string
value double
decayFactor double
리턴 Metric
 /// <summary>
 /// Gets the total amount of system memory. Creates a new instance each time.
 /// </summary>
 public Metric SystemMaxMemory()
 {
     return(Metric.Create(StandardMetrics.SystemMemoryMax,
                          IsRunningOnMono
             ? _monoSystemMaxMemory.RawValue
             : GetVbTotalPhysicalMemory()));
 }
예제 #2
0
        /// <summary>
        /// Gets the total amount of system memory. Creates a new instance each time.
        /// </summary>
        public Metric SystemMaxMemory()
        {
            return(Metric.Create(StandardMetrics.SystemMemoryMax,
#if MONO
                                 _systemMaxMemory.RawValue
#else
                                 new Microsoft.VisualBasic.Devices.ComputerInfo().TotalPhysicalMemory
#endif
                                 ));
        }
예제 #3
0
 /// <summary>
 /// Gets the total amount of system memory. Creates a new instance each time.
 /// </summary>
 public Metric SystemMaxMemory()
 {
     return(Metric.Create(StandardMetrics.SystemMemoryMax,
                          new Microsoft.VisualBasic.Devices.ComputerInfo().TotalPhysicalMemory));
 }
예제 #4
0
 /// <summary>
 /// Gets the amount of system memory available. Creates a new instance each time.
 /// </summary>
 public Metric SystemMemoryAvailable()
 {
     return(Metric.Create(StandardMetrics.SystemMemoryAvailable, _systemAvailableMemory.NextValue(), DecayFactor));
 }
예제 #5
0
 /// <summary>
 /// Gets the amount of memory used by this particular CLR process. Creates a new instance each time.
 /// </summary>
 public Metric ClrProcessMemoryUsed()
 {
     return(Metric.Create(StandardMetrics.ClrProcessMemoryUsed, Process.GetCurrentProcess().WorkingSet64,
                          DecayFactor));
 }
예제 #6
0
 /// <summary>
 /// Returns the system load average. Creates a new instance each time.
 /// </summary>
 public Metric SystemLoadAverage()
 {
     return(Metric.Create(StandardMetrics.SystemLoadAverage, _systemLoadAverageCounter.NextValue()));
 }
예제 #7
0
 /// <summary>
 /// Returns the number of available processors. Creates a new instance each time.
 /// </summary>
 public Metric Processors()
 {
     return(Metric.Create(StandardMetrics.Processors, Environment.ProcessorCount, null));
 }