- Using graphite to check time taken by methods.
- AOPAlliance to intercept the method to perform Automatic logging and monitoring.
- Uses Gauva Cache to save and retrieve the value.
Graphite is a tool responsible for sending Metrics about APIs to another server for analysis. Can formulate the percentiles such as 99th percentile, occurances over a period of time.
- It uses Carbon internally to process requests.
Carbon has 3 states.
- agent - Which accepts the request.
- cache - Which caches the request.
- persistor - Which collects all the data and pushes them to Whisper time-to-time.
MoreInfo
-
Whisper - is a database library, which reads the data from carbon and writes it to DB.
-
Graphite makes use of Timer, Histogram, Meter to mark the time taken, history and number of times the method was hit.
GraphiteReporter sends this report to Graphite server.
Currently the code pushes the data to local graphite server listening to 2003 port. -
Uses AOPAlliance (Method Interceptor) to block calls to API's and create a Timer/Histogram/Meter for each API.
For Configuring Graphite Server in local Follow steps at
- https://www.digitalocean.com/community/tutorials/installing-and-configuring-graphite-and-statsd-on-an-ubuntu-12-04-vps
- https://www.digitalocean.com/community/tutorials/how-to-install-and-use-graphite-on-an-ubuntu-14-04-server
Once installed,
- You can bring up (carbon) the listener which publishes data to graphite server by using
sudo service carbon-cache start
or
sudo service carbon-cache stop (To Stop)
or
sudo service carbon-cache status (For Status)
2. To bring up graphite web server
sudo service apache2 start
or
sudo service apache2 reload
3. The graphite web can be accessed at http://localhost/
Configuration of Graphite:
- for DB connections - /etc/graphite/local_settings.py