octachrome / treason

A clone of the card game Coup written in Node.js
Other
138 stars 79 forks source link

Stats jackie #1

Closed JackieNiebling closed 8 years ago

JackieNiebling commented 8 years ago

stats pull request

JackieNiebling commented 8 years ago

The -1 is a magic value that is only used for internal redirection, to avoid having to put booleans and goto like statements in my promise code. I know this id is always invalid and will not exist in the db, so it's going to run through the standard flow and create a new id and save it.

The link looks better under the rankings table and that's now where it lives.

The DB view version is now only updated after the views are successfully updated. The server shuts down if there's an error in initializing the db.

JackieNiebling commented 8 years ago

I am slightly concerned about the time it takes to populate the views with data. Not only does couchDB seem to run the view queries one threaded, it also seems to only do one at a time.

octachrome commented 8 years ago

@JackieNiebling Your concern about time taken to populate views: how long does it take? For how many db objects? And will it ever repopulate the view from empty in production? Or will it only ever update the view incrementally when a new game is saved (this should be much faster)?

JackieNiebling commented 8 years ago

After this latest bunch, it seems this is the performance we can expect: "Spent 1224.207 seconds initialising views" This is with 10,000 players and 100,000 games.