From b33a39144df6d053eac1e6e58df1dd781f62e400 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 16 Feb 2016 16:29:47 +0100 Subject: [PATCH] Adding windows memory calcuclations --- mysqltuner.pl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mysqltuner.pl b/mysqltuner.pl index acbf2f4..da747ee 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -352,6 +352,14 @@ sub os_setup { chomp($swap_memory); $swap_memory = $swap_memory * 1024 * 1024; } + elsif( $os =~ /windows/i ) { + $physical_memory = + `wmic ComputerSystem get TotalPhysicalMemory | perl -ne "chomp; print if /[0-9]+/;"` + or memerror; + $swap_memory = + `wmic OS get FreeVirtualMemory | perl -ne "chomp; print if /[0-9]+/;"` + or memerror; + } } debugprint "Physical Memory: $physical_memory"; debugprint "Swap Memory: $swap_memory";