Page 1 of 1

API Call to get total sum of all users' balances

PostPosted: Wed Jul 15, 2015 12:10 pm
by mantux5
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.

Re: API Call to get total sum of all users' balances

PostPosted: Thu Jul 16, 2015 10:22 am
by Kent Briggs
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

PostPosted: Thu Jul 16, 2015 12:35 pm
by mantux5
Ok. Thank you.

Re: API Call to get total sum of all users' balances

PostPosted: Sat Aug 08, 2015 2:43 pm
by Kent Briggs
A new SystemBalance command has been added to the API in version 4.42. See release notes:

http://www.briggsoft.com/forums/viewtopic.php?f=7&t=2014