T O P I C R E V I E W |
rlandfair |
Posted - 16 Jan 2007 : 18:37:39 I have downloaded the Java real time graphing demo and was messing with the scrollapplication1 example you had. I added 4 more lines to it and a legend. I then decreased the timer eventTimer2 delay to 100 instead of 1000. My CPU processing went from ~40% to 100% slowly but did not come back down from 100% until I shut down the program. However, when I left the timer eventTimer2 delay at 1000 the processor stayed pretty consistent. We have a client that would like to see data at 10 Hz for 5 different plots on a real time line graph. Is there something that I need to do to keep the processor from being consumed? Is there a buffer I should clear out, should I manually call the garbage collection, or is there anything else I could try?
|
3 L A T E S T R E P L I E S (Newest First) |
quinncurtis |
Posted - 17 Jan 2007 : 13:46:03 Based on the information you have provided, there is not much else you can do to speed it up. You can try and reduce the update rate to 500 msecs (2 Hz) to see if the CPU maxes out at something less than 100%.
Even though the graph updates at 1 Hz, it captures and displays all of the data being sampled at the 10 Hz (or faster) rate. We chose to decouple the data update from the display update, so that we can support samples rates many times faster than the update rate.
|
rlandfair |
Posted - 17 Jan 2007 : 13:12:09 Here is some more information and answers to our questions. I have put my answers in blue.
1. You say you want the display update rate to be 10Hz. What is the actual sample update rate of the data, controlled by timer1 in our example ? 100, which is what I want it to be
2. What is the extent of the graphs time frame, i.e. 10 secs, 5 minutes, 7 hours ? Indefinate.
3. From the time that you start running, how long is it taking to go from 40% CPU to 100% CPU usage. ~30 seconds
4. Turn on the auto truncate capability of each RTProcessVar object your are displaying.
currentTemperature1.setAutoTruncateDataset(true);
run your program and answer question 3 again. ~45 seconds
One other thing. I don't think the data is causing the problem, in eventTimer1, it seems to be the painting. The eventTimer2, which does nothing but call updateDraw() is what seems to be causing the problem. When the delay value is changed from 1000 to 100 is when the problem occurs. The CPU stays pretty stable at a 1000 millisecond delay. I think it will be okay to update the screen every 1 second, I was just wondering if it can be faster by changing something in the code.
|
quinncurtis |
Posted - 16 Jan 2007 : 20:17:01 In any response please supply more information so that we can try and figure out how many data points/second you are actually trying to plot. We can't tell if you are trying to plot 100 points per trace, or 100,000.
1. You say you want the display update rate to be 10Hz. What is the actual sample update rate of the data, controlled by timer1 in our example ?
2. What is the extent of the graphs time frame, i.e. 10 secs, 5 minutes, 7 hours ?
3. From the time that you start running, how long is it taking to go from 40% CPU to 100% CPU usage.
4. Turn on the auto truncate capability of each RTProcessVar object your are displaying.
currentTemperature1.setAutoTruncateDataset(true);
run your program and answer question 3 again.
|
|
|