Author: Victor Boctor
The Mantis database contains a snapshot of the information at a point in time, hence, the reports on it can only do the same. As far as project management is concerned, it is often needed to track changes over time. For example, how is the number of bugs opened per day and bugs resolved per day vary as the project gets closer to the release date?
This can be done by savings metrics at certain times and then reporting at this metrics. These metrics are called performance counters, and they can be calculated as often as necessary. By default, counters will be calculated daily.
A script will be added that will calculate all the enabled performance counters that are due to calculation. The algorithm should be as follows:
for each enabled counter that is due for calculation calculate the performance counter and record the value. update the next_calc_due on the counter definition.
A company wants to keep a performance counter for the number of issues that has priority 1 and have been open for more than 3 days. This counter is to be called “sla_slips”.
function perf_counter_calc_sla_slips( $p_params ) { $t_priority = $p_params['priority']; // will be set to 1 $t_days = $p_params['days']; // will be set to 3 // calculate the number here and store in $t_counter. return $t_counter; }
I don't understand the original premise, that Mantis only has a snapshot of information as at the current time. It already contain hsitorical data with fields storing when a task was submitted, etc. So the example above “number of issues that has priority 1 and have been open for more than 3 days” is already trivial. SELECT * from bug WHERE date_submitted > now() - 3 AND priority = 1
In projects I've worked on, de-normalising the database in this way has often created a lot more work in the long term than just building more advanced queries. If there is historical information which is lost over time, then perhaps an extra table to keep that information in a revisioned format would be a better option. But from what I've seen so far of Mantis, this appears to not be a problem. — aristedes 2007/04/14 04:04