Why Embedded Mode?
Normally, MoSKito-Central is deployed as a separate application (Standalone mode), offering connection endpoints to be accessed by other applications via RMI, HTTP or other data transfer protocols.
However, in some cases it may be a good idea to embed MoSKito-Central into your app. In case you:
- ... only have a single-node application (with one JVM & one MoSKito-Essential instance),
- ... want to save performance data, taken by MoSKito-Essential, in the app server's filesystem (meaning you have direct access to the storage resource from which your app is running),
having additional remote application is unneeded overhead. In this situation, the Embedded Mode is the most optimal, resource- and time-saving solution.
Embedded Mode Overview
To get a better idea of how the data flows to MoSKito-Central in Embedded Mode, see the diagram below.
The data transfer stages are the following:
- MoSKito plug-in, initiated on a app server (like Tomcat), fetches performance data from MoSKito-Essential, which resides in the target (monitored) web application.
- When started, the Embedded Connector instantiates MoSKito-Control.
- The collected data arrives directly to MoSKito-Central via Embedded Connector.
- The data is processed and stored in application memory, file system (json, xml or csv files) or database.
Thus, the first thing we need is the Embedded Connector which instantiates MoSKito-Central.
Set up Instructions
The setup process involves 3 main stages:
- Declare dependencies.
- Enable MoSKito-Central.
- Configure storages.
In pom.xml of your project you will need to refer to moskito-central:
Please refer to maven for the latest version: http://search.maven.org/#search%7Cga%7C1%7Cmoskito-central
If you use another build tool you will need to put moskito-central.jar and other libs in your project.
To enable MoSKito-Central, add the following plugin to moskito.json configuration file:
The EmbeddedConnector will start a local MoSKito-Central instance.
Storage configuration is the same for both Embedded and Remote Modes.
That is why it is fully described in Configure MoSKito-Central Storage section.
For a working example of embedded Central configuration, please refer to our open-source GitHub MoSKito-Demo Project.