20.01.2015 Views

Performance Modeling and Benchmarking of Event-Based ... - DVS

Performance Modeling and Benchmarking of Event-Based ... - DVS

Performance Modeling and Benchmarking of Event-Based ... - DVS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.2. PERFORMANCE MODELING PATTERN 55<br />

interval. The interval between two connections is controlled by the service dem<strong>and</strong> <strong>of</strong> the Trigger<br />

token on the Timer place (S T rigger,T imer ). Since the consumer disconnects immediately after<br />

the pull attempt there is no need to model connection times. We model the scenario as an<br />

endless loop composed <strong>of</strong> four phases. In the first phase, the consumer is disconnected <strong>and</strong> the<br />

Timer is processing the Trigger token. When the Timer has processed the Trigger token, the<br />

second phase starts <strong>and</strong> the connection is established. In the next phase, the consumer tries to<br />

pull an <strong>Event</strong>. Finally, the consumer closes the connection <strong>and</strong> we re-enter the first phase.<br />

In the following we illustrate our modeling approach in more detail:<br />

1. System Initialization<br />

In the beginning, the connections is closed <strong>and</strong> one Trigger token is stored in the depository<br />

<strong>of</strong> the Timer place (end <strong>of</strong> the first phase).<br />

2. Open <strong>and</strong> Close Connections<br />

When the Trigger token is available in the depository <strong>of</strong> the Timer, transition T2 is fired.<br />

Transition T2 implements the establishment <strong>of</strong> a connection (II. phase), the pull attempt<br />

(III. phase) <strong>and</strong> the disconnection (IV. phase). Two possibilities exist (see Figure 4.12):<br />

(a) The connection is established <strong>and</strong> the consumer pulls one <strong>Event</strong> from the Broker<br />

(T2-I ).<br />

(b) The connection is established, but no <strong>Event</strong> is available (T2-II ).<br />

In both cases, the connection has to be closed afterwards. This is implemented by adding<br />

the Trigger token to the Timer queue. When the connection is closed, we are back in the<br />

first phase. After t=S T rigger,T imer 2 , the Timer has processed the Trigger token <strong>and</strong> moves<br />

it to its depository. The next step is to enter the second phase <strong>and</strong> to open a connection<br />

to the broker again.<br />

Note T2-II should only be fired if no <strong>Event</strong> is available in the depository <strong>of</strong> the Broker.<br />

If an <strong>Event</strong> is available, T2-I has to be fired. Again, we have to face the limitation <strong>of</strong> st<strong>and</strong>ard<br />

QPNs that transition priorities are not supported. In this scenario, the easiest way is to define<br />

Firing Weight <strong>of</strong> T2-II<br />

the firing weights <strong>of</strong> the transitions so that<br />

Firing Weight <strong>of</strong> T2-I<br />

is close to zero, i.e. the possibility<br />

that T2-II is fired although a <strong>Event</strong> token exists is close to zero.<br />

QPN Definition<br />

Places:<br />

Place Type Description<br />

Producer S Publishes events.<br />

Broker Q Broker for all incoming events.<br />

Timer Q Timer place (scheduling strategy: Infinite Server).<br />

Consumer S Pulls events from broker.<br />

Colors:<br />

Color<br />

<strong>Event</strong><br />

Trigger<br />

Description<br />

Represents the published event.<br />

Triggers pull comm<strong>and</strong>s.<br />

Init No. <strong>of</strong> Colors:<br />

Color Place Count<br />

Trigger Trigger Store 1<br />

2 Since the Timer is using InfiniteServer as scheduling strategy, the response time <strong>of</strong> the queue for a token<br />

is equal to its service dem<strong>and</strong> (<strong>and</strong> waiting time is zero).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!