UML Profile for Schedulability, Performance and Time (UML-SPT)
Part III: UML SPT st step: Model the system using UML. 2nd step: Annotate performance characteristics using the SPT Profile. 3rd step: Translate the UML-SPT diagrams into Petri nets. 4th step: Analyze the Petri nets to obtain performance results. 2
UML-SPT: Introduction January 2005, OMG standard Profile. A Profile is an extension to the semantics of UML that conforms to the meta-model. A specialization, inheriting from the UML standard. A domain-specific interpretation e.g. UML Profile for Enterprise Application Integration; for Distributed Object Computing; Testing Profile; for Software Radio, It should use only standard extension mechanisms: stereotypes, tag values, constraints Additional semantic constraints cannot contradict the general UML semantics. Within the semantic envelope defined by the standard. 3
Specializing UML: Stereotypes and tagged values A stereotype is a specialization of a UML entity, implying a certain interpretation. Integer «clock» Stereotype of Class with added semantics: an active counter whose value changes synchronously with the progress of physical time...a stereotype can extend the class «clock» MyClockClass {resolution = 500 ns} SetTime() Tagged value associated with the «clock» stereotype: tag = value value has a type such as: integer sec ms ns 4
UML-SPT: General Principles Ability to specify quantitative information directly in UML models Key to quantitative analysis and predictive modeling. Flexibility: Users can model their systems using modeling approaches and styles of their own choosing not hamper design. Open to existing and new analysis techniques. Facilitate the use of analysis methods Eliminate the need for a deep understanding of analysis methods. As much as possible, automate the generation of analysis models and the analysis process itself. Using analysis results for: predicting system characteristics (detect problems early). analyze existing system (sizing, capacity planning). 5
UML-SPT: Structure General Resource Modeling Framework <<profile>> RTresourceModeling <<import>> <<profile>> RTtimeModelling <<import>> <<import>> <<import>> Analysis Models <<profile>> SAprofile <<profile>> PAprofile 6
UML-SPT: Structure Schedulability analysis: applied to hard real-time systems to find a schedule that will allow to meet all the system s deadlines. Performance analysis: applied to soft-real time systems with stochastic characteristics. Queuing based methods are used for mean value analysis and/or for checking if soft deadlines are met by the system. 7
Resource: Hardware or software. UML-SPT: Resource Modeling An element whose service capacity is limited, directly or indirectly, by the finite capacities of the underlying physical elements. Resources offer services that have QoS attributes Resource R... set of services Si... QoS of Si Quality of Service (QoS): A specification (usually quantitative) of how well a particular service is (to be) performed. e.g. throughput, capacity, response time The specification of a model element can include: Offered QoS: the QoS that it provides to its clients. Required QoS: the QoS it requires from other components to support its QoS obligations. 8
UML-SPT: Resource Modeling Resources have services that have QoS characteristics Resources and services have instances, and QoS has value Instance +type..n Descriptor ResourceInstance +instance +type..n Resource l /..n ResourceServiceInstance +instance QoSvalue +offeredqos +instance 5007437 Web Services: Architecture, Concepts and +offeredqos Standards +offeredservice..n +type ResourceService / QoScharacteristic +type 9
UML-SPT: Time Modeling ResourceInstance (from CoreResourceModel) TimeValue (from TimeModel) +max imalvalue +currentvalue +resol ution TimeInterval (from TimeModel) +offset +accuracy Clock TimingMec hanism stability drift skew +referenceclock set(time : TimeValue) get() : TimeValue reset() start() pause() Timer isperiodic : Boolean +origin +duration TimedEvent (from TimedEvents) +timestamp..n TimeValue (from TimeModel) +generatedinterrupts ClockInterrupt (from TimedEvents) +generatedtimeouts Timeout (from TimedEvents) 0
UML-SPT: Performance Modeling PerformanceContext..n Workload responsetime priority..n PScenario hostexecutiondemand responsetime..n +resource <<deploys>>..n PResource utilization schedulingpolicy throughput ClosedWorkload population externaldelay OpenWorkload occurrencepattern +successor +root PStep probabilty repetition delay operations interval executiontime {ordered}..n +host 0.. PProcessingResource processingrate contextswitchtime priorityrange ispreemptible PPassiveResource waitingtime responsetime capacity accesstime +predecessor
UML-SPT: Performance Modeling Provides the concepts to annotate the UML models with performance characteristics. Performance context Specify one or more scenarios that are used to explore various dynamic situations involving a set of resources. Scenario Has the attribute responsetime. In our approach a SD is a scenario. QoS requirements are placed on scenarios. a Scenario is a sequence of Steps (predecessor/successor) Scenario has a first Step, which is stereotyped with a workload definition PAopenLoad (stream of requests) with tags for an arrival process (such as Poisson). PAclosedLoad (users or jobs cycling the scenario) with tags for a population and a think time. 2
UML-SPT: Performance Modeling Step a Step inherits from Scenario, so it can be refined as a sub-scenario Has demand, PAdemand tag gives the CPU demand. PAextOp tag defines operations such as file operations, that are not modeled in the UML model but are needed for the performance model (completions) PAdelay specifies a delay that may be part of the operation (a sleep time) a Step has predecessors (giving AND fork and join) and also a probability (giving OR f/j, with suitable interpretation) 3
UML-SPT: Tags for specifying performance values A complex structured string with the following format <performance-value>::=<kind-of-value>, <modifier>, <time-value> where: <kind-of-value> ::= req assm pred msr required, assumed, predicted, measured <modifier> ::= mean sigma kth-mom, <Integer> max percentile <Real> dist Examples: measured CPU demand of a scenario step: {PAdemand = ( msr, mean, (20, ms ))} scenario response time: required and predicted (variable $RT is a placeholder for a performance model result) {PArespTime = ( req, mean, (0, sec )) PArespTime = ( pred, mean, $RT)} 4
UML-SPT: time value Tag type RTtimeValue can represent a wide variety of types related to time, such as: 2:04 (time of day) 5.3, ms (time interval) 2000/0/27 (date) Wed (day of week) $x, ms (parameterized value with name $x) poisson, 5.4, sec (time value with a Poisson distribution) histogram 0, 0.28, 0.44 2, 0.28, 3, ms P=0.28 P=0.44 P=0.28 0 ms ms 2 ms 3 ms 5
UML-SPT: The POP3 example <<PAscenario>> {PAprob=0.8} <<PAscenario>> {PAprob=0.2} User <<PAcontext>> Check Mail Send Mail Performance context Scenario probability psclient / CH.check_mail Step probability UserMainState DO: Thinking {PAprob=0.8} / CH.exit_exec {PAprob=0.2} fsclient 6
UML-SPT: The POP3 example Scenario Message size 7
UML-SPT: The POP3 example pspop3server open_tcp_connection / send_greeting Listening on TCP port 0 Authorization DO: Authorization dele / send_ok Transaction list / send_ok <<PAClosedLoad>> {PApopulation=} / send_ok Update unlock_maildrop quit retr System load / send_text _message / send_attach _message Step probability {PAprob=$P} Sending read_message {PAprob=$Q} Resource demand 8
Wait4User UML-SPT: The POP3 example Username Look4User ClientHost {PAprob=0.2, PAdemand=( ass, dist, (( exponential,5), s. ))} Step probability Resource demand ERR [user not found] OK [user found] {PAprob=0.8, PAdemand=( ass, dist, (( exponential,2), s. ))} {PAprob=0.2, PAdemand=( ass, dist, (( exponential,3), s.))} Wait4Password Password CheckPassword {PAprob=0.8, PAdemand=( ass, dist, (( exponential,), s. ))} [doesn t match] [matches] ERR LockMaildrop {PAprob=0.} [already locked] ERR [not locked] OK {PAprob=0.9} 9
<<PAClosedLoad>> {PApopulation=$N} {PAprob=$P} {PAprob=$Q} fsmclient psmclient Waiting4Entry exit_exec UML-SPT: The POP3 example DeleteMessage send_dele check_mail text_message attach_message ok RetrieveMessage send_retr Greeting send_open_tcp_connection Quitting send_quit ok[not messages_left] ok[messages_left] ok[not new] ok[new] greeting err CheckMessages send_list System load Step probability Resource demand Authentication send_username ok err CheckPassword send_password ok {PAprob=$S} {PAprob=$R} 20
UML-SPT: The POP3 example Network speed :clienthost m:mailclient <<PAspeed>> {( ass,(00,kbps))} <<PAresource>> :Internet :serverhost s:serverhost 2
UML-SPT: Annotations in our proposal (overview) 22
UML-SPT: General Model Processing Framework Software Domain Schedulability/ Performance Domain 23