library(RODBC)
library(rgl, pos=4)
library(mgcv, pos=4)
library(aplpack, pos=4)

SQL <- "SELECT * FROM nmon.app_cpu"

myDB <- odbcConnect("NMON")
odbcQuery(myDB, SQL)
NMON <- sqlGetResults(myDB, as.is=T)
odbcClose(myDB)

NMON$TXN_NUM <- as.numeric(NMON$TXN_NUM)
NMON$TXN_WEIGHT<- as.numeric(NMON$TXN_WEIGHT)
NMON$AVG_TIME<- as.numeric(NMON$AVG_TIME)
NMON$CPU_USER<- as.numeric(NMON$CPU_USER)
NMON$CPU_SYS<- as.numeric(NMON$CPU_SYS)
NMON$CPU_WAIT<- as.numeric(NMON$CPU_WAIT)
NMON$CPU_IDLE<- as.numeric(NMON$CPU_IDLE)

attach(NMON)

plot(NMON$TXN_NUM, type="h", ylab="TXN")
Hist(NMON$TXN_NUM, scale="percent", breaks="Sturges", col="darkgray", xlab="TXN")

plot(NMON$TXN_WEIGHT, type="h", ylab="TXN_WEIGHT")
Hist(NMON$TXN_WEIGHT, scale="percent", breaks="Sturges", col="darkgray", xlab="TXN_WEIGHT")

detach(NMON)
remove(myDB)
remove(NMON)
%d 位部落客按了讚: