Esempio n. 1
0
        public StatusUpdateTask(IMessageStatistics mStatistics, AbstractClientConfig c)
        {
            try
            {
                _mStatistics   = mStatistics;
                config         = c;
                currentProcess = Process.GetCurrentProcess();

                Assembly executingAssembly = Assembly.GetExecutingAssembly();
                fileVersion = FileVersionInfo.GetVersionInfo(executingAssembly.Location).FileVersion.ToString();

                physicalMemory = GetPhysicalMemory();

                if (null != currentProcess)
                {
                    startTime = MilliSecondTimer.ToUnixMilliSeconds(currentProcess.StartTime);
                }

                dotNetVersion = Environment.Version.ToString();

                if (null != currentProcess)
                {
                    userName = currentProcess.StartInfo.UserName;
                }

                arch = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE");

                ntVersion = Environment.OSVersion.Version.Major + "." + Environment.OSVersion.Version.Minor;

                processorCount = Environment.ProcessorCount;

#if NETFULL
                perfMetricProvider = new DefaultPerformanceMetricProvider();
                perfMetricProvider.Initialize();
#endif
            }
            catch (Exception ex) { Cat.lastException = ex; }
        }
 public DefaultPerformanceMetricProvider()
 {
     startTime = MilliSecondTimer.ToUnixMilliSeconds(currentProcess.StartTime);
 }