statistics extraction public, to be accessible from other plugins and test scripts
This commit is contained in:
parent
e16107b053
commit
d3f367ff58
|
@ -26,7 +26,7 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: TimeLine.java,v 1.22 2010/01/12 09:11:26 fros4943 Exp $
|
* $Id: TimeLine.java,v 1.23 2010/01/15 10:51:20 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja.plugins;
|
package se.sics.cooja.plugins;
|
||||||
|
@ -543,6 +543,12 @@ public class TimeLine extends VisPlugin {
|
||||||
if (simulation.isRunning()) {
|
if (simulation.isRunning()) {
|
||||||
simulation.stopSimulation();
|
simulation.stopSimulation();
|
||||||
}
|
}
|
||||||
|
logger.info(extractStatistics());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public synchronized String extractStatistics() {
|
||||||
|
StringBuilder output = new StringBuilder();
|
||||||
|
|
||||||
/* Process all events (per mote basis) */
|
/* Process all events (per mote basis) */
|
||||||
ArrayList<MoteStatistics> allStats = new ArrayList<MoteStatistics>();
|
ArrayList<MoteStatistics> allStats = new ArrayList<MoteStatistics>();
|
||||||
|
@ -636,7 +642,7 @@ public class TimeLine extends VisPlugin {
|
||||||
|
|
||||||
/* TODO Watchpoints */
|
/* TODO Watchpoints */
|
||||||
|
|
||||||
logger.info(stats.toString());
|
output.append(stats.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Summary */
|
/* Summary */
|
||||||
|
@ -658,10 +664,10 @@ public class TimeLine extends VisPlugin {
|
||||||
all.onTimeTX /= allStats.size();
|
all.onTimeTX /= allStats.size();
|
||||||
all.onTimeInterfered /= allStats.size();
|
all.onTimeInterfered /= allStats.size();
|
||||||
|
|
||||||
logger.info("SIMULATION AVERAGE:");
|
output.append("SIMULATION AVERAGE:");
|
||||||
logger.info(all.toString());
|
output.append(all.toString());
|
||||||
|
return output.toString();
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
public void trySelectTime(final long time) {
|
public void trySelectTime(final long time) {
|
||||||
java.awt.EventQueue.invokeLater(new Runnable() {
|
java.awt.EventQueue.invokeLater(new Runnable() {
|
||||||
|
|
Loading…
Reference in a new issue