cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcken...@apache.org
Subject [1/3] cassandra git commit: Warn on non-high perf power profile on Windows
Date Thu, 23 Jul 2015 15:13:49 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk f713be4aa -> c91266878


Warn on non-high perf power profile on Windows

Patch by jmckenzie; reviewed by pthompson for CASSANDRA-9648


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/53b64a40
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/53b64a40
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/53b64a40

Branch: refs/heads/trunk
Commit: 53b64a406b02518fc7d88124de705c8cf2d7bd46
Parents: 11ac938
Author: Joshua McKenzie <jmckenzie@apache.org>
Authored: Thu Jul 23 11:11:39 2015 -0400
Committer: Joshua McKenzie <jmckenzie@apache.org>
Committed: Thu Jul 23 11:11:39 2015 -0400

----------------------------------------------------------------------
 conf/cassandra-env.ps1 | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/53b64a40/conf/cassandra-env.ps1
----------------------------------------------------------------------
diff --git a/conf/cassandra-env.ps1 b/conf/cassandra-env.ps1
index 8dddc2d..8b0b775 100644
--- a/conf/cassandra-env.ps1
+++ b/conf/cassandra-env.ps1
@@ -337,6 +337,26 @@ Function SetCassandraEnvironment
     # Add sigar env - see Cassandra-7838
     $env:JVM_OPTS = "$env:JVM_OPTS -Djava.library.path=$env:CASSANDRA_HOME\lib\sigar-bin"
 
+    # Confirm we're on high performance power plan, warn if not
+    # Change to $true to suppress this warning
+    $suppressPowerWarning = $false
+    if (!$suppressPowerWarning)
+    {
+        $currentProfile = powercfg /GETACTIVESCHEME
+        if (!$currentProfile.Contains("High performance"))
+        {
+            echo "*---------------------------------------------------------------------*"
+            echo "*---------------------------------------------------------------------*"
+            echo ""
+            echo "    WARNING! Detected a power profile other than High Performance."
+            echo "    Performance of this node will suffer."
+            echo "    Modify conf\cassandra.env.ps1 to suppress this warning."
+            echo ""
+            echo "*---------------------------------------------------------------------*"
+            echo "*---------------------------------------------------------------------*"
+        }
+    }
+
     # add the jamm javaagent
     if (($env:JVM_VENDOR -ne "OpenJDK") -or ($env:JVM_VERSION.CompareTo("1.6.0") -eq 1) -or
         (($env:JVM_VERSION -eq "1.6.0") -and ($env:JVM_PATCH_VERSION.CompareTo("22") -eq
1)))


Mime
View raw message