Exemple #1
0
 // Token: 0x06000090 RID: 144 RVA: 0x00004994 File Offset: 0x00002B94
 internal static void Log()
 {
     if (TickDiffer.Elapsed(CPUMemoryLogger.lastLogTime).TotalMinutes > (double)AppSettings.Current.LogCPUMemoryIntervalInMinutes)
     {
         CPUMemoryLogger.lastLogTime = Environment.TickCount;
         HttpLogger.SafeSetLogger(ConfigurationCoreMetadata.CPU, (long)CPUMemoryLogger.ProcessCpuPerfCounter.GetValue() + "% * " + CPUMemoryLogger.ProcessorCount);
         HttpLogger.SafeSetLogger(ConfigurationCoreMetadata.Memory, CPUMemoryLogger.GetMemory());
     }
 }
Exemple #2
0
        internal void Set(long newValue, int nowTicks)
        {
            if (newValue == this.OldValue)
            {
                return;
            }
            if (this.Counter != null)
            {
                bool flag = false;
                if (this.Interval != 2147483647 && TickDiffer.Elapsed(this.lastUpdateTicks, nowTicks).TotalMilliseconds > (double)this.Interval)
                {
                    flag = true;
                }
                else
                {
                    switch (this.CompareType)
                    {
                    case CounterCompareType.Lower:
                        flag = (newValue < this.OldValue);
                        break;

                    case CounterCompareType.Higher:
                        flag = (newValue > this.OldValue);
                        break;

                    case CounterCompareType.Changed:
                        flag = true;
                        break;
                    }
                }
                if (flag)
                {
                    this.Counter.SetRawValue(newValue);
                    this.OldValue        = newValue;
                    this.lastUpdateTicks = nowTicks;
                }
            }
        }
Exemple #3
0
 internal static ulong GetTickDifference(int tickStart, int tickEnd)
 {
     return(TickDiffer.GetTickDifference(tickStart, tickEnd));
 }