Closed Li-Haihui closed 7 years ago
both bookkeeper and distributedlog use the StatsProvider
interfaces for exposing and collecting stats. There are different stats providers available in http://bookkeeper.apache.org/docs/latest/admin/metrics/. You can also have a stats provider implementation that use your own monitoring systems.
If you don't have any monitoring systems, and if you are running in k8s, you are recommended to use the Prometheus stats provider, which prometheus has been integrated with k8s heavily.
Or you can just use the default codahale stats provider.
http://bookkeeper.apache.org/distributedlog/docs/latest/admin_guide/monitoring.html has the instructions on how to configure and use the stats provider.
for codahale stats provider, you can configure a jmx reporter to report all the stats via JMX - by specifying the jmx endpoint in the configuration codahaleStatsJmxEndpoint
: https://github.com/apache/bookkeeper/blob/master/bookkeeper-stats-providers/codahale-metrics-provider/src/main/java/org/apache/bookkeeper/stats/CodahaleMetricsProvider.java#L73
Hope this help.
oh, thanks. but I want to see the progrom's CPU utilization. then find which function take the CPU resource , like jmx + jconsole or jmx + jvisualvm.
@Li-Haihui : hmm I am not sure I understand your question. it is a java process, if you run a jmx reporter (for example codahale stats provider), you should be able to jconsole to it, right?
in there,i don't care about lantency. i just want to know CPU utilization and thread switches. like jvisualvm to performance monitor.
@Li-Haihui : understand that. what I mean here is the codehale stats provider will run the jmx, which then you can use console and jvisualvm to connect to jmx.
because basically what you need is running jmx, right?
@sijie :yes. how to do that.
@Li-Haihui :
what I suggested above is about running jmx :-)
currently bk and dl doesn't run jmx directly. codahale stats provider is able to run jmx. if you use codahale stats provider and configure the jmx endpoint, it will run jmx for you.
but how to configure the jmx endpoint, same to codahale stats provider? so how do you to care about the CPU?
in codahale stats provider, you can configure the jmx endpoint: https://github.com/apache/bookkeeper/blob/master/bookkeeper-stats-providers/codahale-metrics-provider/src/main/java/org/apache/bookkeeper/stats/CodahaleMetricsProvider.java#L73 If you configure jmx endpoint, then jmx is running
when jmx is running, the jvm information about memory usage, CPU usage, thread usage, and class information is all available by default.
sorry, i don't find this configure . where is it?
@sijie Thanks! for the benchmark,i have solved this problem.
awesome! @Li-Haihui
Is this a question, feature request, or bug report?
QUESTION
now, I want to realize the remote monitoring for distributedlog-0.5.0; I do this for looking the CPU utilization and thread call state. Then I can optimization program, How can I do?