List of usage examples for org.springframework.util StopWatch toString
@Override
public String toString()
For custom reporting, call #getTaskInfo() and use the task info directly.
From source file:de.uniwue.dmir.heatmap.point.sources.geo.datasources.RTreeGeoDatasource.java
@Override public void reload() { this.rtree.clear(); StopWatch stopWatch = new StopWatch(); stopWatch.start("getting data"); List<TData> data = super.dataSource.getData(null); stopWatch.stop();/*from w w w . ja v a 2 s. c o m*/ super.logger.debug("getting data - count: {}", data.size()); super.logger.debug("getting data - time: {}", stopWatch.toString()); stopWatch.start("adding data"); for (TData s : data) { GeoCoordinates geoCoordinates = this.mapper.map(s); this.rtree.insert( new float[] { (float) geoCoordinates.getLongitude(), (float) geoCoordinates.getLatitude() }, s); } stopWatch.stop(); super.logger.debug("building r-tree: {}", stopWatch.toString()); }
From source file:de.uniwue.dmir.heatmap.heatmaps.DefaultHeatmap.java
@Override public TTile getTile(TileCoordinates tileCoordinates) { // initializing stop watch StopWatch stopWatch = new StopWatch(); // tile coordinates to top-left reference system TileCoordinates projectedTileCoordinates = this.settings.getTileProjection() .fromCustomToTopLeft(tileCoordinates, this.settings.getZoomLevelMapper()); // loading data seed this.logger.debug("Loading data seed."); stopWatch.start("loading data seed"); TTile tile = this.seed.getTile(projectedTileCoordinates); stopWatch.stop();// w w w .j a va2 s .c om if (tile == null) { this.logger.debug("No data seed available: {}", stopWatch.toString()); } else { this.logger.debug("Done loading data seed: {}", stopWatch.toString()); } // get data this.logger.debug("Loading data points."); stopWatch.start("loading data points"); Iterator<TPoint> externalData = this.pointsource.getPoints(projectedTileCoordinates, this.filter); stopWatch.stop(); this.logger.debug("Done loading data points: {}", stopWatch.toString()); // return null if no data was found if (externalData == null || !externalData.hasNext()) { this.logger.debug("No external data found for this tile: {}", tileCoordinates); if (tile == null) { this.logger.debug("No data seed available for his tile: returnung null."); return null; } else if (!this.returnSeedTilesWithNoExternalData) { this.logger.debug("Data seed available, but no external data found: returning null."); return null; } } // initializing tile if no seed is available if (tile == null) { this.logger.debug("No data seed available; initializing empty tile."); tile = this.tileFactory.newInstance(this.settings.getTileSize(), projectedTileCoordinates); } // add external data to tile this.logger.debug("Adding data points to tile: {}", tileCoordinates); stopWatch.start("adding data points to tile"); int externalDataPointCount = 0; while (externalData.hasNext()) { TPoint externalDataPoint = externalData.next(); this.filter.filter(externalDataPoint, tile, this.settings.getTileSize(), tileCoordinates); externalDataPointCount++; } stopWatch.stop(); this.logger.debug("Done adding {} data points to tile: {}", externalDataPointCount, stopWatch.toString()); return tile; }