Class to POST the agent payload data to the Server Density servers.
예제 #1
0
        /// <summary>
        /// Performs all checks.
        /// </summary>
        private void DoChecks()
        {
            var results = new Dictionary <string, object>();

            foreach (var check in Checks)
            {
                Log.DebugFormat("{0}: start", check.GetType());
                try
                {
                    var result = check.DoCheck();
                    if (result != null)
                    {
                        results.Add(check.Key, result);
                        Log.DebugFormat("{0}: end", check.GetType());
                    }
                }
                catch (Exception ex)
                {
                    Log.Error(ex);
                }
            }

            // Post metrics to Server Density servers.
            try
            {
                var poster = new PayloadPoster(_config, results);
                poster.Post();
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }
        }
예제 #2
0
        /// <summary>
        /// Performs all checks.
        /// </summary>
        private void DoChecks()
        {
            var results = new Dictionary<string, object>();

            foreach (var check in Checks)
            {
                Log.DebugFormat("{0}: start", check.GetType());
                try
                {
                    var result = check.DoCheck();
                    if (result != null)
                    {
                        results.Add(check.Key, result);
                        Log.DebugFormat("{0}: end", check.GetType());
                    }
                }
                catch (Exception ex)
                {
                    Log.Error(ex);
                }
            }

            // Post metrics to Server Density servers.
            try
            {
                var poster = new PayloadPoster(_config, results);
                poster.Post();
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }
        }