The reasoner for the Content Popularity Estimation use case activates two capabilities exposed by a customised version of TstatRepository interface.
First, it enables the measurement data tranfer between Tstat and the repository. In particular, HTTP logs collected by Tstat are transferred using the streaming indirect export implemented in Tstat's mPlane probe and repository proxies. The code behind the import capability offerend by the TstatRepository interface analyses the URLs in the logs, filters them, and store in a MongoDB instance in real-time. This capability also activates the analysis modules which are in charge of classifying contents stored in MongoDB based on their populairity. Then, the reasoner periodically sends specifications to a capability available in this ad-hoc version of the TstatRepository. This capability allows the reasoner to obtain information about the contents which are the best candidates to be cached in a CDN system, based on their expected future popularity.
The reasoner leverages the APIs of the Python3 client model available in the SDK mPlane reference implementation. The code and a step-by-step guide to run the reasoner are available on GitHub: https://github.com/fp7mplane/demo-infra/tree/master/contentpopularity