topMetrics = new TopMetrics(conf, topConf.nntopReportingPeriodsMs); if (DefaultMetricsSystem.instance().getSource( TOPMETRICS_METRICS_SOURCE_NAME) == null) { "Top N operations by user", topMetrics); auditLoggers.add(new TopAuditLogger(topMetrics));
this.topConf = new TopConf(conf); this.auditLoggers = initAuditLoggers(conf); this.isDefaultAuditLogger = auditLoggers.size() == 1 &&
@Test public void testPresence() { Configuration conf = new Configuration(); TopConf topConf = new TopConf(conf); TopMetrics topMetrics = new TopMetrics(conf, topConf.nntopReportingPeriodsMs); // Dummy command topMetrics.report("test", "listStatus"); topMetrics.report("test", "listStatus"); topMetrics.report("test", "listStatus"); MetricsRecordBuilder rb = getMetrics(topMetrics); MetricsCollector mc = rb.parent(); verify(mc).addRecord(TOPMETRICS_METRICS_SOURCE_NAME + ".windowMs=60000"); verify(mc).addRecord(TOPMETRICS_METRICS_SOURCE_NAME + ".windowMs=300000"); verify(mc).addRecord(TOPMETRICS_METRICS_SOURCE_NAME + ".windowMs=1500000"); verify(rb, times(3)).addCounter(Interns.info("op=listStatus.TotalCount", "Total operation count"), 3L); verify(rb, times(3)).addCounter(Interns.info("op=*.TotalCount", "Total operation count"), 3L); verify(rb, times(3)).addCounter(Interns.info("op=listStatus." + "user=test.count", "Total operations performed by user"), 3L); } }
topMetrics = new TopMetrics(conf, topConf.nntopReportingPeriodsMs); auditLoggers.add(new TopAuditLogger(topMetrics));
this.cacheManager = new CacheManager(this, conf, blockManager); this.safeMode = new SafeModeInfo(conf); this.topConf = new TopConf(conf); this.auditLoggers = initAuditLoggers(conf); this.isDefaultAuditLogger = auditLoggers.size() == 1 &&
topMetrics = new TopMetrics(conf, topConf.nntopReportingPeriodsMs); if (DefaultMetricsSystem.instance().getSource( TOPMETRICS_METRICS_SOURCE_NAME) == null) { "Top N operations by user", topMetrics); auditLoggers.add(new TopAuditLogger(topMetrics));
this.cacheManager = new CacheManager(this, conf, blockManager); this.safeMode = new SafeModeInfo(conf); this.topConf = new TopConf(conf); this.auditLoggers = initAuditLoggers(conf); this.isDefaultAuditLogger = auditLoggers.size() == 1 &&