Added basic docs for leaderboards, and fixtures
This commit is contained in:
parent
e49d806308
commit
6c35bc36e0
3 changed files with 69 additions and 7 deletions
32
doc/Fixtures/Leaderboards.md
Normal file
32
doc/Fixtures/Leaderboards.md
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
# Leaderboard Fixtures
|
||||||
|
|
||||||
|
* Fixture Name: `leaderboards`
|
||||||
|
|
||||||
|
## Users:
|
||||||
|
|
||||||
|
* Test User1
|
||||||
|
* email: test1@example.com
|
||||||
|
* password: abc123
|
||||||
|
* Test User2
|
||||||
|
* email: test2@example.com
|
||||||
|
* password: abc123
|
||||||
|
* Test User3
|
||||||
|
* email: test3@example.com
|
||||||
|
* password: abc123
|
||||||
|
* Test User4
|
||||||
|
* email: test4@example.com
|
||||||
|
* password: abc123
|
||||||
|
* Test Org
|
||||||
|
* email: test5@example.com
|
||||||
|
* password: abc123
|
||||||
|
|
||||||
|
## Transactions
|
||||||
|
|
||||||
|
Uses the same transactions as the `Transactions` fixtures set.
|
||||||
|
|
||||||
|
## Leaderboards
|
||||||
|
|
||||||
|
Pre calculated leaderboards for all normal leaderboard types.
|
||||||
|
|
||||||
|
* Daily Total/Count
|
||||||
|
* Daily from May 3rd 2017 until July 31st 2017
|
26
doc/Fixtures/Transactions.md
Normal file
26
doc/Fixtures/Transactions.md
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
# Leaderboard Fixtures
|
||||||
|
|
||||||
|
* Fixture Name: `transactions`
|
||||||
|
|
||||||
|
## Users:
|
||||||
|
|
||||||
|
* Test User1
|
||||||
|
* email: test1@example.com
|
||||||
|
* password: abc123
|
||||||
|
* Test User2
|
||||||
|
* email: test2@example.com
|
||||||
|
* password: abc123
|
||||||
|
* Test User3
|
||||||
|
* email: test3@example.com
|
||||||
|
* password: abc123
|
||||||
|
* Test User4
|
||||||
|
* email: test4@example.com
|
||||||
|
* password: abc123
|
||||||
|
* Test Org
|
||||||
|
* email: test5@example.com
|
||||||
|
* password: abc123
|
||||||
|
|
||||||
|
## Transactions:
|
||||||
|
|
||||||
|
One transaction every 10 minutes, starting at August 1st 2017 and going back in
|
||||||
|
time, for each user. All transactions go to Test Org.
|
|
@ -1,12 +1,16 @@
|
||||||
# Leaderboards
|
# Leaderboards
|
||||||
|
|
||||||
|
## Calculation
|
||||||
|
|
||||||
|
The leaderboards are calculated for the previous range - so Daily leaderboards
|
||||||
|
are calculated for the whole of the day before, Weeks from the week before,
|
||||||
|
etc. - The only exception is all time, which is calculated from 00:00 on the
|
||||||
|
current day.
|
||||||
|
|
||||||
## Recalculation
|
## Recalculation
|
||||||
|
|
||||||
To figure out if a Leaderboard needs recalculation, the easiest way is to get
|
Leaderboard recalculation only affects the latest two leaderboards for any set,
|
||||||
the transaction set that it corresponds to, and compare either the sum or count
|
so just need to recalculate the last one and the current one, in that order.
|
||||||
of that result set to the sum of the leaderboard values.
|
This can be done during the regular leaderboard calculation cronjob, so
|
||||||
|
verified transactions will show up in the leaderboards the next day.
|
||||||
|
|
||||||
This can be done at any time, but if recalculation is needed then ALL
|
|
||||||
leaderboards newer than one that doesnt match (of the same type) will need
|
|
||||||
recalculating due to possible position changes, and therefore the trend
|
|
||||||
changing.
|
|
||||||
|
|
Reference in a new issue