Created
February 17, 2016 00:53
-
-
Save tlasica/410e4e7cacdf40ef9c79 to your computer and use it in GitHub Desktop.
Script to enable/disable gc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
COMMAND=$1 | |
FILE=$DSE_CASS_CONFIG_HOME/jvm.options | |
OPTIONS=( | |
'-XX:+PrintGCDetails' | |
'-XX:+PrintGCDateStamps' | |
'-XX:+PrintHeapAtGC' | |
'-XX:+PrintTenuringDistribution' | |
'-XX:+PrintGCApplicationStoppedTime' | |
'-XX:+PrintPromotionFailure' | |
'-XX:PrintFLSStatistics' | |
'-Xloggc' | |
'-XX:+UseGCLogFileRotation' | |
'-XX:NumberOfGCLogFiles' | |
'-XX:GCLogFileSize' | |
) | |
function enable() { | |
for o in "${OPTIONS[@]}"; do | |
CMD="s/^#$o/$o/" | |
sed -i $CMD $FILE | |
done | |
} | |
function disable() { | |
for o in "${OPTIONS[@]}"; do | |
CMD="s/^$o/#$o/" | |
sed -i $CMD $FILE | |
done | |
} | |
$COMMAND |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment