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.

66 CHAPTER 4. PERFORMANCE ENGINEERING OF EVENT-BASED SYSTEMS<br />

Pattern 8: Time Window<br />

!1‘Disconnect T3 1‘Connected"<br />

1‘Connect" Connection<br />

Timer<br />

1‘Disconnect"<br />

!1‘Connect<br />

Broker<br />

T2<br />

1‘<strong>Event</strong><br />

1‘<strong>Event</strong><br />

T1<br />

Consumer<br />

T2: Disconnect<br />

Timer<br />

Disconnect<br />

Connection<br />

Connected<br />

1 1<br />

1<br />

Timer<br />

Connect<br />

T1: Consume <strong>Event</strong><br />

Broker<br />

1<br />

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

1<br />

Connection<br />

Connected<br />

1<br />

1<br />

Consumer<br />

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

Connection<br />

Conne<br />

cted<br />

T3: Connect<br />

Timer<br />

Connect<br />

Timer<br />

Disconne<br />

ct<br />

Connection<br />

Connected<br />

Figure 4.17: St<strong>and</strong>ard Queue Pattern<br />

Characteristics<br />

• Time-controlled<br />

• <strong>Modeling</strong> <strong>of</strong> a time window<br />

• <strong>Modeling</strong> <strong>of</strong> connections<br />

Example<br />

An event consumer connects to a broker to receive events, stays online for a specified interval<br />

(time window) <strong>and</strong> disconnects afterwards, e.g., a consumer connects every hour for five minutes<br />

to a broker to receive events.<br />

Description<br />

In the previous pattern, we implemented a consumer who connects to the broker, pulls events <strong>and</strong><br />

immediately disconnects. In this pattern, we h<strong>and</strong>le another situation in which the consumer<br />

connects <strong>and</strong> stays online for specified a period. Therefore, we present a way to model a<br />

connection with two states (connected <strong>and</strong> disconnected) in this pattern.<br />

The state change is triggered by two colors named Connect respectively Disconnect. The<br />

Connection itself is modeled by an ordinary place. If the Consumer has established a connection<br />

(transition T3 ), a token Connected is stored in the Connection place <strong>and</strong> a Disconnect token<br />

is sent to the Timer. The Timer controls the time between the state changes: the time a<br />

consumer stays connected (disconnected) is equal to the service dem<strong>and</strong> <strong>of</strong> the Disconnect<br />

token (Connect token) <strong>of</strong> the Timer place. As soon as the Consumer disconnects (triggered by<br />

an Disconnect token), the Connected token is removed from the Connection place by transition

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

Saved successfully!

Ooh no, something went wrong!