<dependency> <groupId>org.easymetrics</groupId> <artifactId>easymetrics-core</artifactId> <version>1.0.0</version> </dependency> import org.easymetrics.core.annotation.Metric; @Metric(name = "MethodExecutionTime", unit = "ms") public void calculateSum(int[] numbers) { } import org.easymetrics.core.EasyMetrics; import org.easymetrics.core.config.EasyMetricsConfig; EasyMetricsConfig config = new EasyMetricsConfig(); EasyMetrics.initialize(config); import org.easymetrics.core.util.Stopwatch; Stopwatch stopwatch = new Stopwatch(); stopwatch.start(); calculateSum(numbers); stopwatch.stop(); stop(stopwatch.elapsedTime()); easymetrics.storage.type=memory easymetrics.monitor.type=console


上一篇:
下一篇:
切换中文