API Call to get total sum of all users' balances

Add your suggestions for improving Poker Mavens
Post Reply
mantux5
Posts: 70
Joined: Fri Apr 03, 2015 1:33 pm

API Call to get total sum of all users' balances

Post 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.
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

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

Post 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.
mantux5
Posts: 70
Joined: Fri Apr 03, 2015 1:33 pm

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

Post by mantux5 »

Ok. Thank you.
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

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

Post 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/viewtop ... f=7&t=2014
Post Reply