Profiles Reference - dice-project/DICE-Simulation GitHub Wiki
This document describes the most used stereotypes to annotate activity and sequence diagrams in the context of DICE.
Activity and Sequence diagrams are the two behavioral diagrams of UML that DICE considers for performance evaluation. Both kinds of diagrams need to be annotated with stereotypes from MARTE or the DICE Profile — see Design and quality abstractions and Deployment Abstractions for more informations — in order to be simulated. Several DICE stereotypes can be applied to elements in both kinds of diagrams to express the same. For that reason, next we summarize the main stereotypes that may be used in such diagrams to specify the NFP that are relevant to perform a simulation. Please note that tagged-values not specified here may not be supported.
MARTE::MARTE_AnalysisModel::GQAM::GaScenario
(or substereotypes like DICE::DICE_UML_Extensions::DPIM::DpimScenario
, etc.)
A Scenario (DpimScenario) captures system-level behavior and attaches allocations and resource usages to it. It is composed of suboperations called Steps (GaStep).
-
In DICE, applied to:
- UML::Activities::Activity (as a specialization of
UML::Classifiers::NamedElement
) in Activity Diagrams. - UML::Interactions::Interaction (as a specialization of
UML::Classifiers::NamedElement
) in Sequence Diagrams.
- UML::Activities::Activity (as a specialization of
-
Tagged values of interest:
- throughput :
MARTE_Library::Basic_NFP_Types::NFP_Frequency [*]
- respT (response time):
MARTE_Library::Basic_NFP_Types::NFP_Duration [*]
- utilization:
MARTE_Library::Basic_NFP_Types::NFP_Real [*]
- throughput :
Example:
The following expression applied to a DpimScenario specifies that the simulation should calculate (calc
) the mean
response time (respT
) of the scenario, in seconds. That response time should be associated to the $rt
variable.
respT = (expr = $rt, unit = s, statQ = mean, source = calc)
MARTE::MARTE_AnalysisModel::GQAM::GaAnalysisContext
For a given analysis, the context identifies the model elements (diagrams) of interest and specifies global parameters of the analysis.
-
In DICE, applied to:
- UML::Activities::Activity (as a specialization of
UML::Classifiers::NamedElement
).
- UML::Activities::Activity (as a specialization of
-
Tagged values of interest:
-
contextParams :
NFP_String [*]
Strings giving a set of annotation variables defining global properties of this analysis context. Each string should conform to the concrete syntax for variable calls or declarations as defined in B.3.3.12 of the MARTE standard.
IMPORTANT: Variable names must match the following structure:
identifier ::= ("$") (letter|"_") (letter | digit | "_")*.
-
Example:
The following expression specifies that $rt
is an output variable, and $njobs
, $p1
and $t1
are input variables (if unspecified — e.g., $t1
— a variable is considered as input variable). Additionally, the default value for $njobs
is 5
.
contextParams = [ out$rt, in$njobs = 5, in$p1, $t1 ]
Please note that arrays of values are also supported (thus allowing sensitivity analysis):
contextParams = [ out$rt, in$njobs = { 5, 6, 7, 8, 9 }, in$p1, $t1 ]
MARTE::MARTE_AnalysisModel::GQAM::GaWorkloadEvent
A stream of events that initiate system-level behavior. It may be generated in different ways: by a stated arrival process, by an arrival-generating mechanism modeled by a workload generator class, by a timed event and from a trace.
-
In DICE, applied to:
- UML::Activities::InitialNode in an Activity Diagram.
- UML::Interactions::Message (only the first message) in Sequence Diagram.
-
Tagged values of interest:
-
pattern :
MARTE::MARTE_Library::BasicNFP_Types::ArrivalPattern [0..1]
Pattern of arrival events. The pattern can be:
-
closed. It describes a workload characterized by a fixed number of active or potential users or jobs that cycle between executing the scenario. This pattern makes the transformation produce a closed Petri net that is analysed in steady state. The following attributes may be defined:
-
population :
NFP_Integer [0..1]
Size of the workload. This property is required for the automatic analysis of the net, and denotes the initial marking of the place corresponding to this InitialNode.
-
extDelay :
NFP_Duration [0..1]
The delay between the end of one response and the start of the next for each member of the population of system users.
-
-
open. This pattern produces an open Petri net for transient analysis with initial and final transitions that produce and consume tokens. The following mutually exclusive attributes may be defined:
-
[interArrivalTime]:
NFP_Duration [0..1]
The time between successive arrivals. For a Poisson process this is exponentially distributed with $mean = 1/rate$.
-
arrivalRate:
NFP_Frequency [0..1]
The average rate of arrivals.
-
-
-
Example:
A valid GaWorkloadEvent
denoting an initial marking of $njobs
is typically declared as follows:
pattern = (closed = (population = (expr = $njobs)))
MARTE::MARTE_AnalysisModel::GQAM::GaStep
(extends MARTE::MARTE_AnalysisModel::GQAM::GaScenario
)
A GaStep is a part of a Scenario, defined in sequence with other actions.
-
In DICE, applied to:
- UML::Action::Action in an Activity Diagram using the
throughput
orutilization
tagged values to calculate the metric on this Action. - UML::Action::Action in an Activity Diagram using the
hostDemand
tagged value to specify its mean execution time. - UML::Activities::ControlFlow (as a specialization of
UML::Classifiers::NamedElement
) in an Activity Diagram using theprob
tagged value to specify the probability of the execution path after aChoiceNode
. - UML::Interactions::ExecutionSpecification in an Sequence Diagram using the
hostDemand
tagged value to specify its mean execution time. - UML::Interactions::Message in an Sequence Diagram using the
hostDemand
tagged value to specify its mean communication time. - UML::Interactions::InteractionOperand in an Sequence Diagram using the
prob
tagged value to specify the probability of executing that execution path.
- UML::Action::Action in an Activity Diagram using the
-
Tagged values of interest:
-
hostDemand:
MARTE_Library::Basic_NFP_Types::NFP_Duration [*]
The cpu demand in units of operations, if all Steps are on the same host.
-
prob:
MARTE_Library::Basic_NFP_Types::NFP_Real [0..1] = 1
The probability of the step to be executed (for a conditional execution).
-
Examples:
The following hostDemand
declarations can be applied to an Action to specify that the mean execution time is 2 seconds
.
hostDemand = (value = 2, unit = s)
hostDemand = (value = 2, unit = s, statQ = mean)
The following hostDemand
declaration can be applied to an Action to specify that the mean (if unspecified, the statQ
is assumed to be the mean
) execution time is $t1 seconds
.
hostDemand = (expr = $t1, unit = s)
The following hostDemand
declaration can be applied to a ControlFlow to specify that the the probability of this alternative path is $p1
.
prob = (expr = $p1)
MARTE::MARTE_AnalysisModel::PAM::PaLogicalResource
A PaLogicalResource is a stereotype for logical resources (typically UML Artifacts deployed in a UML Node) that represent a run-time instance of a process resource and its properties.
-
In DICE, applied to:
- UML::Deployments::Artifact in an Deployment Diagram using the
poolSize
tagged value to specify the number of instances of an artifact, or theutilization
tagged-value to calculate the resources' utilization.
- UML::Deployments::Artifact in an Deployment Diagram using the
-
Tagged values of interest:
- poolSize:
MARTE_Library::Basic_NFP_Types::NFP_Integer [0..1]
The number of threads for the process.
- utilization:
MARTE_Library::Basic_NFP_Types::NFP_Real [*]
The utilization of the resource.
- poolSize:
Example:
The following poolSize
declarations can be applied to an Artifact to specify the number of instances of the artifact that have been deployed.
poolSize = (value = 2)
The following declaration can be used to calculate the utilization of the artifact:
utilization = (expr = $util, source = calc)
MARTE::MARTE_AnalysisModel::PAM::PaRunTInstance
A PaRunTInstance is a stereotype for a swimlane or lifeline that indicates a run-time instance of a process resource and its properties.
-
In DICE, applied to:
- UML::Interactions::Lifeline in an Sequence Diagram using the
poolSize
tagged value to specify the number of threads of the process.
- UML::Interactions::Lifeline in an Sequence Diagram using the
-
Tagged values of interest:
- poolSize:
MARTE_Library::Basic_NFP_Types::NFP_Integer [0..1]
The number of threads for the process.
- poolSize:
Example:
The following poolSize
declarations can be applied to a Lifeline to specify the number of threads that the lifeline represents.
poolSize = (value = 2)
Cheatsheet
Stereotype | Tagged value | IN/OUT | Applies to | Goal | Example |
---|---|---|---|---|---|
GaAnalysisContext |
context |
IN | Activity |
Used to specify the variables that may be used in this scenario | context = [ $rt, $njobs, $t1, $p1 ] |
GaScenario |
respT / throughput / utilization |
OUT | Activity |
Used to specify the metrics to be calculated on this GaScenario |
respT = (expr = $rt, unit = s, statQ = mean, source = calc) |
GaWorkloadEvent |
pattern |
IN | InitialNode |
Used to define the initial workload (users, jobs, etc.) of the initial node(s) | pattern = (closed = (population = (value = 5))) pattern = (closed = (population = (expr = $njobs))) |
GaStep |
hostDemand |
IN | Action |
Used to define the mean execution time of the Action |
hostDemand = (value = 2, unit = s) hostDemand = (expr = $t1, unit = s) |
GaStep |
respT / throughput / utilization (from GaScenario ) |
OUT | Action |
Used to specify the metrics to be calculated on this Action |
respT = (expr = $rt, unit = s, statQ = mean, source = calc) |
GaStep |
prob |
IN | ControlFlow |
Used to specify the probability of the execution paths leaving a ChoiceNode |
prob = (value = 0.8) prob = (expr = $p1) |
PaLogicalResource |
poolSize |
IN | Artifact |
Used to specify the number of instances | poolSize = (value = 2) |
PaLogicalResource |
utilization |
OUT | Artifact |
Used to calculate the utilization | utilization = (expr = $util, source = calc) |
PaRunTInstance |
poolSize |
IN | Lifeline |
Used to specify the number of threads | poolSize = (value = 2) |