|
Loading
|
||||
Queue system server utilizationA number of monitors for the Queue system example net illustrate different ways in which server utilization can be measured. Server utilization is the percentage of time during which the server is busy processing jobs during a simulation Marking_size_Server'Busy_1
This is a Marking Size monitor that measures the number of tokens on the place
One token on the place Server Utilization
This monitor is used to estimate the utilization of the server. The monitor is associated with the two transitions on the page Server utilization can be estimated by dividing the amount of time that the server is busy during a simulation by the amount of time covered by the simulation. This monitor will use a so-called indicator function to estimate server utilization. The observation function will return the value 1 when the server becomes busy, and the value 0 when the server becomes idle. Timed statistics are calculated for this monitor. At the end of a simulation, the average for this monitor will be equal to the server utilization during the simulation. Monitoring functions
The predicate function returns true when either the
The initialization function returns the value
The stop function returns
As described above, the observation function returns 1 when the server becomes busy (i.e. when the
fun obs (bindelem) =
let
fun obsBindElem (Server'Start (1, {jobs, job,proctime})) = 1
| obsBindElem (Server'Stop (1, {job})) = 0
| obsBindElem _ = ~1
in
obsBindElem bindelem
end
Server utilization advancedThis monitor is similar to the “Server Utilization” monitor. The statistics that are calculated for this monitor will be the same as those for the “Server Utilization” monitor, but fewer data values may be collected for this monitor
This monitor is associated with the places
When the The figure below shows an example of the differences in the data values that are collected for the “Marking_size_Server'Busy_1” monitor, the “Server Utilization” monitor, and this monitor.
Note that most of the statistics for these three monitors will always be the same. The only statistic that may differ is the last time value ( At the end of a simulation, the average for each of the three of these monitors will be equal to the server utilization during the simulation. Total processing time
This generic data collector monitor is used to estimate the amount of time that the server is busy processing jobs during a simulation. The monitor is associated with the The monitor calculates untimed statistics.
The initialization and stop functions both return the value NONE. The predicate function returns true each time the
The observation function examines the binding of the variables when the
fun obs (bindelem) =
let
fun obsBindElem (Server'Start (1, {jobs, job, proctime})) =
Real.fromInt proctime
| obsBindElem _ = ~1.0
in
obsBindElem bindelem
end
When a simulation stops, the sum for this data collector will be an estimate of the amount of time the server was busy.
If the simulation stops when the server is busy and the
If the simulation stops when either the server is idle, or the Server utilization estimate by ProcTimeThis generic data collector monitor is used to estimate the server utilization, and it uses the sum calculated by the “Total Processing Time” monitor. The monitor is associated with a single transition. The monitor will not collect any data before or during a simulation. Only the stop function will be used to collect data, and the stop function will not examine any part of the net. The monitor is associated with a single transition to reduce the number of times that the predicate function will be invoked. If monitor were not associated with any transitions, then the predicate function would be invoked after every step in a simulation, and this is unnecessary. The observation function will never be invoked, but it must be syntactically correct, therefore it is defined so that it would return -1.0.
The stop function returns an estimate of server utilization for the simulation. The function accesses the sum of the “Total Processing Time” monitor ( fun stop () = SOME (Total_Processing_Time.sum() / Real.fromInt(intTime())) This monitor can only calculate an estimate of server utilization because the sum of the “Total Processing Time” monitor is only an estimate of the total processing time (see above for details). In some situations, this monitor will return the correct value for server utilization during a simulation. Server utilization by ProcTimeThis data collector monitor is similar to the “Server Utilization Estimate by ProcTime” monitor. However, this monitor will calculate the proper value for server utilization during a simulation. The monitor is associated with one place and one transition, and it calculates untimed statistics. The stop function for the monitor examines the marking of the place ”“Busy””.
fun stop ([(s,job)@timestamp]) =
let
val curtime = Real.fromInt (intTime())
val proctimeleft = Real.fromInt((IntInf.toInt timestamp)- intTime())
in
SOME ((Total_Processing_Time.sum()-proctimeleft)/curtime)
end
| stop (Server'Busy_1_mark : ServerxJob tms) =
SOME (Total_Processing_Time.sum() / Real.fromInt (intTime()))
The first line of the stop function uses pattern matching to match a marking in which there is only one timed token on the place
The fourth line of the stop function calculates how much processing time remains for the job that is currently being processed. This is done by subtracting the current model time from the time stamp of the token. This will never result in a negative number, because a token will always be removed from the place
The sixth line of the function calculates the server utilization by subtracting the remaining processing time from the total processing time (
The next to last line of the stop function matches all other markings of the place Related pagesQueue system example, Queue system queue delay, Queue system queue length, Queue System Miscellaneous Monitors |
||||