+ public static void restrictQueries(ReadGraph graph, int amount, int step, int maxTimeInMs) {
+
+ QueryControl qc = graph.getService(QueryControl.class);
+ long start = System.currentTimeMillis();
+ while(true) {
+ int current = qc.count();
+ if(current < amount) return;
+ qc.gc(graph, step);
+ long duration = System.currentTimeMillis() - start;
+ if(duration > maxTimeInMs) return;
+ }
+
+ }
+
+ public static int countQueries(ReadGraph graph) {
+
+ QueryControl qc = graph.getService(QueryControl.class);
+ return qc.count();
+
+ }
+