TestStatsCollectorCallback callback = new TestStatsCollectorCallback();
collector.registerStatsCallback(callback);
// Add 2 collectors for DB1
PhysicalPartition p1 = new PhysicalPartition(1, "db1");
PhysicalPartition p2 = new PhysicalPartition(2, "db1");
DbusEventsStatisticsCollector c1 =
new DbusEventsStatisticsCollector(1, "db1:1", true, false, null);
DbusEventsStatisticsCollector c2 =
new DbusEventsStatisticsCollector(1, "db1:2", true, false, null);
collector.addStatsCollector(p1, c1);
collector.addStatsCollector(p2, c2);
// Add 2 collectors for DB2
PhysicalPartition p3 = new PhysicalPartition(1, "db2");
PhysicalPartition p4 = new PhysicalPartition(2, "db2");
DbusEventsStatisticsCollector c3 =
new DbusEventsStatisticsCollector(1, "db2:1", true, false, null);
DbusEventsStatisticsCollector c4 =
new DbusEventsStatisticsCollector(1, "db2:2", true, false, null);
collector.addStatsCollector(p3, c3);
collector.addStatsCollector(p4, c4);
// Add 2 collectors for DB3
PhysicalPartition p5 = new PhysicalPartition(3, "db3");
PhysicalPartition p6 = new PhysicalPartition(4, "db3");
DbusEventsStatisticsCollector c5 =
new DbusEventsStatisticsCollector(1, "db3:3", true, false, null);
DbusEventsStatisticsCollector c6 =
new DbusEventsStatisticsCollector(1, "db3:4", true, false, null);
collector.addStatsCollector(p5, c5);