diff options
| author | Loic Guegan <manzerberdes@gmx.com> | 2019-05-28 11:01:47 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerberdes@gmx.com> | 2019-05-28 11:01:47 +0200 |
| commit | d344407ccf48929d529257be64a579d40ea4dd67 (patch) | |
| tree | c4d92ea82d0fdff541a45dc1c31bbf16c1726fdb /2019-Mascots.org | |
| parent | 18742ad94405c2998fa357d9e90a7f03266885d0 (diff) | |
Update paper
Diffstat (limited to '2019-Mascots.org')
| -rw-r--r-- | 2019-Mascots.org | 396 |
1 files changed, 194 insertions, 202 deletions
diff --git a/2019-Mascots.org b/2019-Mascots.org index 63dd9ca..4a59311 100644 --- a/2019-Mascots.org +++ b/2019-Mascots.org @@ -8,6 +8,7 @@ #+LATEX_HEADER: \usepackage{booktabs} #+LATEX_HEADER: \usepackage{subfigure} #+LATEX_HEADER: \usepackage{graphicx} +#+LATEX_HEADER: \usepackage{xcolor} #+LATEX_HEADER: \IEEEoverridecommandlockouts #+LATEX_HEADER: \author{\IEEEauthorblockN{1\textsuperscript{st} Anne-Cécile Orgerie} #+LATEX_HEADER: \IEEEauthorblockA{\textit{Univ Rennes, Inria, CNRS, IRISA, Rennes, France} \\ @@ -20,7 +21,9 @@ #+LATEX_HEADER: loic.guegan@irisa.fr} #+LATEX_HEADER: } - +#+BEGIN_EXPORT latex +\newcommand{\hl}[1]{\textcolor{red}{#1}} +#+END_EXPORT #+BEGIN_EXPORT latex \begin{abstract} @@ -107,13 +110,15 @@ component, formatting, style, styling, insert The network part represents the a network section starting from the AP to the Cloud excluding the server. It is also model into ns-3. We consider the server to be 9 hops away from the AP with a typical round-trip latency of 100ms from the AP to the server. Each node from the AP to the Cloud - is assume to be network switches with static and dynamic network energy consumption. ECOFEN - \cite{orgerie_ecofen:_2011} is used to model the energy consumption of the network part. ECOFEN - is a ns-3 network energy module dedicated to wired network. It is based on an energy-per-bit - model including static energy consumption by assuming a linear relation between the amount of - data sent to the network interface and its power consumption. The different energy values used to - instantiate the ECOFEN energy model for the network part are shown in Table \ref{tab:net-energy} - and come from previous work \cite{cornea_studying_2014-1}. + is assume to be network switches with static and dynamic network energy consumption. The first 8 + hop are edge switches and the last one is consider to be a core switch as mention in + \cite{jalali_fog_2016}. ECOFEN \cite{orgerie_ecofen:_2011} is used to model the energy + consumption of the network part. ECOFEN is a ns-3 network energy module dedicated to wired + network. It is based on an energy-per-bit model including static energy consumption by assuming a + linear relation between the amount of data sent to the network interface and its power + consumption. The different energy values used to instantiate the ECOFEN energy model for the + network part are shown in Table \ref{tab:net-energy} and come from previous work + \cite{cornea_studying_2014-1}. ** Cloud Part Finally, to measure the energy consumed by the server, we used real server from the large-scale @@ -134,39 +139,41 @@ component, formatting, style, styling, insert ** IoT/Network Consumption In a first place, we start by studying the impact of the sensors position on their energy consumption. To this end, we run several simulations in ns-3 with different sensors position. The - results provided by Figure \ref{fig:sensorsPos} show that sensors position have a very low impact + results provided by Table \ref{tab:sensorsSendIntervalEffects} show that sensors position have a very low impact on the energy consumption and on the application delay. It has an impact of course, but it is very limited. This due to the fact that in such a scenario with very small number of communications spread over the time, sensors don't have to contend for accessing to the Wifi channel. + #+BEGIN_EXPORT latex - \begin{figure} - \centering - \includegraphics[width=0.6\linewidth]{./plots/sensorsPosition-delayenergy.png} - \caption{Effects of sensors position on the application delay and the sensors energy consumption in a cell of 9 sensors.} - \label{fig:sensorsPos} - \end{figure} + % Please add the following required packages to your document preamble: + % \usepackage{booktabs} + \begin{table*}[] + \centering + \caption{Sensors send interval effects} + \label{tab:sensorsSendIntervalEffects} + \begin{tabular}{@{}lrrrrr@{}} + \toprule + Sensors Send Interval & 10s & 30s & 50s & 70s & 90s \\ \midrule + Sensors Power Consumption & 13.517\hl{94}W & 13.517\hl{67}W & 13.51767W & 13.51767W & 13.517\hl{61}W \\ + Network Power Consumption & 10.441\hl{78}W & 10.441\hl{67}W & 10.44161W & 10.44161W & 10.441\hl{61}W \\ + Average Appplication Delay & 17.81360s & 5.91265s & 3.53509s & 2.55086s & 1.93848s \\ \bottomrule + \end{tabular} + \end{table*} #+END_EXPORT - Previous work \cite{li_end--end_2018} on similar scenario shows that increasing application - accuracy impact strongly the energy consumption in the context of data stream analysis. However, - in our case, application accuracy is driven by the sensing interval and thus, the transmit - frequency of the sensors. Therefore, we varied the transmission interval of the sensors from 1s - to 60s. Figure \ref{fig:frequency} present the effects of the sensors transmission interval on - the IoT/Network part energy consumption. In case of small and sporadic network traffic, these - results show that with a reasonable transmission interval the energy consumption of the - IoT/Network if almost not affected by the variation of this transmission interval. In fact, - transmitted data are not large enough to leverage the energy consumed by the network. - #+BEGIN_EXPORT latex - \begin{figure} - \centering - \includegraphics[scale=0.45]{./plots/sendFrequency-energy.png} - \caption{Sensors send interval and its influence on the IoT/Network part energy consumption.} - \label{fig:frequency} - \end{figure} - #+END_EXPORT - + Previous work \cite{li_end--end_2018} on similar scenario shows that increasing application + accuracy impact strongly the energy consumption in the context of data stream analysis. However, + in our case, application accuracy is driven by the sensing interval and thus, the transmit + frequency of the sensors. Therefore, we varied the transmission interval of the sensors from 1s + to 60s. Some of these results are proposed on Table \ref{tab:sensorsSendIntervalEffects}. In + case of small and sporadic network traffic, these results show that with a reasonable + transmission interval the energy consumption of the IoT/Network if almost not affected by the + variation of this transmission interval. In fact, transmitted data are not large enough to + leverage the energy consumed by the network. + + The number of sensors is a dominant factor that leverage the energy consumption of the IoT/Network part. Therefore, we varied the number of sensors in the Wifi cell to analyze its @@ -264,7 +271,7 @@ component, formatting, style, styling, insert sensors. However, since we are using a single server, large-scale sensors deployment lead to an increasing consumption of energy in the IoT part. On the other side, network energy consumption is stable regarding to the number of sensors since the system use case do not required large data - transfert. Thus, it is important to remember that, to save energy, we should maximize the number + transfer. Thus, it is important to remember that, to save energy, we should maximize the number of sensors handle by each cloud server while keeping reasonable sensors request intervals. #+BEGIN_EXPORT latex @@ -495,29 +502,29 @@ component, formatting, style, styling, insert - *** Plot Scripts **** Random R Scripts - Figure - #+BEGIN_SRC R :noweb yes :results graphics :file plots/sendFrequency-energy.png + Table sensorsSendInterval~Sensors+NetEnergyconsumption + #+BEGIN_SRC R :noweb yes :results output <<RUtils>> data=loadData("logs/ns3/last/data.csv") - data=data%>%filter(simKey=="SENDINTERVAL",sensorsNumber==15) + sensorsE=data%>%filter(simKey=="SENDINTERVAL",sensorsNumber==15) %>%select(sensorsSendInterval,sensorsEnergy)%>%arrange(sensorsSendInterval) + delay=data%>%filter(simKey=="SENDINTERVAL",sensorsNumber==15) %>%select(sensorsSendInterval,avgDelay)%>%arrange(sensorsSendInterval) + netE=data%>%filter(simKey=="SENDINTERVAL",sensorsNumber==15) %>%select(sensorsSendInterval,networkEnergy)%>%arrange(sensorsSendInterval) + formatData=right_join(sensorsE,netE)%>%right_join(delay)%>%filter(((sensorsSendInterval/10)%%2)!=0) - p=ggplot(data,aes(y=totalEnergy,x=sensorsSendInterval))+ - xlab(getLabel("sensorsSendInterval"))+ylab(getLabel("Sensors And Network\nPower Consumption (W)"))+ - geom_line()+geom_point()+expand_limits(y=c(0,50))+ - guides(color=guide_legend(title="Curves"))+ - theme(axis.title.y.right = element_text(margin = margin(t = 0, r = -13, b = 0, l = 7))) - p=applyTheme(p) + print(t(formatData)) - ggsave("plots/sendFrequency-energy.png",dpi=100, width=3, height=2.8) #+END_SRC #+RESULTS: - [[file:plots/sendFrequency-energy.png]] + : [,1] [,2] [,3] [,4] [,5] + : sensorsSendInterval 10.00000 30.00000 50.00000 70.00000 90.00000 + : sensorsEnergy 13.51794 13.51767 13.51767 13.51767 13.51761 + : networkEnergy 10.44178 10.44167 10.44161 10.44161 10.44161 + : avgDelay 17.81360 5.91265 3.53509 2.55086 1.93848 @@ -653,149 +660,142 @@ component, formatting, style, styling, insert **** Plot In Paper - Power sensors vs network - #+BEGIN_SRC R :noweb yes :results graphics :file plots/numberSensors-WIFINET.png :session *R* - <<RUtils>> + Power sensors vs network + #+BEGIN_SRC R :noweb yes :results graphics :file plots/numberSensors-WIFINET.png :session *R* + <<RUtils>> - data=loadData("logs/ns3/last/data.csv") - data=data%>%filter(simKey=="NBSENSORS") - dataW=data%>%mutate(energy=sensorsEnergy)%>% mutate(type="Sensors") %>% select(sensorsNumber,energy,type) - dataN=data%>%mutate(energy=networkEnergy)%>% mutate(type="Network") %>% select(sensorsNumber,energy,type) + data=loadData("logs/ns3/last/data.csv") + data=data%>%filter(simKey=="NBSENSORS") + dataW=data%>%mutate(energy=sensorsEnergy)%>% mutate(type="Sensors") %>% select(sensorsNumber,energy,type) + dataN=data%>%mutate(energy=networkEnergy)%>% mutate(type="Network") %>% select(sensorsNumber,energy,type) - data=rbind(dataN,dataW) - data=data%>%mutate(sensorsNumber=as.character(sensorsNumber)) - data=data%>%mutate(sensorsNumber=fct_reorder(sensorsNumber,as.numeric(sensorsNumber))) - data=data%>%filter(sensorsNumber%in%c(2,4,6,8,10)) + data=rbind(dataN,dataW) + data=data%>%mutate(sensorsNumber=as.character(sensorsNumber)) + data=data%>%mutate(sensorsNumber=fct_reorder(sensorsNumber,as.numeric(sensorsNumber))) + data=data%>%filter(sensorsNumber%in%c(2,4,6,8,10)) - p=ggplot(data)+geom_bar(aes(x=sensorsNumber,y=energy,fill=type),position="dodge",stat="identity")+ - xlab(getLabel("sensorsNumber"))+ ylab("Power Consumption (W)") + guides(fill=guide_legend(title="")) - p=applyTheme(p)+theme(text = element_text(size=15)) + p=ggplot(data)+geom_bar(aes(x=sensorsNumber,y=energy,fill=type),position="dodge",stat="identity")+ + xlab(getLabel("sensorsNumber"))+ ylab("Power Consumption (W)") + guides(fill=guide_legend(title="")) + p=applyTheme(p)+theme(text = element_text(size=15)) - size=5 - ggsave("plots/numberSensors-WIFINET.png",dpi=90,width=size,height=size-1) - #+END_SRC - - #+RESULTS: - [[file:plots/numberSensors-WIFINET.png]] - - - - - - - Final plot: Energy cloud, network and sensors - - #+BEGIN_SRC R :noweb yes :results graphics :file plots/final.png - <<RUtils>> - - # Load data - data=loadData("./logs/g5k/last/data.csv") - data=data%>%filter(state=="sim",simKey=="nbSensors") + size=5 + ggsave("plots/numberSensors-WIFINET.png",dpi=90,width=size,height=size-1) + #+END_SRC - # Cloud - data10=data%>%filter(nbSensors==20)%>%mutate(energy=mean(energy)) %>% slice(1L) - data100=data%>%filter(nbSensors==100)%>%mutate(energy=mean(energy)) %>% slice(1L) - data300=data%>%filter(nbSensors==300)%>%mutate(energy=mean(energy)) %>% slice(1L) - dataCloud=rbind(data10,data100,data300)%>%mutate(sensorsNumber=nbSensors)%>%mutate(type="Cloud")%>%select(sensorsNumber,energy,type) + #+RESULTS: + [[file:plots/numberSensors-WIFINET.png]] - approx=function(data1, data2,nbSensors){ - x1=data1$sensorsNumber - y1=data1$energy - x2=data2$sensorsNumber - y2=data2$energy + Final plot: Energy cloud, network and sensors + #+BEGIN_SRC R :noweb yes :results graphics :file plots/final.png + <<RUtils>> - a=((y2-y1)/(x2-x1)) - b=y1-a*x1 + # Linear Approx + approx=function(data1, data2,nbSensors){ + x1=data1$sensorsNumber + y1=data1$energy - return(a*nbSensors+b) + x2=data2$sensorsNumber + y2=data2$energy - } + a=((y2-y1)/(x2-x1)) + b=y1-a*x1 + return(a*nbSensors+b) - simTime=1800 + } - # Network - data=read_csv("./logs/ns3/last/data.csv") - data=data%>%filter(simKey=="NBSENSORS") - dataC5=data%>%filter(sensorsNumber==5)%>% mutate(energy=networkEnergy/simTime) %>%select(energy,sensorsNumber) - dataC10=data%>%filter(sensorsNumber==10)%>%mutate(energy=networkEnergy/simTime) %>%select(energy,sensorsNumber) - dataNet=rbind(dataC5,dataC10)%>%mutate(type="Network") - # Sensors - dataS5=data%>%filter(sensorsNumber==5)%>% mutate(energy=sensorsEnergy/simTime) %>%select(energy,sensorsNumber) - dataS10=data%>%filter(sensorsNumber==10)%>%mutate(energy=sensorsEnergy/simTime) %>%select(energy,sensorsNumber) - dataS=rbind(dataS5,dataS10)%>%mutate(type="Sensors") - fakeNetS=tibble( - sensorsNumber=c(20,100,300,20,100,300), - energy=c(dataC10$energy,approx(dataC5,dataC10,100),approx(dataC5,dataC10,300),dataS10$energy,approx(dataS5,dataS10,100),approx(dataS5,dataS10,300)), - type=c("Network","Network","Network","Sensors","Sensors","Sensors") - ) + # Load data + data=loadData("./logs/g5k/last/data.csv") + data=data%>%filter(state=="sim",simKey=="nbSensors") - fakeNetS=fakeNetS%>%mutate(sensorsNumber=as.character(sensorsNumber)) - dataCloud=dataCloud%>%mutate(sensorsNumber=as.character(sensorsNumber)) - data=rbind(fakeNetS,dataCloud)%>%mutate(sensorsNumber=as.character(sensorsNumber)) - data=data%>%mutate(sensorsNumber=fct_reorder(sensorsNumber,as.numeric(sensorsNumber))) - data$type=factor(data$type,ordered=TRUE,levels=c("Sensors","Network","Cloud")) - p=ggplot(data)+geom_bar(position="dodge2",colour="black",aes(x=sensorsNumber,y=energy,fill=type),stat="identity")+ - xlab("Sensors Number")+ylab("Power Consumption (W)")+guides(fill=guide_legend(title="System Part")) - p=applyTheme(p)+theme(text = element_text(size=16)) - ggsave("plots/final.png",dpi=90,width=8,height=5.5) - #+END_SRC + # Cloud + data20=data%>%filter(nbSensors==20)%>%mutate(energy=mean(energy)) %>% slice(1L) + data100=data%>%filter(nbSensors==100)%>%mutate(energy=mean(energy)) %>% slice(1L) + data300=data%>%filter(nbSensors==300)%>%mutate(energy=mean(energy)) %>% slice(1L) + dataCloud=rbind(data20,data100,data300)%>%mutate(sensorsNumber=nbSensors)%>%mutate(type="Cloud")%>%select(sensorsNumber,energy,type) - #+RESULTS: - [[file:plots/final.png]] + # Network + data=loadData("./logs/ns3/last/data.csv") + data=data%>%filter(simKey=="NBSENSORS") + dataN5=data%>%filter(sensorsNumber==5)%>% mutate(energy=networkEnergy) %>%select(energy,sensorsNumber) + dataN10=data%>%filter(sensorsNumber==10)%>%mutate(energy=networkEnergy) %>%select(energy,sensorsNumber) + dataNet=rbind(dataN5,dataN10) + fakeNet=tibble(sensorsNumber=c(20,100,300)) + fakeNet=fakeNet%>%mutate(energy=approx(dataN5,dataN10,sensorsNumber),type="Network") + + # Sensors + dataS5=data%>%filter(sensorsNumber==5)%>% mutate(energy=sensorsEnergy) %>%select(energy,sensorsNumber) + dataS10=data%>%filter(sensorsNumber==10)%>%mutate(energy=sensorsEnergy) %>%select(energy,sensorsNumber) + dataS=rbind(dataS5,dataS10) + fakeS=tibble(sensorsNumber=c(20,100,300)) + fakeS=fakeNet%>%mutate(energy=approx(dataS5,dataS10,sensorsNumber),type="Sensors") + + # Combine Net/Sensors/Cloud and order factors + fakeData=rbind(fakeNet,fakeS,dataCloud) + fakeData=fakeData%>%mutate(sensorsNumber=as.character(sensorsNumber)) + fakeData=fakeData%>%mutate(sensorsNumber=fct_reorder(sensorsNumber,as.numeric(sensorsNumber))) + fakeData$type=factor(fakeData$type,ordered=TRUE,levels=c("Sensors","Network","Cloud")) + + # Plot + p=ggplot(fakeData)+geom_bar(position="dodge2",colour="black",aes(x=sensorsNumber,y=energy,fill=type),stat="identity")+ + xlab("Sensors Number")+ylab("Power Consumption (W)")+guides(fill=guide_legend(title="System Part")) + p=applyTheme(p)+theme(text = element_text(size=16)) + ggsave("plots/final.png",dpi=90,width=8,height=5.5) + #+END_SRC + #+RESULTS: + [[file:plots/final.png]] - Impact of vm size - #+BEGIN_SRC R :noweb yes :results graphics :noweb yes :file plots/vmSize-cloud.png - <<RUtils>> - # Load data - data=loadData("./logs/g5k/last/data.csv") + Impact of vm size + #+BEGIN_SRC R :noweb yes :results graphics :noweb yes :file plots/vmSize-cloud.png + <<RUtils>> - data=data%>%filter(state=="sim",simKey=="vmSize")%>%filter(time<=300) + # Load data + data=loadData("./logs/g5k/last/data.csv") - data=data%>%mutate(vmSize=paste0(vmSize," MB")) - data=data%>%group_by(vmSize)%>%mutate(avgEnergy=mean(energy))%>%ungroup() - p=ggplot(data,aes(x=time, y=energy)) + geom_line()+facet_wrap(~vmSize)+geom_hline(aes(yintercept=avgEnergy),color="Red",size=1.0)+expand_limits(y=c(0,40))+ylab("Server Power Consumption (W)")+ - xlab("Experiment Time (s)") + data=data%>%filter(state=="sim",simKey=="vmSize")%>%filter(time<=300) - p=applyTheme(p) + data=data%>%mutate(vmSize=paste0(vmSize," MB")) + data=data%>%group_by(vmSize)%>%mutate(avgEnergy=mean(energy))%>%ungroup() + p=ggplot(data,aes(x=time, y=energy)) + geom_line()+facet_wrap(~vmSize)+geom_hline(aes(yintercept=avgEnergy),color="Red",size=1.0)+expand_limits(y=c(0,40))+ylab("Server Power Consumption (W)")+ + xlab("Experiment Time (s)") - ggsave("plots/vmSize-cloud.png",dpi=90,height=3,width=6) - #+END_SRC - - #+RESULTS: - [[file:plots/vmSize-cloud.png]] + p=applyTheme(p) + ggsave("plots/vmSize-cloud.png",dpi=90,height=3,width=6) + #+END_SRC - Impact of sensors number - #+BEGIN_SRC R :noweb yes :results graphics :file plots/sensorsNumber-cloud.png - <<RUtils>> - # Load data - data=loadData("./logs/g5k/last/data.csv") + #+RESULTS: + [[file:plots/vmSize-cloud.png]] - data=data%>%filter(state=="sim",simKey=="nbSensors")%>%ungroup() - data=data%>%mutate(nbSensorsSort=nbSensors) - data=data%>%mutate(nbSensors=paste0(nbSensors," Sensors")) - data$nbSensors=fct_reorder(data$nbSensors, data$nbSensorsSort) + Impact of sensors number + #+BEGIN_SRC R :noweb yes :results graphics :file plots/sensorsNumber-cloud.png + <<RUtils>> + # Load data + data=loadData("./logs/g5k/last/data.csv") - data=data%>%group_by(nbSensors)%>%mutate(avgEnergy=mean(energy))%>%ungroup() - p=ggplot(data,aes(x=time, y=energy)) + geom_line()+facet_wrap(~nbSensors)+expand_limits(y=c(0,40))+ylab("Server Power Consumption (W)")+ - xlab("Experiment Time (s)")+geom_hline(aes(yintercept=avgEnergy),color="Red",size=1.0) + data=data%>%filter(state=="sim",simKey=="nbSensors")%>%ungroup() - p=applyTheme(p) - ggsave("plots/sensorsNumber-cloud.png",dpi=90,height=3,width=6) - #+END_SRC + data=data%>%mutate(nbSensorsSort=nbSensors) + data=data%>%mutate(nbSensors=paste0(nbSensors," Sensors")) + data$nbSensors=fct_reorder(data$nbSensors, data$nbSensorsSort) - #+RESULTS: - [[file:plots/sensorsNumber-cloud.png]] + data=data%>%group_by(nbSensors)%>%mutate(avgEnergy=mean(energy))%>%ungroup() + p=ggplot(data,aes(x=time, y=energy)) + geom_line()+facet_wrap(~nbSensors)+expand_limits(y=c(0,40))+ylab("Server Power Consumption (W)")+ + xlab("Experiment Time (s)")+geom_hline(aes(yintercept=avgEnergy),color="Red",size=1.0) + p=applyTheme(p) + ggsave("plots/sensorsNumber-cloud.png",dpi=90,height=3,width=6) + #+END_SRC + #+RESULTS: + [[file:plots/sensorsNumber-cloud.png]] #+BEGIN_SRC R :noweb yes :results graphics :file plots/sensorsNumberLine-cloud.png :session *R:2* <<RUtils>> @@ -814,66 +814,58 @@ component, formatting, style, styling, insert p=applyTheme(p)+theme(text = element_text(size=14))+ expand_limits(y=108) ggsave("plots/sensorsNumberLine-cloud.png",dpi=90,height=4.5,width=4) - #+END_SRC - - #+RESULTS: - [[file:plots/sensorsNumberLine-cloud.png]] - - - #+BEGIN_SRC R :noweb yes :results graphics :file plots/WPS-cloud.png :session *R:2* - <<RUtils>> - # Load data - data=loadData("./logs/g5k/last/data.csv") - - data=data%>%filter(state=="sim",simKey=="nbSensors")%>%ungroup() - - - data=data%>%group_by(nbSensors)%>%mutate(avgEnergy=mean(energy))%>%distinct()%>%ungroup() - data=data%>%distinct(nbSensors,.keep_all=TRUE) - data=data%>%mutate(WPS=(avgEnergy/nbSensors)) - - oldNb=data$nbSensors - data=data%>%mutate(nbSensors=as.character(nbSensors)) - data$nbSensors=fct_reorder(data$nbSensors,oldNb) - p=ggplot(data,aes(x=nbSensors, y=WPS)) + geom_bar(stat="identity")+ - xlab(getLabel("sensorsNumber"))+ylab("Server power cost per sensors (W)") - - p=applyTheme(p)+theme(text = element_text(size=14))+ theme(axis.title.y = element_text(margin = margin(t = 0, r = 8, b = 0, l = 0))) - ggsave("plots/WPS-cloud.png",dpi=90,height=4,width=4) - #+END_SRC - - #+RESULTS: - [[file:plots/WPS-cloud.png]] + #+END_SRC + #+RESULTS: + [[file:plots/sensorsNumberLine-cloud.png]] + + #+BEGIN_SRC R :noweb yes :results graphics :file plots/WPS-cloud.png :session *R:2* + <<RUtils>> + # Load data + data=loadData("./logs/g5k/last/data.csv") + data=data%>%filter(state=="sim",simKey=="nbSensors")%>%ungroup() + data=data%>%group_by(nbSensors)%>%mutate(avgEnergy=mean(energy))%>%distinct()%>%ungroup() + data=data%>%distinct(nbSensors,.keep_all=TRUE) + data=data%>%mutate(WPS=(avgEnergy/nbSensors)) + oldNb=data$nbSensors + data=data%>%mutate(nbSensors=as.character(nbSensors)) + data$nbSensors=fct_reorder(data$nbSensors,oldNb) + p=ggplot(data,aes(x=nbSensors, y=WPS)) + geom_bar(stat="identity")+ + xlab(getLabel("sensorsNumber"))+ylab("Server power cost per sensors (W)") - #+BEGIN_SRC R :noweb yes :results graphics :file plots/sendInterval-cloud.png - <<RUtils>> - # Load data - data=loadData("./logs/g5k/last/data.csv") + p=applyTheme(p)+theme(text = element_text(size=14))+ theme(axis.title.y = element_text(margin = margin(t = 0, r = 8, b = 0, l = 0))) + ggsave("plots/WPS-cloud.png",dpi=90,height=4,width=4) + #+END_SRC - data=data%>%filter(state=="sim",simKey=="sendInterval")%>%ungroup() + #+RESULTS: + [[file:plots/WPS-cloud.png]] - oldSendInterval=data$sendInterval - data=data%>%mutate(sendInterval=paste0(sendInterval,"s")) - data$sendInterval=fct_reorder(data$sendInterval,oldSendInterval) + #+BEGIN_SRC R :noweb yes :results graphics :file plots/sendInterval-cloud.png + <<RUtils>> + # Load data + data=loadData("./logs/g5k/last/data.csv") - data=data%>%group_by(sendInterval)%>%mutate(avgEnergy=mean(energy))%>%ungroup() - print(data) - p=ggplot(data,aes(x=time, y=energy)) + geom_line()+facet_wrap(~sendInterval)+expand_limits(y=c(0,40))+ylab("Server power consumption (W)")+ - xlab("Experiment Time (s)")+geom_hline(aes(yintercept=avgEnergy),color="Red",size=1.0) + data=data%>%filter(state=="sim",simKey=="sendInterval")%>%ungroup() - p=applyTheme(p) - ggsave("plots/sendInterval-cloud.png",dpi=120,height=3,width=6) - #+END_SRC + oldSendInterval=data$sendInterval + data=data%>%mutate(sendInterval=paste0(sendInterval,"s")) + data$sendInterval=fct_reorder(data$sendInterval,oldSendInterval) - #+RESULTS: - [[file:plots/sendInterval-cloud.png]] + data=data%>%group_by(sendInterval)%>%mutate(avgEnergy=mean(energy))%>%ungroup() + print(data) + p=ggplot(data,aes(x=time, y=energy)) + geom_line()+facet_wrap(~sendInterval)+expand_limits(y=c(0,40))+ylab("Server power consumption (W)")+ + xlab("Experiment Time (s)")+geom_hline(aes(yintercept=avgEnergy),color="Red",size=1.0) + p=applyTheme(p) + ggsave("plots/sendInterval-cloud.png",dpi=120,height=3,width=6) + #+END_SRC + #+RESULTS: + [[file:plots/sendInterval-cloud.png]] * Emacs settings :noexport: |
