## 4 Experimental Design
### Data Collection Process, Experiments, and Preliminary Results
#### 4.3.2 Comparative Analysis and Preliminary Results  
To perform the comparative analysis, it is essential to consider that the results on which the analysis is based are those generated with the JMeter tool. Additionally, the analysis is generated with NewRelic to corroborate and validate the given results. The application's performance consists of various tasks, such as analyzing the results of the stress test, focusing on the number of requests generated, and the time it takes to process them. If they finished successfully, it releases a response from the server.  
In Case 1, a total of 273 of the requests generated have been processed successfully in both scenarios. In Case 2, there were 1053 requests. The application with microservices has successfully terminated all requests, while in Scenario 1 with the Monolithic application, two requests ended with an error. The tests' execution time demonstrates that with Monolithic, it delayed some 00:01:50 while in microservices, it lasted as low as 00:01:29, with some 00:00:21 seconds of difference in favor. Similarly, the number of requests processed per second improves using the Microservices Application. Case 1 performed with 2.5 s in Monolithic and 3.1 s in microservices (difference of 0.6 s), while in Case 2, we reached 1.2 s in Monolithic and 1.4 s in microservices (0.2 s in favor).  
For the analysis of the CPU performance, memory, disk operations, and network performance, a mathematical model was chosen considering that the given information recorded in the log files related to each of the scenarios could not be sufficiently clear. Besides, while having high amounts of data, it was decided to apply this mathematical formula to express the relationships between the variables and their measurements to study both architectures' performance.  
The following matrices are examples of the data initially collected and refined, corresponding to the data sets of the microservices variables performance (Table 2) and monolithic performance Table 3. The number of elements listed in the tables is barely the first ten when demonstrating the examples of the collected data. From these data, the application of the chosen mathematical model will be explained in the next section. This will determine the relationships between subsets of data and the following variables identified in [8] and described further below.  
* CPU (%)
* Disc reading speed (MB/s)
* Disc writing speed (MB/s)
* Memory (MB)
* Network reception (B/s)
* Network transmission (B/s)  
\begin{table}
\begin{tabular}{l c c c c} \hline \hline  & \multicolumn{2}{c}{**Case 1**} & \multicolumn{2}{c}{**Case 2**} \\ \hline  & **Scenary 1** & **Scenary 2** & **Scenary 1** & **Scenary 2** \\ \hline
**Total Requests** & & & 1053 & 1053 \\ OK & 273 & 273 & 1051 & 1053 \\ Error & 0 & 0 & 2 & 0 \\
**Duration time** & 00:01:50 & 00:01:29 & 00:14:17 & 00:12:08 \\
**Requests/s (average)** & 2.5/s & 3.1/s & 1.2/s & 1.4/s \\
**Duration per request** & & & & \\ Min & 7 ms & 4 ms & 22 ms & 8 ms \\ Max & 3677 ms & 2793 ms & 35,784 ms & 10,832 ms \\ Average & 1150 ms & 936 ms & 3934 ms & 3411 ms \\ Median & 695 ms & 312 ms & 2548 ms & 715 ms \\ Standard deviation & 1094.66 ms & 1082.4 ms & 38.05 ms & 4220.21 ms \\
**Total data** & & & & \\ Received & 85,014.43 KB/s & 105,193.29 KB/s & 86,342.29 KB/s & 102,433.12 KB/s \\ Sent & 0 KB/s & 0 KB/s & 0 KB/s & 0 KB/s \\ \hline \hline \end{tabular}
\end{table}
Table 1: Results of the stress test of both scenarios.