Hello All,
Please, let me know, if anyone has insight or advice on below issue:
Application monitors server log and every 10 seconds reads log line. Log line is splitted into 22 values.
These values are charted as vertically split charts.
Functionality wise all is okay, but after 10-12 hours applicaton becomes extremely CPU bound (consumes over 90% of the CPU).
Please, let me know, if there is any way to optimize performance of adding data to the TimeSeries dynamically (or any other related component).
Thank you,
Ron Warshawsky
P.S. Code:
Charts Allocation:
aTimeSeries = new ArrayList();
for ( int i=0; i < logHeader.length; i++ ) {
aTimeSeries.add(
new TimeSeriesCollection(
new BasicTimeSeries(logHeader, com.jrefinery.data.Millisecond.class)
)
);
}
HorizontalDateAxis horizontaldateaxis = new HorizontalDateAxis(null);
CombinedDataset combineddataset01 = new CombinedDataset();
CombinedXYPlot combinedxyplot = new CombinedXYPlot(horizontaldateaxis, 1);
XYPlot tmpXYPlot;
for ( int i=0; i < logHeader.length; i++ ) {
combineddataset01.add( (TimeSeriesCollection)aTimeSeries.get(i) );
tmpXYPlot = new XYPlot( (TimeSeriesCollection)aTimeSeries.get(i) , null, new VerticalNumberAxis(logHeader) );
((VerticalNumberAxis)tmpXYPlot.getVerticalAxis()).setLabelFont(new Font("Courier New",0,6) );
combinedxyplot.add(tmpXYPlot );
}
jfreechart = new JFreeChart(null, JFreeChartConstants.DEFAULT_TITLE_FONT, combinedxyplot, true);
XYPlot xyplot = jfreechart.getXYPlot();
com.jrefinery.chart.XYItemRenderer xyitemrenderer = xyplot.getRenderer();
if(xyitemrenderer instanceof StandardXYItemRenderer)
{
StandardXYItemRenderer standardxyitemrenderer = (StandardXYItemRenderer)xyitemrenderer;
standardxyitemrenderer.setPlotShapes(true);
standardxyitemrenderer.setDefaultShapeFilled(true);
standardxyitemrenderer.setDefaultShapeScale(5D);
}
chartPanel = new ChartPanel(jfreechart);
chartPanel.setChart(jfreechart);
chartPanel.setPreferredSize(new Dimension(500, 270));
jPanel_Chart.add(chartPanel, BorderLayout.CENTER);
Timer Body:
Millisecond millisecond = new Millisecond();
for (int i=0;i<=21;i++ ) {
Double logValue = Double.valueOf(logLineData);
(((TimeSeriesCollection)aTimeSeries.get(i)).getSeries(0)).add(millisecond, logValue);
}
Extremely CPU bound vertically combined dynamic chart
Re: Extremely CPU bound vertically combined dynamic chart
Hi Ron,
I do Face the same problem....
Plz let me know if aware of any way out.
thanks
regards
RaviTeja
I do Face the same problem....
Plz let me know if aware of any way out.
thanks
regards
RaviTeja