In the WSO2 APIM Gatway, as I explained in my previous post The Basic Architecture of WSO2 APIM - part 3- Gateway & Key Manager - Under the hoods, it has a set of handlers defined per API. One of these handlers is the
which would invoke the
org.wso2.carbon.apimgt.usage.publisher.APIMgtUsageDataPublisher . The
APIMgtUsageDataPublisher is configured to publish the events to the BAM server that has been configured with the APIM.
Illustrated by a diagram is the process of publishing of stats and viewing them on the publisher /store app's
The WSO2 APIM Gateway would publish the events via the thrift protocol to the WSO2 BAM server. The BAM is more likely a BAM cluster in the real world production environment. The BAM server then writes the data to a No Sql database, cassandra. Then the BAM Analyzer to which the APIM tool box is deployed to, will fetch the data batch by batch from the cassandra database. The BAM Analyzer is capable of summarizing the data, by using hive. The hive scripts have to pre written and deployed in the server. The BAM analyzer then will push the summarized data to an RDBMS.
The WSO2 APIM Store and the WSO2 Publisher then will pull the data from the RDBMS and will display the data in the APIM Store and publisher analytics pages.
This is a very brief explanation of what happens in the APIM when statistics are to be displayed.
Detailed information can be found at the references listed below.