|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ebay.carad.os.vitalsigns.listeners.AbstractReportingListener com.ebay.carad.os.vitalsigns.listeners.LineGraphImageCreationListener
public class LineGraphImageCreationListener
Generates time series line graphs based on report data.
TODO : go over with fine tooth comb to make sure that it was not changed by port to OS - VS, especially since this is primary report output format
Field Summary | |
---|---|
private long |
eightDaysAgo
|
private static long |
ERROR_MARGIN
|
private long |
fiftySixWksAgo
|
private long |
fiftyThreeWksAgo
|
private long |
fiftyTwoWksAgo
|
private long |
fiftyTwoWksAndDayAgo
|
private long |
hundredFourWeeksAgo
|
private static org.apache.log4j.Logger |
LOGGER
|
private long |
now
|
private long |
oneDayAgo
|
private long |
oneHourAgo
|
private long |
oneMonthAgo
|
private long |
oneMonthAndDayAgo
|
private long |
oneMonthAndHourAgo
|
private long |
oneMonthAndWeekAgo
|
private long |
oneWeekAgo
|
private long |
oneWeekAndHourAgo
|
private long |
twoDaysAgo
|
private long |
twoMonthsAgo
|
private long |
twoWeeksAgo
|
private java.lang.String |
yAxisLabel
|
Constructor Summary | |
---|---|
LineGraphImageCreationListener()
|
Method Summary | |
---|---|
private void |
buildCharts(java.lang.String filebase,
java.lang.String name,
java.util.List data,
java.util.List legend,
boolean createMini)
Creates a main and mini chart for a given data set, and saves them. |
private void |
buildDayChart(IDashboardReport report,
java.lang.String chartBase,
DataPoint[] data)
Builds the day chart. |
private void |
buildHourChart(IDashboardReport report,
java.lang.String chartBase,
DataPoint[] data)
Builds the hour chart. |
private void |
buildMonthChart(IDashboardReport report,
java.lang.String chartBase,
DataPoint[] data)
Builds the month chart. |
private void |
buildWeekChart(IDashboardReport report,
java.lang.String chartBase,
DataPoint[] data)
Builds the week chart. |
private void |
buildYearChart(IDashboardReport report,
java.lang.String chartBase,
DataPoint[] data)
Builds the year chart. |
static org.jfree.chart.JFreeChart |
createChart(java.lang.String yLabel,
java.util.List sets,
java.util.List legend,
boolean showDetail)
Basic chart creation method. |
protected void |
doAfterImagesCreated(float[] reportChanges,
IDashboardReport report,
IDashboardAgent agent)
|
private float[] |
getDeltas(DataPoint[] data)
Returns the week/month/year deltas for the given data set. |
protected java.lang.String |
getYAxisLabel()
Returns the label of the graph's Y-axis. |
private DataPoint |
goBackTo(java.util.Iterator it,
DataPoint current,
long target)
Takes an iterator over a list of Map objects, which have a key for LOGTIME ,
and go back until the current value of LOGTIME is less than or equal to the
target given date. |
protected boolean |
includeDayChart(IDashboardReport rept)
Returns whether this report builds a daily report. |
protected boolean |
includeHourChart(IDashboardReport rept)
Returns whether this report builds an hourly report. |
protected boolean |
includeMonthChart(IDashboardReport rept)
Returns whether this report builds a monthly report. |
protected boolean |
includeWeekChart(IDashboardReport rept)
Returns whether this report builds a weekly report. |
protected boolean |
includeYearChart(IDashboardReport rept)
Returns whether this report builds a yearly report. |
void |
reportRan(IDashboardAgent agent,
IDashboardReport report)
|
private void |
setTimes()
|
void |
setYAxisLabel(java.lang.String label)
Sets the label of the graph's Y-axis. |
Methods inherited from class com.ebay.carad.os.vitalsigns.listeners.AbstractReportingListener |
---|
reportingComplete, reportingException, reportingPreStart |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.ebay.carad.os.vitalsigns.listeners.IReportingListener |
---|
reportingComplete, reportingException, reportingPreStart |
Field Detail |
---|
private static final org.apache.log4j.Logger LOGGER
private java.lang.String yAxisLabel
private static final long ERROR_MARGIN
private long now
private long oneHourAgo
private long oneDayAgo
private long twoDaysAgo
private long oneWeekAgo
private long oneWeekAndHourAgo
private long eightDaysAgo
private long twoWeeksAgo
private long oneMonthAgo
private long oneMonthAndHourAgo
private long oneMonthAndDayAgo
private long oneMonthAndWeekAgo
private long twoMonthsAgo
private long fiftyTwoWksAgo
private long fiftyTwoWksAndDayAgo
private long fiftyThreeWksAgo
private long fiftySixWksAgo
private long hundredFourWeeksAgo
Constructor Detail |
---|
public LineGraphImageCreationListener()
Method Detail |
---|
protected java.lang.String getYAxisLabel()
public void setYAxisLabel(java.lang.String label)
label
- the label to useprivate void setTimes()
private DataPoint goBackTo(java.util.Iterator it, DataPoint current, long target)
LOGTIME
,
and go back until the current value of LOGTIME
is less than or equal to the
target given date.
iterator
- the Iterator
to navigate back withrow
- the current rowtarget
- the date to stop when at or before
private void buildHourChart(IDashboardReport report, java.lang.String chartBase, DataPoint[] data)
report
- the report we are building forchartBase
- the base destination filename for saved filesdata
- the data to chartprivate void buildDayChart(IDashboardReport report, java.lang.String chartBase, DataPoint[] data)
report
- the report we are building forchartBase
- the base destination filename for saved filesdata
- the list of row data to chartprivate void buildWeekChart(IDashboardReport report, java.lang.String chartBase, DataPoint[] data)
report
- the report we are building forchartBase
- the base destination filename for saved filesdata
- the list of row data to chartprivate void buildMonthChart(IDashboardReport report, java.lang.String chartBase, DataPoint[] data)
report
- the report we are building forchartBase
- the base destination file name for saved filesdata
- the list of row data to chartprivate void buildYearChart(IDashboardReport report, java.lang.String chartBase, DataPoint[] data)
report
- the report we are building forchartBase
- the base destination filename for saved filesdata
- the list of row data to chartprivate float[] getDeltas(DataPoint[] data)
data
- the list of row data to chart
private void buildCharts(java.lang.String filebase, java.lang.String name, java.util.List data, java.util.List legend, boolean createMini)
filebase
- the base file name for the charts, to which "-" + name
will be appended.name
- the name of the chart for saving purposes, like "month" or "year"data
- the list of row data to chartlegend
- the legend for the chart (a list of strings)protected boolean includeHourChart(IDashboardReport rept)
protected boolean includeDayChart(IDashboardReport rept)
protected boolean includeWeekChart(IDashboardReport rept)
protected boolean includeMonthChart(IDashboardReport rept)
protected boolean includeYearChart(IDashboardReport rept)
public static org.jfree.chart.JFreeChart createChart(java.lang.String yLabel, java.util.List sets, java.util.List legend, boolean showDetail)
yLabel
- the label for the Y-axissets
- a list of lists -- each one a list of Map
objects, mapping LOGTIME and DATA to millisecond
time and data columns, respectively. Each list becomes a series in the graph.legend
- an array of labels for the data series (a list of strings)showDetail
- if true, shows both the legend and the Y-axis label, and multi series; otherwise just shows no labels and first series.
public void reportRan(IDashboardAgent agent, IDashboardReport report)
reportRan
in interface IReportingListener
reportRan
in class AbstractReportingListener
protected void doAfterImagesCreated(float[] reportChanges, IDashboardReport report, IDashboardAgent agent)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |