Beispiel #1
0
        private byte GetTotalLoad(string monitoredSystemName)
        {
            // Information: "/local" values are higher
            double FreeCapacity  = Convert.ToDouble(clusterConnection.GetLatestMetricData(monitoredSystemName, "FreeSpace:/").Split(' ')[0], new CultureInfo("en-US"));
            double UsedCapacity  = Convert.ToDouble(clusterConnection.GetLatestMetricData(monitoredSystemName, "UsedSpace:/").Split(' ')[0], new CultureInfo("en-US"));
            double TotalCapacity = FreeCapacity + UsedCapacity;

            byte Load = Convert.ToByte(Math.Round((UsedCapacity / TotalCapacity) * 100));

            return(Load);
        }
Beispiel #2
0
        private byte GetLoad(string monitoredSystemName)
        {
            CultureInfo en     = new CultureInfo("en-US");
            double      system = Convert.ToDouble(clusterConnection.GetLatestMetricData(monitoredSystemName, "CPUSystem").Split(' ')[0], en);
            double      user   = Convert.ToDouble(clusterConnection.GetLatestMetricData(monitoredSystemName, "CPUUser").Split(' ')[0], en);
            double      wait   = Convert.ToDouble(clusterConnection.GetLatestMetricData(monitoredSystemName, "CPUWait").Split(' ')[0], en);

            float load = (float)((system + user + wait) / GetNumberOfCores(monitoredSystemName));

            int loadPercent = (int)Math.Round(load);

            return(Convert.ToByte(loadPercent));
        }
Beispiel #3
0
        private int GetSwapLoadInMB(string monitoredSystemName)
        {
            double SwapUsedBytes = Convert.ToDouble(clusterConnection.GetLatestMetricData(monitoredSystemName, "SwapUsed").Split(' ')[0], new CultureInfo("en-US"));

            return((int)Math.Round(SwapUsedBytes / (1024.0 * 1024.0)));
        }