// Update scaled stream statistics
.partitionPersist(new MemoryMapState.Factory(), new Fields("scaledInstance"), new StreamStatisticsUpdater("scaledStreamStats", new StreamStatistics()));
toppology.newDRPCStream("queryStats", localDRPC)
// Convert DRPC args to stat query
.each(new Fields("args"), new TuplifyArgs(), new Fields("featureIndex", "queryType"))
// Query scaled stream statistics
.stateQuery(scaledStreamStatistics, new Fields("featureIndex", "queryType"), new StreamFeatureStatisticsQuery("scaledStreamStats"), new Fields("stats"))
.project(new Fields("stats"));