Your proposed statistic keeps a historical record of saved matches, so even after the match expires form the server, it still counts in the user's reputation.
Repbot already detects match events, which is start and both regular and irregular end of matches. The events are stored in a mySQL table. This is needed to enforce Patti's rule that opinions can only be cast 24h after the last match event.
Code:
http://openfibs.svn.sourceforge.net/viewvc/openfibs/trunk/modules/repbot/src/main/java/net/sf/repbot/linelistener/MatchEventListener.java?revision=50&view=markup
Currently these events are garbage collected after 24h, because they no longer can possibly matter for the 24h rule.
The started-vs-finished matches metric boomslang proposes can be implemented as a rather simple extension to this table. First it needed to tell between different match events, start, end, user-logout-during-match. The latter is also already supported by RepBot and can be re-used. The event types are here:
http://openfibs.svn.sourceforge.net/viewvc/openfibs/trunk/modules/repbot/src/main/java/net/sf/repbot/linelistener/Monitor.java?revision=50&view=markupThe rationale for garbage collection was to keep the DB small because it is backed up daily and transfered to a backup location. I consider this too important to break it, or to bloat the DB with years of historic match start/end event data. So we need a refinement of the algorithm which aggregates the counts without the need to keep an arbitrarily long history. A possibility would be to keep the last say 6 month, and after that just keep an integer counter for match start and match end events.
That means that A and B must be calculated from 2 inputs, the elaborate event table for the last 6 months and the aggregated historical data older than 6 month. Given that events years back may be irrelevant, using a sliding window may actually even better. That means the quotient boomslang proposes is only calculated over match events for the last say 6 month. That should keep the table at a constant size and still is good enough in my view.
Another alternative, if you guys convince me that we really need an arbitrarily long history, is to exclude the match event table from the backup. Local disk space is a non-issue, of course. The rationale here is that if I am struck by lightening tomorrow, anybody must be able to pick up source and DB backup and continue RepBot. That wouldn't be the case if RepBot relied on private files only available on my server.
One obvious problem is that Repbot is not always online, so it would miss counting some matches - perhaps even resulting in some players having more completed matches than matches. I don't think this is a showstopper, but something to consider.
Repbot has an uptime of 99%, it basically only goes offline for a minute if the server kernel or repbot itself is updated. Recovery after fibsquakes is good, repbot typically is one of the first bots back online after a server hickup. I am with Patti here: this is a game server and not a financial industry application. If we lose a few events, I couldn't care less

Implementation wise, each of you is welcome to add the functionality to RepBot. It is open source. My only condition was that it is done cleanly within the existing architecture. Avi Kivity is a genius coder and created excellent, easily maintainable code with a clean OO architecture. I intend to keep RepBot in that shape and will refuse incorporating dirty hacks. That said, 80% of the code needed is already there for the 24h rule, so carefully augmenting it shouldn't break the architecture.
The other issue is how to present the new metric. I can not simply change the output syntax of any command, because legacy bots and clients parse RepBot output and can break. So the new functionality must come as a new command. I would like to see an implementation of my weighted-sum approach here, otherwise for each new idea we need a new command, rendering the command interface hopelessly cluttered in a few years. Always keep in mind the commands are an API 3rd party software outside my control hardcodes. So I am very conservative here and insist on a clean command line interface design which can stand the test of time.
Any takers?