Package b4j.report
Class ManagementTrackingReport
java.lang.Object
b4j.report.AbstractReportGenerator
b4j.report.AbstractFileReport
b4j.report.ManagementTrackingReport
- All Implemented Interfaces:
BugzillaReportGenerator
,IConfigurable
public class ManagementTrackingReport extends AbstractFileReport
Creates a tracking report for management purposes. The CSV file produced
tells about number of opened bugs for each calendar week per severity,
the amount of those bugs opened already closed, and the average time
in days that closing a bug needed.
The report allows configuration of severity groups as too many severities might make a report unreadable.
Configuration:
<report class="b4j.report.ManagementTrackingReport"> <outputFile>test-ManagementTrackingReport.csv</outputFile> <!-- Sev groups are optional. All sevs not listed in a group will be tracked individually --> <severityGroup name="URGENT"> <severity>blocker</severity> <severity>critical</severity> <severity>major</severity> </severityGroup> <severityGroup name="MINORS"> <severity>minor</severity> <severity>trivial</severity> </severityGroup> </report>
- Author:
- Ralph Schuster
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
ManagementTrackingReport.SeverityStats
This class implements statistics logic based on severities.protected class
ManagementTrackingReport.WeekStats
Object for collecting statistics based on a week. -
Constructor Summary
Constructors Constructor Description ManagementTrackingReport()
Default constructor. -
Method Summary
Modifier and Type Method Description void
closeReport()
Closes a report.void
configure(org.apache.commons.configuration.Configuration config)
Configures the report.long
getAverageFixTime()
Returns the overall average fix time.int
getClosedCount()
Returns the overall number of open bugs.int
getMaxWeek()
Returns the maximum week number detected.int
getMinWeek()
Returns the minimum week number detected.int
getOpenCount()
Returns the overall number of open bugs.java.util.Map<java.lang.String,ManagementTrackingReport.SeverityStats>
getSeverityStats()
Returns the severity statistics objects.int
getTotalCount()
Returns the overall count of bugs.protected static int
getWeek(int week)
Returns the week in year.java.util.Map<java.lang.Integer,ManagementTrackingReport.WeekStats>
getWeekStats()
Returns the Week statistics objects.protected static int
getYear(int week)
Returns the year for the week ID.void
prepareReport()
Prepares the report.void
registerBug(Issue bug)
Registers a bug for the report.Methods inherited from class b4j.report.AbstractReportGenerator
getBugzillaSession, getMaximumBugzillaVersion, getMinimumBugzillaVersion, setBugzillaSession
-
Constructor Details
-
ManagementTrackingReport
public ManagementTrackingReport()Default constructor.
-
-
Method Details
-
closeReport
public void closeReport()Closes a report. Implementations should persist its collected data or results here.- See Also:
BugzillaReportGenerator.closeReport()
-
configure
public void configure(org.apache.commons.configuration.Configuration config) throws org.apache.commons.configuration.ConfigurationExceptionConfigures the report.- Specified by:
configure
in interfaceIConfigurable
- Overrides:
configure
in classAbstractFileReport
- Parameters:
config
- - the configuration object- Throws:
org.apache.commons.configuration.ConfigurationException
- - when a configuration problem occurs- See Also:
AbstractFileReport.configure(Configuration)
-
prepareReport
public void prepareReport()Prepares the report.- Specified by:
prepareReport
in interfaceBugzillaReportGenerator
- Overrides:
prepareReport
in classAbstractReportGenerator
- See Also:
BugzillaReportGenerator.prepareReport()
-
registerBug
Registers a bug for the report.- Parameters:
bug
- - the bug to collect data from- See Also:
BugzillaReportGenerator.registerBug(b4j.core.Issue)
-
getAverageFixTime
public long getAverageFixTime()Returns the overall average fix time.- Returns:
- average fix time in calendar days.
-
getSeverityStats
Returns the severity statistics objects.- Returns:
- the severityStats
-
getWeekStats
Returns the Week statistics objects.- Returns:
- the weekStats
-
getOpenCount
public int getOpenCount()Returns the overall number of open bugs.- Returns:
- the openCount
- See Also:
Issue.isOpen()
-
getClosedCount
public int getClosedCount()Returns the overall number of open bugs.- Returns:
- the closedCount
- See Also:
Issue.isClosed()
-
getTotalCount
public int getTotalCount()Returns the overall count of bugs.- Returns:
- the totalCount
-
getMinWeek
public int getMinWeek()Returns the minimum week number detected.- Returns:
- the minWeek
-
getMaxWeek
public int getMaxWeek()Returns the maximum week number detected.- Returns:
- the maxWeek
-
getWeek
protected static int getWeek(int week)Returns the week in year.- Parameters:
week
- - week ID- Returns:
- week no in year
-
getYear
protected static int getYear(int week)Returns the year for the week ID.- Parameters:
week
- - week ID- Returns:
- year
-