com.atlassian.greenhopper.web.rapid.chart
Class IssueCycleTimeCollector
java.lang.Object
com.atlassian.greenhopper.global.AbstractLoggable
com.atlassian.greenhopper.service.charts.AbstractIssueHistoryStatusCallback
com.atlassian.greenhopper.web.rapid.chart.IssueCycleTimeCollector
- All Implemented Interfaces:
- IssueStatusHistoryCallback
public class IssueCycleTimeCollector
- extends AbstractIssueHistoryStatusCallback
Calculates the raw data needed for the Control Chart. There are two things we're interested in: Time the issue spent in each column, and when it
last left the column.
The collector runs over the Lucene change history and buffers the result data, from where it's later transferred into a REST template. There is
some timezone conversion involved still which is slightly out of scope for this, and the REST data structure isn't easy to work with, but if it
becomes a memory proplem (which I rather doubt for a report, load is not going to be that high), we could switch to a streaming solution that fills
the REST template directly.
- Author:
- ahennecke
Method Summary |
void |
afterStatus(com.atlassian.jira.issue.status.Status status)
After one status is done, we're taking all the collected change data (now sorted by change time) and compute the result data. |
java.util.Set<java.lang.String> |
getIssueKeys()
|
IssueCycleTimeCollector.IssueTimesResult |
getIssueTimes(java.lang.String issueKey)
|
org.joda.time.DateTime |
getNow()
|
java.util.Collection<com.atlassian.jira.issue.status.Status> |
getStatuses()
|
void |
statusChangedFrom(java.lang.Long issueId,
java.lang.String issueKey,
org.joda.time.DateTime changeTime,
com.atlassian.jira.issue.status.Status changedFromStatus)
changed away from a status that is in the current column. |
void |
statusChangedTo(java.lang.Long issueId,
java.lang.String issueKey,
org.joda.time.DateTime changeTime,
com.atlassian.jira.issue.status.Status changedToStatus)
changed to a status that is in the current column. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_LEAVE_TIME
public static final long DEFAULT_LEAVE_TIME
- See Also:
- Constant Field Values
IssueCycleTimeCollector
public IssueCycleTimeCollector(java.util.List<Column> columns,
java.util.Map<com.atlassian.jira.issue.status.Status,Column> columnsByStatus)
statusChangedFrom
public void statusChangedFrom(java.lang.Long issueId,
java.lang.String issueKey,
org.joda.time.DateTime changeTime,
com.atlassian.jira.issue.status.Status changedFromStatus)
- changed away from a status that is in the current column. That can be a change inside the column as well, we don't know that at this point.
- Specified by:
statusChangedFrom
in interface IssueStatusHistoryCallback
- Overrides:
statusChangedFrom
in class AbstractIssueHistoryStatusCallback
changeTime
- : time when the change was performed, in UTC
statusChangedTo
public void statusChangedTo(java.lang.Long issueId,
java.lang.String issueKey,
org.joda.time.DateTime changeTime,
com.atlassian.jira.issue.status.Status changedToStatus)
- changed to a status that is in the current column.
- Specified by:
statusChangedTo
in interface IssueStatusHistoryCallback
- Overrides:
statusChangedTo
in class AbstractIssueHistoryStatusCallback
changeTime
- : time when the change was performed, in UTCchangedToStatus
- : the status the issue has changed to
afterStatus
public void afterStatus(com.atlassian.jira.issue.status.Status status)
- After one status is done, we're taking all the collected change data (now sorted by change time) and compute the result data. This helps
reducing memory
- Specified by:
afterStatus
in interface IssueStatusHistoryCallback
- Overrides:
afterStatus
in class AbstractIssueHistoryStatusCallback
getStatuses
public java.util.Collection<com.atlassian.jira.issue.status.Status> getStatuses()
- Returns:
- The statuses to query for. Callbacks will be for each status in the collection, for all issues according to getQuery(), in the order of
the collection.
getIssueKeys
public java.util.Set<java.lang.String> getIssueKeys()
- Returns:
- all the issues that we've gathered data for
getIssueTimes
public IssueCycleTimeCollector.IssueTimesResult getIssueTimes(java.lang.String issueKey)
- Returns:
- the data per issue and column, in the correct format for the chart JS (array where column position denotes index)
getNow
public org.joda.time.DateTime getNow()
Copyright © 2007-2012 Atlassian. All Rights Reserved.