Databases Reference
In-Depth Information
As the scripts in this recipe will use the ggplot2 package, you must download ggplot2 version 8.9 and install it
using the following command:
[root@cm01dbm01 yum.repos.d]# R CMD INSTALL ./ggplot2_0.9.2.1.tar.gz
at the time of this writing, the version of r installed with the el5_addons channel is 2.13-2. the ggplot2 package
does not exist for 2.13-2, so you will not be able to simply run install.packages('ggplot2') from the r command
prompt; this is why we're showing you how to download a version compatible with r version 2.13-2 and manually install it.
Note
Once R, Rscript, and the ggplot2 package are installed, you use the scripts in Listings 13-2 and 13-3 to summarize
your metrichistory data. Listing 13-2 accepts a cell server or cell group file and a specific Exadata Storage Server as
input parameters and feeds the output into an R script to summarize the statistical minimum, median, mean, and
maximum values. Additionally, the script in Listing 13-3 will generate both a line plot and frequency histogram plot
based for the metric values extracted via cellcli :
Listing 13-2. lst13-02-metricsum.sh
#!/bin/sh
# Name: lst13-02-metricsum.sh
# Usage: ./lst13-02-metricsum.sh [-c|-g] [cell|cell_group] -m [metric]
export rscript=./lst13-03-metricsum.r
usage() {
echo "Usage: 'basename $0' [-c|-g] [cell|cell_group] -m [metric]"
echo "Invalid metric: $1"
exit 1
}
case $# in
4)
if [ "$1" == "-c" ] && [ "$3" == "-m" ]; then
scp=$1; cells=$2; metric=$4
export a4=$4
elif [ "$1" == "-g" ] && [ "$3" == "-m" ]; then
scp=$1; cells=$2; metric=$4
else
usage
fi
metricdesc='dcli ${scp} ${cells} cellcli -e list metricdefinition ${metric} \
attributes description|head -1 | awk 'BEGIN { FS = "\"" } ; { print $2 }''
unit='dcli ${scp} ${cells} cellcli -e list metricdefinition ${metric} \
attributes unit|head -1 | sed 's/IO requests/IORequests/g'| \
awk '{ print $2 }''
if [ -z "${metricdesc}" ]; then
usage ${metric}
fi
case $metric in
CD*|GD*) plt=1;;
*) plt=2;;
esac
echo "Reporting on ${metric}: ${metricdesc}"
 
Search WWH ::




Custom Search