EventSim/Analyzing Simulation Results
Analyzing Simulation Results in Eclipse
- Open the Palladio perspective
- Open the R Visualization view, which is located next to the Project Explorer
- After a simulation run, hit Refresh (Green Arrow Icon)
Under the hood, the R Visualization view will communicate to R in order to generate desired plots and statistics.
A particularly useful (but experimental) feature is the mapping of unbound variables to diagram aesthetics (line color, color, fill color, line type, ...). Unbound variables are all filter stages in the visualisation view that have not value selected. For example, one could map a component's AssemblyContext to the fill color in a response time histogram. Note that this feature is in a early development stage. Mappings can be created and removed via Diagram Settings in the diagram view, i.e. for an open diagram.
Analyzing Simulation Results in R
Open R and try the following commands.
First load measurements from RDS file. When running under Windows, replace "\" by "/".
> mm <- readRDS('<path_to_your_rds_file>')
Let's see what's inside our mm
data frame.
> str(mm)
Classes ‘data.table’ and 'data.frame': 719771 obs. of 11 variables:
$ what : Factor w/ 6 levels "HOLD_TIME","QUEUE_LENGTH",..: 2 3 2 3 2 3 2 3 2 3 ...
$ where.first.type : Factor w/ 5 levels "EntryLevelSystemCall",..: 3 3 3 3 3 3 3 3 3 3 ...
$ where.first.id : Factor w/ 12 levels "_A-_1YEg_Ed2v5eXKEbOQ9g",..: 2 2 2 2 2 2 2 2 2 2 ...
$ where.second.type: Factor w/ 3 levels "EntryLevelSystemCall",..: NA NA NA NA NA NA NA NA NA NA ...
$ where.second.id : Factor w/ 8 levels "_A-_1YEg_Ed2v5eXKEbOQ9g",..: NA NA NA NA NA NA NA NA NA NA ...
$ where.property : Factor w/ 6 levels "hold_time","queue_length",..: 2 3 2 3 2 3 2 3 2 3 ...
$ who.type : Factor w/ 3 levels "Request","SimulatedProcess",..: NA NA NA NA NA NA NA NA NA NA ...
$ who.id : chr NA NA NA NA ...
$ value : num 1 0.01 2 0.01 3 0.01 4 0.01 5 0.01 ...
$ when : num 0 0 0 0 0 0 0 0 0 0 ...
$ AssemblyContext : chr NA NA NA NA ...
- attr(*, ".internal.selfref")=<externalptr>
What metrics are available?
> levels(mm$what)
[1] "HOLD_TIME" "QUEUE_LENGTH" "RESOURCE_DEMAND" "RESPONSE_TIME" "TIME_SPAN" "WAITING_TIME"
What types of measuring points are available?
> levels(mm$where.first.type)
[1] "EntryLevelSystemCall" "ExternalCallAction" "SimActiveResource" "SimPassiveResource" "Start"
Show all measuring points that are of type SimPassiveResource
. There is exactly one such measuring point, carrying the id _BcM9k1E5Ed2iLYgaJYxY7w
.
> unique(mm[mm$where.first.type=="SimPassiveResource",]$where.first.id)
[1] _BcM9k1E5Ed2iLYgaJYxY7w
12 Levels: _A-_1YEg_Ed2v5eXKEbOQ9g _afNs0AMaEeKkGv40lSkX_A _afNs1AMaEeKkGv40lSkX_A _afOT4QMaEeKkGv40lSkX_A ... _vMVroGF7Ed60Nobv0oIepQ
Show how long instances of passive resource _BcM9k1E5Ed2iLYgaJYxY7w
are held by simulated requests:
> summary(mm[mm$where.first.id=="_BcM9k1E5Ed2iLYgaJYxY7w" & mm$what=="HOLD_TIME",]$value)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.375 1.583 4.458 4.865 7.250 10.500
...and draw the distribution of hold times as a histogram.
> hist(mm[mm$where.first.id=="_BcM9k1E5Ed2iLYgaJYxY7w" & mm$what=="HOLD_TIME",]$value, xlab="Hold Time",
ylab="Frequency", main="Hold Time Distribution of Passive Resource _BcM9k1E5Ed2iLYgaJYxY7w", col="gray")