1. Joseph Fonseka & Chamila Adhikarinayake
Last Updated: Oct. 2014
Collecting and
Analyzing API
Statistics
WSO2 API Manager Team
2. *
About the Presenters
๏ Joseph Fonseka
Joseph joined WSO2 in September 2013. He is a Senior Tech Lead
in the WSO2 API Manager team where he focuses on improving
the UX of the API Manager. In addition to his product
development efforts he is also a contributor to the Sahana and
OpenEvsys open-source projects. He is also a FOSS advocate.
๏ Chamila Adhikarinayake
Chamila is Software Engineer at WSO2. Prior to joining WSO2, he
worked at AtLink Communications (Pvt) Ltd. as a trainee Software
Engineer where he was responsible for developing a customer
loyalty application system for Dialog Axiata PLC. He holds a
bachelor’s degree in Computer Science and Engineering from
University of Moratuwa.
3. *
About WSO2
๏ Global enterprise, founded in
2005 by acknowledged leaders in
XML, web services technologies,
standards and open source
๏ Provides only open source
platform-as-a-service for private,
public and hybrid cloud
deployments
๏ All WSO2 products are 100% open
source and released under the
Apache License Version 2.0.
๏ Is an Active Member of OASIS,
Cloud Security Alliance, OSGi
Alliance, AMQP Working Group,
OpenID Foundation and W3C.
๏ Driven by Innovation
๏ Launched first open source API
Management solution in 2012
๏ Launched App Factory in 2Q 2013
๏ Launched Enterprise Store and
first open source Mobile solution
in 4Q 2013
5. *
Introduction
● What API Manager Offers.
● Collecting & Analysing statistic with BAM.
● Analysing & Visualizing Stats ( Example ).
● Real Time data analysis & alerting with CEP.
6. *
Collecting Stats with AM
● API manager push statistical data through event
streams. ( Request, Response & Fault )
● AM event streams can be configured to push data to
CEP & BAM.
● Google Analytics handler can be use to push API
usage data to GA.
7. *
AM Deployment
Back End
Service
Client / Partner
3 3
Event Streams Event Streams
STAT DB
Aggregated Data
Statistical data retrive for
display
1 2
4
5
8. *
Configuring APIM with BAM
● Official Documentation
○ https://docs.wso2.
com/display/AM170/Publishing+API+Runtime+Statisti
cs
● Steps
○ Create a database to store api usage statistics. This
database is shared between API manager and BAM
○ Configure WSO2 AM to publish data to WSO2 BAM
using default publisher agent
○ Deploy toolbox in BAM to analyze and put
summarized data to shared database
10. View Statistics using API Manager
*
● API Runtime Statics - View API usage from API Publisher and
API Store
○ View information related to api subscriptions, api usage,
usage related to api version, etc from API Publisher
○ View application related information
○ These charts can be customized
● Monetization of the API usage - View Billing information from
API Store
○ Generate bills for API consumers on usage
11. *
View Usage Data using BAM
tools
● Published data can be visualized using BAM gadget tools and
reporting tools
○ BAM gadget tools
■ Can configure to query stat database in a constant intervals and
display the data in charts.
○ BAM reports
■ Can create many types of report such as bar chart report, table
report, pie chart, etc.
12. *
Real Time Analysis with CEP
● WSO2 CEP identifies the most meaningful events
within the event cloud, analyzes their impacts, and
acts on them in real time.
● CEP is extremely high performing and massively
scalable.
● It allows you to execute Siddhi queries to process
and Analyse data in an event stream.
13. *
Real Time Dashboard Sample
● We will looking at how to setup a simple dashboard to
monitor per-second request count coming in to an API.
14. *
Sample Setup
Back End
Service
Client / Partner
Real Time 4
Stats (HTTP)
3 3
Event Streams Event Streams
1 2
15. *
Configuring CEP Demo
● Configure API Manager to push event stream to
CEP.
● Create an Execution Plan.
● Configure Output Event Adapters.
● Configure Outflow of a stream.