survey <- cleme="" esktop="" read.csv="" sers="" stringsasfactors="FALSE)<br" survey-covid.csv="">surveyFinalized<-survey br="" esponse="" finalized="" survey="" tatus="=">
names(surveyFinalized)[names(surveyFinalized) == "What.is.your.home.situation..you.are.in.living...."] <- br="" latorhouse="">names(surveyFinalized)[names(surveyFinalized) == "What.is.your.family.situation."] <- br="" situation="">names(surveyFinalized)[names(surveyFinalized) == "How.worried.are.you.about.the.impact.of.coronavirus.on.you.personally."] <- anxiety="" br="">
View(surveyFinalized)
surveyFinalized$situation[grepl( "without child", surveyFinalized$situation,fixed = TRUE)]<- br="" lone="">surveyFinalized$situation[grepl( "with child", surveyFinalized$situation,fixed = TRUE)]<- amily="" br="">
surveyFinalized$FlatOrHouse[grepl( "ppart", surveyFinalized$FlatOrHouse,fixed = TRUE)]<- br="" ppartment="">surveyFinalized$FlatOrHouse[grepl( "Apart", surveyFinalized$FlatOrHouse,fixed = TRUE)]<- br="" ppartment="">surveyFinalized$FlatOrHouse[grepl( "flat", surveyFinalized$FlatOrHouse,fixed = TRUE)]<- br="" ppartment="">surveyFinalized$FlatOrHouse[grepl( "city", surveyFinalized$FlatOrHouse,fixed = TRUE)]<- br="" ppartment="">surveyFinalized$FlatOrHouse[grepl( "country", surveyFinalized$FlatOrHouse,fixed = TRUE)]<- br="" ouse="">surveyFinalized$FlatOrHouse[grepl( "house", surveyFinalized$FlatOrHouse,fixed = TRUE)]<- br="" ouse="">
library("ggplot2")
surveyFinalized$anxiety<-factor all="" anxiety="" at="" br="" ery="" levels="c(" omewhat="" ot="" so="" surveyfinalized="" worried="" xtremely="">relevel(surveyFinalized$anxiety,"Very worried")
(d <- aes="" anxiety="" br="" depending="" eneral="" ggplot="" ggtitle="" on="" situation="" surveyfinalized=""> geom_jitter())
(d <- aes="" anxiety="" br="" depending="" eneral="" ggplot="" ggtitle="" latorhouse="" on="" setup="" surveyfinalized=""> geom_jitter())->->-factor>->->->->->->->->->->->-survey>->
Affichage des articles dont le libellé est stats. Afficher tous les articles
Affichage des articles dont le libellé est stats. Afficher tous les articles
mardi 12 mai 2020
mercredi 28 février 2018
R rough guide
Working directory
getwd()
setwd("D:\\data\\Core kpi\\workspace\\tekpi-service\\src\\test\\resources\\data\\performance")
Loading data from external files
testplan.1_users.20171228 <- data="" ore="" read.csv="" u="">kpi->
/workspace/tekpi-service/src/test/resources/data/performance/testplan-per-query-aggregate-1_users-20171228.csv")
Converting from Posix Date
In jmeter, the date are stored in POSIX format (number of millis since 1970), in order to generate propely the date. Use the following commande.
View a table
View(testplan.1_users.20171228)
Install a package
install.packages("ggplot2")
load a library
library("ggplot2")
dataTestFiles<- u="">dir->
(pattern = "testplan-per-query-aggregate-.*-20180125.*")
Process a batch of file
testplan<-null span="">-null>
for
(filename in dataTestFiles) {
print(filename);
nbUserStr<-sub u="">testplan-sub>
-per-query-aggregate-","",filename)
nbUserStr<-sub nbuserstr="" span="" users="">-sub>
nbUserStr<- u="">strsplit->
(nbUserStr,"-")[[1]][1]
nbUser<-as .numeric="" nbuserstr="" span="">-as>
print(substr(filename,30,30));
temptestplan <- filename="" read.csv="" span="">->
temptestplan$nbuser=nbUser;
splittedData <- data.frame="" do.call="" u="">rbind->
',
strsplit(as.character(temptestplan$label),'-',fixed=TRUE)))
temptestplan<- u="">cbind->
(temptestplan,splittedData)
temptestplan$session=filename;
testplan<- u="">rbind->
(testplan,temptestplan)
}
Agregate on function
aggregate(x=testplanclean$elapsed,by=list(testplanclean$session),FUN='mean')
aggregate(x=testplanclean$elapsed,by=list(testplanclean$session),FUN='var')
aggregate(x=testplanclean$elapsed,by=list(testplanclean$session),FUN='max')
nbReqSession<-aggregate x="<u">testplanclean-aggregate>
$elapsed,by=list(testplanclean$session),FUN='length')
startSession<-aggregate x="<u">testplanclean-aggregate>
$timeStamp,by=list(testplanclean$session),FUN='min')
endSession<-aggregate x="<u">testplanclean-aggregate>
$timeStamp,by=list(testplanclean$session),FUN='max')
intensite<- u="">cbind->
(nbReqSession[1],nbReqSession[2]/(endSession[2]-startSession[2])*60000)
testplanclean$nbuserlabel<-paste u="">testplanclean-paste>
$nbuser,
" user: ",testplanclean$X1)
# Time
elapsed per User and type of graph
timeElapsedGraph
<- u="">ggplot->
(testplanclean, aes(nbuserlabel,elapsed/1000,color=X1))
timeElapsedGraph + geom_boxplot() + labs(y="Temps de
r�ponse (s)",x="Utilisateurs
simultan�s")+
scale_x_discrete(labels=c(timeElapsedGraph$nbuser))
# Time
elapsed per Filter
timeElapsedPerFilterGraph
<- u="">ggplot->
(testplanclean, aes(X3,elapsed/1000))
timeElapsedPerFilterGraph + stat_boxplot() +
labs(y="Temps de r�ponse (s)",x="Type de filtre")
# Time
elapsed per aircraft
timeElapsedPerAircraftGraph
<- u="">ggplot->
(testplanclean, aes(X2,elapsed/1000))
timeElapsedPerAircraftGraph
+ stat_boxplot() + labs(y="Temps de r�ponse (s)",x="Aircraft")
# Time
elapsed type of graph
timeElapsedGraph
<- u="">ggplot->
(testplanclean, aes(X1,elapsed/1000))
timeElapsedGraph
+ geom_boxplot() + labs(y="Temps de r�ponse (s)",x="Type of Graph")
hist(testplanclean$timeStamp/60000)
aggregate(x=testplan$responseCode,by=list(testplan$label,testplan$responseCode),FUN='length')
intensiteChart<- u="">ggplot->
(intensite,aes(Group.1,x))+theme(axis.text.x=element_blank(),
axis.ticks.x=element_blank())
intensiteChart+geom_point()+geom_smooth(method="lm",color="Red")+labs(y="Request
per minutes",x="Stress of the scenario")
intensite
Package pour traiter les dates
install.packages('lubridate')
library(lubridate)
access_log$Date<-dmy_hms access_log="" span="">-dmy_hms>
Inscription à :
Articles (Atom)