VoltDB/app-metro — pull request #2 by benjaminballard (2014-08-26 20:42:38+00:00)
Title: create and replenish cards during the benchmark

These changes make subtle differences in how the benchmark runs:
1. create and replenish cards at $5 or higher increments (there were too many low-balance or empty cards when starting with only $2.50 or $0 sometimes)
2. refactoring code that generates a card from inline within initialize() to generateCard()
3. sometimes call generateCard() from iterate() to reflect new riders/cards
4. sometimes replenish a random card (reflects a more realistic mix of transactions, and keeps more cards with a positive balance)
5. use a dynamic "cardCount" value that increases as new cards are generated, rather than using the static config.cardcount parameter value. This is just a regular int since this benchmark is single-threaded.

I've tested this and it seems to make the TPS steadier, and the ratio of "Card Swipes" to TPS is higher.

Actually, "Card Swipes" on the dashboard is misleading, those are the successful "Entries", as some swipes result in a negative result when the balance is too low or the weekly or monthly pass has expired. Negative results are not recorded in the activity table.