prevent blocking or data stream interruption will be determined in Chapter 6, when the
performance impact of the HTTPQoS filter is analysed.
5.3 DBQoSLogger
Since the action of logging parameters to the database has the potential to become a
bottleneck and impact performance, it was decided that the logging should be a non blocking
implementation. To log an instance of
QOSParameters
, an instance of the class
DBQoSLogger
is created whose constructor is passed the instance of
QoSParameters
as
follows.
HTTPQoS.java
1. new DBQoSLogger(QoSParameters);
DBQoSLogger
extends the Tread class in Java, a separate thread of the class
DBQoSLogger
now handles the logging to the database, so blocking will no longer occur.
5.4 QoSParameters
The
QoSParameters
class is used to store information in the HTTPQoS filter as requests and
replies are made. For example in
ingoingFilter
of
HTTPQoS
, QoSParameters is used to store
information such as the time that the request is made, the requestID and various other
parameters that are used for monitoring. Once the information contained in
QoSParameters
needs to be logged, it is passed to
DBQoSLogger
, as described above.
HTTPQoS.java
1. QoSParameters myQOSParameters = new QoSParameters();
2. MyQOSParameters.setRequestTime(System.currentTimeMillis());
3.
MyQOSParameters.setRequestID(this.getRequestID());
a
a
e