From 4ebb8ee0b011a07ccfa1fe22caccec5c13586940 Mon Sep 17 00:00:00 2001
From: Niko Ehrenfeuchter <nikolaus.ehrenfeuchter@unibas.ch>
Date: Mon, 12 Mar 2018 21:50:16 +0100
Subject: [PATCH] Remove WmiSummary method.

---
 ATxCommon/SystemChecks.cs | 35 -----------------------------------
 ATxService/AutoTx.cs      |  3 +--
 2 files changed, 1 insertion(+), 37 deletions(-)

diff --git a/ATxCommon/SystemChecks.cs b/ATxCommon/SystemChecks.cs
index c22b9c1..18abce0 100644
--- a/ATxCommon/SystemChecks.cs
+++ b/ATxCommon/SystemChecks.cs
@@ -103,41 +103,6 @@ namespace ATxCommon
             return -1;
         }
 
-        /// <summary>
-        /// Validate the WMI query methods work correctly and create a summary or warning message.
-        /// </summary>
-        /// <returns>A summary with current readings from WMI or a warning message.</returns>
-        public static string WmiSummary() {
-            var failed = new List<string>();
-            var load = GetCpuUsage();
-            var free = GetFreeMemory();
-            var summary = $"CPU load: {load}\n" +
-                          $"Free system memory: {Conv.MegabytesToString(free)}\n";
-            Log.Warn(summary);
-            if (load == -1) {
-                failed.Add("CPU load");
-            }
-            if (free == -1) {
-                failed.Add("free RAM");
-            }
-
-            if (failed.Count > 0) {
-                summary = "*******************************************************\n" +
-                          "WARNING: Checking system parameters via WMI failed for:\n";
-                foreach (var property in failed) {
-                    summary += $" - {property}\n";
-                }
-
-                summary += "\n" +
-                           "-------------------------------------------------------\n" +
-                           "Limits configured for these properties will be IGNORED!\n" +
-                           "-------------------------------------------------------\n\n";
-                Log.Error(summary);
-            }
-
-            return summary;
-        }
-
         /// <summary>
         /// Get the free space of a drive in bytes.
         /// </summary>
diff --git a/ATxService/AutoTx.cs b/ATxService/AutoTx.cs
index 4af8b97..c18bda0 100644
--- a/ATxService/AutoTx.cs
+++ b/ATxService/AutoTx.cs
@@ -360,8 +360,7 @@ namespace ATxService
 
 
             msg += "\n------ Current system parameters ------\n" +
-                   "Hostname: " + Environment.MachineName + "\n" +
-                   SystemChecks.WmiSummary();
+                   $"Hostname: {Environment.MachineName}\n";
 
             foreach (var driveToCheck in _config.SpaceMonitoring) {
                 msg += "Free space on drive '" + driveToCheck.DriveName + "': " +
-- 
GitLab