// init is just used to make the signature of this private constructor different.
        // ReSharper disable once UnusedParameter.Local
        private PerfMonReporter(IList<CounterConfig> counters, string instanceId, string stackDriverApiKey, bool init)
        {
            var serverName = Environment.MachineName;

            Counters = counters;
            Scope = new ManagementScope(string.Format("\\\\{0}\\root\\cimv2", serverName));

            _stackDriverPoster = new CustomMetricsPoster(stackDriverApiKey, instanceId, new LoggerFailureCallback());

            _instanceId = instanceId;

            _timer = new Timer {Interval = OneMinuteMilliseconds};
            _timer.Elapsed += GetMetrics;
        }
Exemple #2
0
        // init is just used to make the signature of this private constructor different.
        // ReSharper disable once UnusedParameter.Local
        private PerfMonReporter(IList <CounterConfig> counters, string instanceId, string stackDriverApiKey, bool init)
        {
            var serverName = Environment.MachineName;

            Counters = counters;
            Scope    = new ManagementScope(string.Format("\\\\{0}\\root\\cimv2", serverName));

            _stackDriverPoster = new CustomMetricsPoster(stackDriverApiKey, instanceId, new LoggerFailureCallback());

            _instanceId = instanceId;

            _timer = new Timer {
                Interval = OneMinuteMilliseconds
            };
            _timer.Elapsed += GetMetrics;
        }