mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Burndown Chart
- Added debug output showing calculations. - Made the bias configurable, defaulting to 0.666. - Added 'burndown.bias' to the taskrc.5 man page.
This commit is contained in:
parent
42c0b33f07
commit
955634c35b
3 changed files with 28 additions and 10 deletions
|
@ -306,6 +306,16 @@ comparison of the data. This can be in either the 'side' style, which compares
|
||||||
values side-by-side in a table, or 'diff' style, which uses a format similar to
|
values side-by-side in a table, or 'diff' style, which uses a format similar to
|
||||||
the 'diff' command.
|
the 'diff' command.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B burndown.bias=0.666
|
||||||
|
The burndown bias is a number that lies within the range 0 <= bias <= 1. The bias
|
||||||
|
is the fraction of the find/fix rates derived from the short-term data (last
|
||||||
|
25% of the report) versus the longer term data (last 50% of the report). A
|
||||||
|
value of 0.666 (the default) means that the short-term rate has twice the weight
|
||||||
|
of the longer-term rate. The calculation is as follows:
|
||||||
|
|
||||||
|
rate = (long-term-rate * (1 - bias)) + (short-term-rate * bias)
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B debug=off
|
.B debug=off
|
||||||
Taskwarrior has a debug mode that causes diagnostic output to be displayed.
|
Taskwarrior has a debug mode that causes diagnostic output to be displayed.
|
||||||
|
|
|
@ -80,6 +80,7 @@ std::string Config::defaults =
|
||||||
"recurrence.indicator=R # What to show as a task recurrence indicator\n"
|
"recurrence.indicator=R # What to show as a task recurrence indicator\n"
|
||||||
"recurrence.limit=1 # Number of future recurring pending tasks\n"
|
"recurrence.limit=1 # Number of future recurring pending tasks\n"
|
||||||
"undo.style=side # Undo style - can be 'side', or 'diff'\n"
|
"undo.style=side # Undo style - can be 'side', or 'diff'\n"
|
||||||
|
"burndown.bias=0.666 # Weighted mean bias toward recent data\n"
|
||||||
"\n"
|
"\n"
|
||||||
"# Dates\n"
|
"# Dates\n"
|
||||||
"dateformat=m/d/Y # Preferred input and display date format\n"
|
"dateformat=m/d/Y # Preferred input and display date format\n"
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
//
|
//
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include <iostream> // TODO Remove
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
@ -409,7 +408,6 @@ std::string Chart::render ()
|
||||||
return "No matches.\n";
|
return "No matches.\n";
|
||||||
|
|
||||||
// Create a grid, folded into a string.
|
// Create a grid, folded into a string.
|
||||||
// TODO Upgrade grid to a vector of strings, for simpler optimization.
|
|
||||||
grid = "";
|
grid = "";
|
||||||
for (int i = 0; i < height; ++i)
|
for (int i = 0; i < height; ++i)
|
||||||
grid += std::string (width, ' ') + "\n";
|
grid += std::string (width, ' ') + "\n";
|
||||||
|
@ -893,36 +891,45 @@ void Chart::calculateRates (std::vector <time_t>& sequence)
|
||||||
float fix_rate_50 = 1.0 * total_removed_50 / half_days;
|
float fix_rate_50 = 1.0 * total_removed_50 / half_days;
|
||||||
float fix_rate_75 = 1.0 * total_removed_75 / quarter_days;
|
float fix_rate_75 = 1.0 * total_removed_75 / quarter_days;
|
||||||
|
|
||||||
// TODO Make configurable.
|
// Make configurable.
|
||||||
float bias = 0.666;
|
float bias = (float) context.config.getReal ("burndown.bias");
|
||||||
|
|
||||||
find_rate = (find_rate_50 * (1.0 - bias) + find_rate_75 * bias);
|
find_rate = (find_rate_50 * (1.0 - bias) + find_rate_75 * bias);
|
||||||
fix_rate = (fix_rate_50 * (1.0 - bias) + fix_rate_75 * bias);
|
fix_rate = (fix_rate_50 * (1.0 - bias) + fix_rate_75 * bias);
|
||||||
|
|
||||||
// find rate = ((N added / N days) + 2 * (N added / N days)) / 3.0
|
// Q: Why is this equation written out as a debug message?
|
||||||
// fix rate = ((N removed / N days) + 2 * (N removed / N days)) / 3.0
|
// A: People are going to want to know how the rates and the completion date
|
||||||
|
// are calculated. This may also help debugging.
|
||||||
std::stringstream rates;
|
std::stringstream rates;
|
||||||
rates << "Chart::calculateRates find rate: "
|
rates << "Chart::calculateRates find rate: "
|
||||||
<< "("
|
<< "("
|
||||||
<< total_added_50
|
<< total_added_50
|
||||||
<< " added / "
|
<< " added / "
|
||||||
<< half_days
|
<< half_days
|
||||||
<< " days) + 2 * ("
|
<< " days) * (1.0 - "
|
||||||
|
<< bias
|
||||||
|
<< ") + ("
|
||||||
<< total_added_75
|
<< total_added_75
|
||||||
<< " added / "
|
<< " added / "
|
||||||
<< quarter_days
|
<< quarter_days
|
||||||
<< " days)) / 3.0 = "
|
<< " days) * "
|
||||||
|
<< bias
|
||||||
|
<< ") = "
|
||||||
<< find_rate
|
<< find_rate
|
||||||
<< "\nChart::calculateRates fix rate: "
|
<< "\nChart::calculateRates fix rate: "
|
||||||
<< "("
|
<< "("
|
||||||
<< total_removed_50
|
<< total_removed_50
|
||||||
<< " removed / "
|
<< " removed / "
|
||||||
<< half_days
|
<< half_days
|
||||||
<< " days) + 2 * ("
|
<< " days) * (1.0 - "
|
||||||
|
<< bias
|
||||||
|
<< ") + ("
|
||||||
<< total_removed_75
|
<< total_removed_75
|
||||||
<< " added / "
|
<< " added / "
|
||||||
<< quarter_days
|
<< quarter_days
|
||||||
<< " days)) / 3.0 = "
|
<< " days) * "
|
||||||
|
<< bias
|
||||||
|
<< ") = "
|
||||||
<< fix_rate;
|
<< fix_rate;
|
||||||
context.debug (rates.str ());
|
context.debug (rates.str ());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue