Skip to main content
Jump to: navigation, search

Riena/Getting Started with Client Monitoring

< Riena
Revision as of 04:29, 9 January 2009 by (Talk | contribs) (Components)

Getting Started with Client Monitoring

We know now that in the early years of the twentieth century this world was being watched closely by intelligences greater than man's, and yet as mortal as his own. We know now that as human beings busied themselves about their various concerns they were scrutinized and studied, perhaps almost as narrowly as a man with a microscope might scrutinize the transient creatures that swarm and multiply in a drop of water. With infinite complacence people went to and fro over the earth about their little affairs, serene in the assurance of their dominion over this small, spinning fragment of solar driftwood which, by chance or design, man has inherited out of the dark mystery of Time and Space. Yet across an immense ethereal gulf, minds that are to our minds as ours are to the beasts in the jungle, intellects vast, cool and unsympathetic, regarded this earth with envious eyes and slowly and surely drew their plans against us. ...

Orson Welles, 1938, from the original script of the radio adaption of "War of the Worlds" by H.G. Wells

Oh, no, stop! No, that's of course NOT the intent of Client Monitoring.

Use Case

The problem that we want to help solving with Client Monitoring is to automatically provide the operators of business applications with measurements about the health and/or usage of a system. With this information a system can be optimized (e.g. bugs fixed, user interface improved, etc.) before the user of the system stumbles upon these issues.
Furthermore the automatically provided information can be much more precise than bug reports entered by the user - can because the developers of the application are now responsible for providing the necessary information, not the user. Remember the targeted user of a Riena application is not a developer.

Possible kind of measurements:

  • logging data, e.g. certain events produced by Eclipse's LogService
  • usage data
    • more technical, e.g. bundle state change
    • user interface usage tracking
    • tracking of application function usage
  • ..


The Client Monitoring requires two bundles

  • org.eclipse.riena.monitor.common - containing classes and interfaces that are common to both client and server side of the application. This is a necessity when using Riena's communication
  • org.eclipse.riena.monitor.client - containing the aliens - ehm - no the workhorses

The structure of the Client Monitoring is quite simple. There are a bunch of collectors gathering the required information and passing them to the aggregator. The aggregator puts this information in a store and activates the sender. The sender transmits the information to the receiver which is usually a Riena remote service. Activation of the sender is usually triggered by the collectors but can also triggered by any other component.

Riena Cient Monitoring Components.PNG


Collectors gather the information that should be transferred to the server. They have to either implement the interface org.eclipse.riena.monitor.client.ICollector or extend org.eclipse.riena.monitor.client.AbstractCollector - extending the AbstractCollector is easier. There are already a few ready to use collectors, e.g the LogServiceCollector. All collectors have to be defined with the extension point org.eclipse.riena.monitor.collectors.


Obviously the LogServiceCollector listens to log service events and records them. It has to be defined with something like that:

<extension point="org.eclipse.riena.monitor.collectors">
        class="org.eclipse.riena.monitor.client.LogServiceCollector: collectRange=1..3; triggerRange=1, 2">

The attribute category gives the collector a unique name. This is because the same class implementing a collector can be used for different purposes. The attribute maxItems defines the maximum number of logged items that shall be kept within the local store. The attribute class defines the collector class and contains additional configuration settings. These settings are collector specific.
In the example above there are two required parameters collectRange and triggerRange. Both parameters are of type range. A range defines a set of integers (see org.eclipse.riena.monitor.client.Range), e.g.

  • 1..3 - is a interval containing 1, 2 and 3
  • 1,2 - are simply the values 1 and 2
  • 1..3, 5,7 - is a interval containing 1, 2, 3, 5 and 7

These integers are the log levels defined by org.osgi.service.log.LogService. So, for the above defined LogServiceCollector this means collect (collectRange) all logs that are INFO (3), WARNING (2) or ERROR (1) and trigger transmission (triggerRange) on WARNING (2) or ERROR (1).

With the configuration capabilities of the LogServiceCollector it also possible to define another collector that listens to custom log levels, i.e. application specific log levels, e.g.

<extension point="org.eclipse.riena.monitor.collectors">
        class="org.eclipse.riena.monitor.client.LogServiceCollector: collectRange=-2..0; triggerRange=-2"


The aggregator org.eclipse.riena.internal.monitor.client.Aggregator is implemented as a OSGi service and responsible for

  • the configuration of the client monitoring, e.g. evaluating the extensions (collector, store and sender)
  • life cycle
  • aggregating all the information from the collectors
  • and delegating tasks to the store and the sender

The aggregator is not meant to be replaced by custom implementations.


There is already a simple store implementation org.eclipse.riena.internal.monitor.client.SimpleStore that stores the collected items within compressed and encrypted files. This simple store gets configured with:

extension point="">
        class="org.eclipse.riena.monitor.client.SimpleStore:cleanupDelay=1 h">

This simple store performs cleanups (i.e. removable of transmitted items) within given periods defined by the cleanupDelay property. This period is defined with a simple syntax that does not allow fractions but allows to use time units, e.g. 1 h 30 m 20 s 3 ms. It is of course possible to define another store implementation with this extension point. The store just has to implement org.eclipse.riena.monitor.client.IStore.


Same as with the store there is also a simple sender implementation org.eclipse.riena.monitor.client.SimpleSender. This implementation expects that an OSGi service for the interface org.eclipse.riena.monitor.common.IReceiver exists. This service is than used for transferring the items to the receiver. Within Riena the receiver is usually a server component and the service is a remote service that has been made accessible with Riena communications (see Riena communications how to do that). The sender has to be configured like this:

extension point="org.eclipse.riena.monitor.sender">
        class="org.eclipse.riena.monitor.client.SimpleSender:retryTime=20 m">

The simple sender can be configured with a retryTime property. This time specifies the duration between retries when sending has failed. The syntax for the retryTime is the same as for the cleanupDelay of the store.


The receiver is usually a server component that is exposed to the client as a Riena remote service. There is (yet) no ready to use simple receiver because it is too dependent on the customers use case. I.e. what should happen with the transmitted items? Should they be stored in a database or in the file system? Should administrators be notified when certain patterns occur? And, and ... To register the receiver on the client you need something like that:

new RemoteServiceFactory().createAndRegisterProxy(IReceiver.class, "http://localhost:8080/hessian/CollectibleReceiverWS", PROTOCOL_HESSIAN, context);

While on the server there needs to be something like this to publish the service:

Hashtable<String, String> properties = new Hashtable<String, String>(3);
properties.put(RSDPublisherProperties.PROP_IS_REMOTE, Boolean.TRUE.toString());
properties.put(RSDPublisherProperties.PROP_REMOTE_PATH, "/CollectibleReceiverWS");
IReceiver monitoringReceiver = new SimpleMonitoringReceiver();
context.registerService(IReceiver.class.getName(), monitoringReceiver, properties);

Wrap up

Integrating client monitoring is simple:

  • add the common bundle to both the client and the server
  • configure the collectors, the store and the sender on the client
  • create a receiver on the server and register it as a remote service on the client

That's it!

Back to the top