uber-common / jvm-profiler

JVM Profiler Sending Metrics to Kafka, Console Output or Custom Reporter
Other
1.79k stars 342 forks source link

How to get method metrics? #47

Closed ajames-branch closed 4 years ago

ajames-branch commented 5 years ago

I would like to get details about number of times a method is invoked, duration for the method execution. I believe I should use 'durationPolling' feature. I am using following command:

-javaagent:jvm-profiler-1.0.0.jar=reporter=com.uber.profiling.reporters.FileOutputReporter,outputDir=/tmp/ProfilerOut,ioProfiling=true,sampleInterval=2000,durationProfiling=io.jaal.spark.ingest.Publisher.getProducer

However I am seeing 'ProcessInfo.json' (along with 'CpuAndMemory.json', 'IO.json' and 'Stacktrace.json') and it does not seem to have the above metrics. Am I doing it correctly? Could anyone please help me here?

hiboyang commented 5 years ago

Hi, it looks correct "durationProfiling=io.jaal.spark.ingest.Publisher.getProducer". Would you verify that method is called in your application?

ajames-branch commented 5 years ago

Hi, it looks correct "durationProfiling=io.jaal.spark.ingest.Publisher.getProducer". Would you verify that method is called in your application?

@boy-uber Yes it is invoked multiple times. I will double verify that. Is there any cases where this will not work?

My function looks like this: getProducer(brokerDetails).get().send(lambda function);

It is a static function. I am able to gather stats for non-static function.

hiboyang commented 5 years ago

It should work with static function. The test case here includes durationProfiling on static method.

hiboyang commented 4 years ago

Close inactive issue.