# Stochastic Model Driven Performance and Availability Planning for a Mobile Edge Computing System
## 4 Evaluation of MEC Performance
### Basic SPN Model for MEC Architectures
#### 4.1.1 Performance Metrics  
Performance metrics are presented in this section, which are used to evaluate the performance of the edge architecture based on its proposed SPN model. The MRT is computed by adopting the [PERSON]'s law [38]. [PERSON]'s law takes into account the number of ongoing requests in a system (_RequestsInProcess_)--mean system size, the arrival rate of new requests (_ARR_), and the MRT. The arrival rate is the inverse of the arrival delay--that is, \(\mathit{ARR}~{}=~{}\frac{1}{\mathit{AD}}\). A stable system is required to compute metrics based on [PERSON]'s law. It means that the arrival rate must be lower or equal than the server processing rate. We assume that the actual arrival rate can be different with the effective one, or discarded  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Type** & **Element** & **Description** \\ \hline Places & P\_Arrival & Arrival of new requests \\  & P\_InputQueue & Availability checking of request queue \\  & P\_MasterInProcess & Requests in the queue of master server \\  & P\_MasterCapacity & Master server capacity \\  & P\_SlavesInProcess & Requests in the queue of the slaves \\  & P\_SlavesCapacity & Slaves server capacity \\ \hline Timed Transitions & AD & Arrival delay between requests \\  & DD & Time to the master server distribute requests among slave nodes \\  & PD & Time spent processing the request by one slave node \\ \hline Marking & MC & Maximum capacity of master server \\  & SC & Maximum capacity of slaves server \\ \hline \hline \end{tabular}
\end{table}
Table 2: Description of the Model Elements.  
due to finite queue size. Then, to obtain the effective arrival rate, we multiply the arrival rate (\(ARR\)) by the probability for the system to accept new requests (\(1-Discard\)) [39]. Therefore, Equation (1) obtains \(MRT\) considering Little's law and the effective arrival rate.  
\[\texttt{MRT}\ =\ \frac{RequestsInProgress}{ARR\times(1-Discard)} \tag{1}\]  
Equation (2) obtains \(RequestsInProcess\). To compute the number of ongoing requests in the system, the analyst must compute the sum of the expected number of tokens, which is deposited in each place representing ongoing requests. In Equation (2), \(Esp(Place)\) represents the statistical expectation of tokens in the \"Place\", where \(Esp(Place)\ =\ (\sum_{t=1}^{n}P(m(Place)=i)\times i)\). In other words, \(Esp(Place)\) indicates the expected mean number of tokens in that place.  
\[\begin{split}\texttt{RequestsInProcess}\ =\ & Esp(P\_MasterInProcess)+\\ & Esp(P\_SlavesInProcess)\end{split} \tag{2}\]  
Equation (3) defines \(Discard\). There must be one token in the input queue (P_ArrivalQueue), and there must be no more resources available to process new requests both in the master and slave nodes. \(P(Place=n)\) computes the probability of \(n\) tokens in that \"Place\".  
\[\begin{split}\texttt{Discard}=P((P\_InputQueue=1)\wedge(P\_Master Capacity=0)\wedge\\ (P\_SlavesCapacity=0)\end{split} \tag{3}\]  
Finally, in addition to \(MRT\), we also calculate resource utilization. Equation (4) gives us the utilization of the master node. Equation (5) gives us the utilization of the slave nodes. The utilization is obtained by dividing the number of tokens of the corresponding place by the capacity of the total resources.  
\[\texttt{U\_Master}\ =\ \frac{Esp(P\_MasterInProcess)}{MC} \tag{4}\]  
\[\texttt{U\_Slaves}\ =\ \frac{Esp(P\_SlavesInProcess)}{SC} \tag{5}\]