timoninmaxim commented on code in PR #298: URL: https://github.com/apache/ignite-extensions/pull/298#discussion_r2063986185
########## modules/performance-statistics-ext/src/test/java/org/apache/ignite/internal/performancestatistics/PerformanceStatisticsPrinterTest.java: ########## @@ -82,6 +94,53 @@ public void afterTest() throws Exception { U.delete(new File(U.defaultWorkDirectory())); } + /** @throws Exception If failed. */ + @Test + public void testSystemViewOperation() throws Exception { + IgniteConfiguration cfg = new IgniteConfiguration(); + cfg.setNodeId(NODE_ID); + + ListeningTestLogger logger = new ListeningTestLogger(new JavaLogger()); + cfg.setGridLogger(logger); + + LogListener lsnr = LogListener.matches("Finished writing system views to performance statistics file:").build(); + logger.registerListener(lsnr); + + String expNodeId; + try (IgniteEx ign = (IgniteEx)Ignition.start(cfg)) { + expNodeId = ign.context().localNodeId().toString(); + + IgniteCache<String, String> cache = ign.createCache("myCache"); + cache.put("key", "value"); + + ign.context().performanceStatistics().startCollectStatistics(); + + assertTrue("Performance statistics writer did not finish.", waitForCondition(lsnr::check, TIMEOUT)); + + ign.context().performanceStatistics().stopCollectStatistics(); + } + + AtomicBoolean hasSysCache = new AtomicBoolean(false); + AtomicBoolean hasMyCache = new AtomicBoolean(false); + + List<String> args = new ArrayList<>(); + args.add("--ops"); + args.add(SYSTEM_VIEW_ROW.name()); + + readStatistics(args, json -> { + if ("cacheGroups".equals(json.get("view").asText())) { + hasSysCache.compareAndSet(false, "ignite-sys-cache".equals(json.get("cacheGroupName").asText())); + hasMyCache.compareAndSet(false, "myCache".equals(json.get("cacheGroupName").asText())); + } + + UUID actualNodeId = UUID.fromString(json.get("nodeId").asText()); Review Comment: readStatistics already check it -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org