Usage statistics in administration UI related
Teamcity > Administration > Usage Statistics
Is there a way for me to programmatically trigger the functionality of 'collect now' button on teamcity Administration screen and get the latest 'Usage Statistics' as and when required from teamcity server in my program?
Please sign in to leave a comment.
Hi Max,
just partially. There is no official API for it, so while there might be a way to work around it, keep in mind that it's not officially supported and its behavior might be changed in the future, even if unlikely. If you would like this to be available via the REST API, please make a request for it on our issue tracker: https://youtrack.jetbrains.com/issues/TW
Now, with that out of the way, the UI doesn't really perform anything extremely complex. When clicking on the "Collect now" button, it just makes a post request with params
, and the server starts collecting them on its own. If you click on download, then it just makes a GET request that gets a properties file. It should be pretty much trivial to replicate this two. You can open the browser network console and you will be able to see them and match all parameters, urls, etc easily. The complex part would be to make sure that you wait long enough on your application, as both calls are asynchronous and the POST request doesn't return the statistics on its own, so you will need to check that on your own.