dosubot[bot] commented on issue #2627: URL: https://github.com/apache/incubator-hugegraph/issues/2627#issuecomment-2274822543
<!-- Answer --> Yes, directly calling `histogram.getSnapshot()` without the 30-second interval would have a significant performance impact. The `getSnapshot()` method in the `HistogramWrapper` class is designed to update the snapshot only if 30 seconds have passed since the last update to avoid the performance overhead of frequently calling `histogram.getSnapshot()`, which can be an expensive operation. Removing this interval check would result in `histogram.getSnapshot()` being called every time `getSnapshot()` is invoked, leading to a significant performance impact <sup>[[1]](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-store/hg-store-node/src/main/java/org/apache/hugegraph/store/node/metrics/JRaftMetrics.java)</sup><sup>[[2]](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-store/hg-store-node/src/main/java/org/apache/hugegraph/store/node/metrics/RocksDBMetrics.java)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
