API Call to get total sum of all users' balances
API Call to get total sum of all users' balances
As written in the title, I would like Poker Mavens to have an API method to get the sum of all users' balances. This is implemented in the sever program(but not on Remote Admin) already. However, if I want to show this information to people without access to the machine where software is hosted, the only way to display it real-time is to get all user accounts and only then add them up. It uses up quite a lot resources on the webserver as there are over 60 000 users.
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: API Call to get total sum of all users' balances
The server does not have a central chip account so it's just looping through all the selected account balances and calculating the sum. Don't remember why that isn't in the Remote Admin interface but I'll look at adding it there. I could possibly include the total in the SystemStats call in the API. In the mean time, you can minimize the load by calling AccountsList with the Fields parameter only set to "Balance" and use the JSON method to fetch that as a single array.
Re: API Call to get total sum of all users' balances
Ok. Thank you.
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: API Call to get total sum of all users' balances
A new SystemBalance command has been added to the API in version 4.42. See release notes:
http://www.briggsoft.com/forums/viewtop ... f=7&t=2014
http://www.briggsoft.com/forums/viewtop ... f=7&t=2014