-
Notifications
You must be signed in to change notification settings - Fork 522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如何对Hugegraph-server中的Kneighbor算法的执行过程作profiling。分析算法执行过程中的各个阶段的内存和CPU占用。 #2516
Comments
To profile the Kneighbor algorithm in Hugegraph-server for memory and CPU usage, consider the following approaches:
Example code snippet for manual instrumentation: long startTime = System.currentTimeMillis();
long startMemory = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
// Algorithm execution code
long endTime = System.currentTimeMillis();
long endMemory = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
LOG.debug("Execution time: " + (endTime - startTime) + "ms");
LOG.debug("Memory used: " + (endMemory - startMemory) + " bytes");
Remember, manual instrumentation is more suited for a development or staging environment due to the need for source code modification. For detailed setup instructions for Java profiling tools, refer to their respective documentation. This approach should provide a comprehensive view of the Kneighbor algorithm's performance within Hugegraph-server, allowing for targeted optimizations based on the observed CPU and memory usage. Sources
|
修改代码,编译运行之后,输出的log文件应该在哪个目录下 |
The location of the log files after modifying the code, compiling, and running it depends on the configuration of your logging framework within the Hugegraph-server project. Typically, Java projects use logging frameworks like Log4j, SLF4J, or java.util.logging, and the output directory for log files is defined in the configuration file of these frameworks.
If you're unable to find the logs, ensure that the logging level is set appropriately to capture debug logs, as the example code snippet uses Remember, the exact steps can vary based on the specific logging framework and configuration used in your project. If you're still having trouble, reviewing the documentation of the logging framework or searching for configuration examples online can provide more detailed guidance.
|
@SkrDrag 可以参考机器人回答的方式1--使用Java profile工具,不建议方式2--手动打点。 |
Some Notes:We(HugeGraph Server) have already integrated the Arthas, and it also integrate the (Also cc to @dosu-bot , u should learn it & tell users to use it next time) Refer: |
To profile the Kneighbor algorithm in HugeGraph Server and analyze its performance, including memory and CPU usage, you can leverage the integrated Arthas tool, which includes async-profiler. This approach allows you to generate detailed flame graphs without needing to download async-profiler separately. Here's how to do it:
For more detailed instructions, including how to configure and start Arthas, refer to the This method provides a comprehensive view of the algorithm's performance, enabling targeted optimizations based on observed CPU and memory usage. Sources
|
Feature Description (功能描述)
如何对Hugegraph-server中的Kneighbor算法的执行过程作profiling。分析算法执行过程中的各个阶段的内存和CPU占用。
The text was updated successfully, but these errors were encountered: