Ant Zucaro [Sat, 6 Feb 2016 21:21:44 +0000 (16:21 -0500)]
Make the active players/servers/maps use the cache.
Instead of fetching from the base data, the active players/server/maps views
will fetch from the so-called "materialized view" tables instead. These tables
are precomputed and will be MUCH faster, performance-wise. Regular Beaker
caching remains the same for these, and the paginated pages now only support
clicking "more" until the list is exhausted. Perhaps in the future they will be
fetched via JSON and appended to the page in a "never-ending scroll" thing.
Ant Zucaro [Wed, 27 Jan 2016 01:16:57 +0000 (20:16 -0500)]
Force create_dt to start_dt for games.
There's some drift in the database between the two, when in actuality they
should only be milliseconds apart. The start_dt *was* being set via the
application and the create_dt with a database default. The values resulting
from the defaults were sometimes minutes earlier, which doesn't makes sense.
Until the true cause is identified I'll force the two to be the same.
Ant Zucaro [Sat, 23 Jan 2016 15:51:36 +0000 (10:51 -0500)]
Fix the navigation icons. Fixes #161.
For some reason the navigation links were still using the old "glyphicon" font
classes. This meant that the actual "previous" and "next" page links weren't
actually visible, leading to some navigation issues. Changing them to the
font-awesome classes makes them visible again!
Ant Zucaro [Sat, 23 Jan 2016 15:08:41 +0000 (10:08 -0500)]
Whitelist rank game types in the view. Fixes #162.
The game types where you could view ranks were previously controlled by a
regular expression check within the route. This was completely NOT obvious to
troubleshoot. This moves them to within the view, which is much easier to
control. Additionally, a 404-check is added for malformed values.
Ant Zucaro [Sat, 16 Jan 2016 22:36:56 +0000 (17:36 -0500)]
Move MapCapTime and PlayerCapTime to models.
The more I thought about it, the more I think that these two classes should
live inside the models module. They are nothing more than models for views. So
what if they aren't object-relational!
Ant Zucaro [Sun, 29 Nov 2015 15:07:55 +0000 (10:07 -0500)]
Clean up xs_submit.
This was written when I didn't really know that much Golang. I know a little
bit more about it now, so I can at least format accordingly! Also I know how to
use a Scanner now. Shame on my past self...
Ant Zucaro [Sun, 29 Nov 2015 15:05:08 +0000 (10:05 -0500)]
Fetch ranks for the post-match report.
The ranks are updated daily, so they don't change game-per-game for an
individual, but having the rank value still tells people how strong a player
is that they've been playing against.
Ant Zucaro [Thu, 19 Nov 2015 01:29:07 +0000 (20:29 -0500)]
Provide a plaintext response to stats submissions.
For all of XonStat's history the POST requests sent in by servers had plain
HTTP responses. This begins to change with this commit, which responds back to
the Xonotic server with meaningful information about /what happened/ during the
match that was just submitted. Of particular importance are the player_ids and
elo delta values that were stored as a result of the game. The template
establishing the format for this is submit_stats.mako. It will be extended
after we decide what other things we want to include.
Ant Zucaro [Sat, 14 Nov 2015 21:20:33 +0000 (16:20 -0500)]
Refactor the Elo processing code into EloProcessor.
Before, Elo processing was simply a couple of extra methods that mutated
PlayerGameStat and PlayerElo rows, adding them to a session for updating or
inserting later. In order to support an end-of-match game report, we now need
to hold onto to those intermediate values so they can be passed into a
template. To do this I created an EloProcessor class to perform all of the
computation and an EloWIP class to hold onto all of the intermediate values.
EloProcessor can be used to find out what changed during Elo calculations.
Ant Zucaro [Sun, 8 Nov 2015 19:22:01 +0000 (14:22 -0500)]
Clean up the production configuration file.
This includes a little better organization of the production.ini file for
administrators. It includes comments on the different directives, better
indentation, and rotating log files of limited size using Python's
logging.handlers.RotatingFileHandler facility.
Ant Zucaro [Sat, 7 Nov 2015 15:15:54 +0000 (10:15 -0500)]
Don't put anonymous players in games.players
The "games" table has a convenience, de-normalized column for storing the list
of player_ids who played in that game. This is intended for use in quick
searches. Since anonymous players (players having a player_id == 2) aren't
searchable, they don't need to be in this list. This should decrease the
overall size of the GIN index on that column over time.
Ant Zucaro [Wed, 22 Apr 2015 10:48:25 +0000 (06:48 -0400)]
Remove the join to game stats for accuracy data.
This speeds up the game_info view considerably. On my local machine the
requests go from .62 to about .2 seconds! I believe the pgstat rows were
included in the response to show nicknames in the accuracy table.
I'll have to do further checks to ensure that if a pgstat row exists a
corresponding pwstat row exists as well.