diff options
author | Ryan Campbell <ryanjcampbell@google.com> | 2017-08-17 15:54:10 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-08-17 15:54:10 +0000 |
commit | 51601ec2815def8bd28c3b48b436ea48c29f0517 (patch) | |
tree | 06b717a1d8a25be35797a5fc21167476dd461758 | |
parent | 0c14cd3995014c86cc553799912cffb991e7eea8 (diff) | |
parent | 869113dfa8a4ffbe8612882da79ff01200680ef8 (diff) | |
download | dashboard-51601ec2815def8bd28c3b48b436ea48c29f0517.tar.gz |
Kick off querying before processing.
am: 869113dfa8
Change-Id: I511a67e3900dbc873f4703747ffa67dae2c4c28b
-rw-r--r-- | src/main/java/com/android/vts/servlet/ShowProfilingOverviewServlet.java | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/main/java/com/android/vts/servlet/ShowProfilingOverviewServlet.java b/src/main/java/com/android/vts/servlet/ShowProfilingOverviewServlet.java index 0f71854..0b28197 100644 --- a/src/main/java/com/android/vts/servlet/ShowProfilingOverviewServlet.java +++ b/src/main/java/com/android/vts/servlet/ShowProfilingOverviewServlet.java @@ -126,26 +126,37 @@ public class ShowProfilingOverviewServlet extends BaseServlet { testName)); List<ProfilingPointEntity> profilingPoints = new ArrayList<>(); - for (Entity e : datastore.prepare(profilingPointQuery).asIterable()) { + for (Entity e : + datastore + .prepare(profilingPointQuery) + .asIterable(DatastoreHelper.getLargeBatchOptions())) { ProfilingPointEntity pp = ProfilingPointEntity.fromEntity(e); if (pp == null) continue; profilingPoints.add(pp); } + Map<ProfilingPointEntity, Iterable<Entity>> asyncEntities = new HashMap<>(); + for (ProfilingPointEntity pp : profilingPoints) { + Query profilingQuery = + new Query(ProfilingPointSummaryEntity.KIND) + .setAncestor(pp.key) + .setFilter(filter); + asyncEntities.put( + pp, + datastore + .prepare(profilingQuery) + .asIterable(DatastoreHelper.getLargeBatchOptions())); + } + Map<String, BoxPlot> plotMap = new HashMap<>(); for (ProfilingPointEntity pp : profilingPoints) { if (!plotMap.containsKey(pp.profilingPointName)) { plotMap.put( - pp.profilingPointName, - new BoxPlot(pp.profilingPointName, null, pp.xLabel)); + pp.profilingPointName, new BoxPlot(pp.profilingPointName, null, pp.xLabel)); } BoxPlot plot = plotMap.get(pp.profilingPointName); Set<Long> timestamps = new HashSet<>(); - Query profilingQuery = - new Query(ProfilingPointSummaryEntity.KIND) - .setAncestor(pp.key) - .setFilter(filter); - for (Entity e : datastore.prepare(profilingQuery).asIterable()) { + for (Entity e : asyncEntities.get(pp)) { ProfilingPointSummaryEntity pps = ProfilingPointSummaryEntity.fromEntity(e); if (pps == null) continue; plot.addSeriesData(Long.toString(pps.startTime), pps.series, pps.globalStats); |