microsoft / gctoolkit

Tool for parsing GC logs
https://github.com/microsoft/gctoolkit
MIT License
1.24k stars 152 forks source link

PSYoungGen getDuration method not returning duration for a specific log #224

Open karianna opened 2 years ago

karianna commented 2 years ago

Every event inherits from com.microsoft.gctoolkit.event.jvm.JVMEvent which is where getDuration() is defined. Therefore, every event has a getDuration() method.

I checked the generated javadoc for PSYoungGen and the methods inherited from JVMEvent are given.

Yes, the method is inherited from JVMEvent. However that method does not return anything for PSYoungGen event. Similar is the case for many other events. By inheritence, it should have that data. But either the parsers are not able to capture those events, or there is something else wrong.

For reference, i ran the same GC log file with GCToolkit and GCeasy. GCEasy was able to get PSYoungGen event duration, GCToolkit was not.

Let me know if you need the GC Log file.

Originally posted by @HritwikSinghal in https://github.com/microsoft/gctoolkit/discussions/218#discussioncomment-3095648

karianna commented 2 years ago

@HritwikSinghal - are you able to post the log here?

HritwikSinghal commented 2 years ago

@karianna yes, here it is. https://github.com/HritwikSinghal/gctoolkit/releases/download/log_file/hbase.gc.0.log

HritwikSinghal commented 2 years ago

Ok, so a little bit more info for debugging.

Here

These are stats from GCEasy for above attached log file. You can See that it can parse YoungGC and ConcurrentPreClean and give stats.

However if i try to run the same GC log file with my GCToolkit sample script, it shows empty values for PSYoungGen, YoungGC, and even for ConcurrentPreClean.

Total Time                  : 0.0 sec
Minimum duration:           :0.0 sec
Maximum duration:           :0.0 sec

So this means either something is wrong with my code (the same code can parse InitialMark and ReMark properly though), or the parsers are not able to parse these events or there is something else going on.

The GCToolkit sample which i am running can be found here. (Use the branch "test", i have removed all extra code from it ).

My GCToolkit Sample is able to parse InitialMark and ReMark stats properly (just uncomment respective lines in this file).

Steps i do to run the code:

kcpeppe commented 2 years ago

Thank you for all the extra information. We ha(ve)(d) test to ensure that the events contain the correct values. The first thing here is to check that those tests are being executed. I've been away from a computer for a few days but I'll be digging in this week.

HritwikSinghal commented 2 years ago

@karianna @kcpeppe any updates on this?

karianna commented 2 years ago

CC @kirk-microsoft for work inbox :-)