Esempio n. 1
0
        public decimal ComputeMemoryAvailable(CouchBaseStats.CouchBaseStats stats)
        {
            if (stats == null)
            {
                throw new ArgumentNullException(nameof(stats));
            }
            var memFree  = stats.nodes[0].systemStats.mem_free;
            var memTotal = stats.nodes[0].systemStats.mem_total;

            return((decimal)memFree / (decimal)memTotal * (decimal)100.0);
        }
Esempio n. 2
0
        public Task <ICheckResult> RunAsync()
        {
            HttpClient httpClient = client.WithBasicAuthorization();

            CouchBaseStats.CouchBaseStats stats = ComputeCouchBaseStats(httpClient);

            var memAvailable = ComputeMemoryAvailable(stats);

            var level = CheckMemoryAvailable(memAvailable);

            return(Task.FromResult <ICheckResult>(new CheckResult(ShortName, level)));
        }