GCViewer
GCViewer copied to clipboard
Need documentation for using GCViewer as an API
Are there docs or a starting point for utilizing the GCViewer code as an API to extend for other purposes? Things that I could see being able to use the log parsing functionality for:
- Alerting for
- High GC activity
- Full GC events
Hi Nick,
I see two options to get the information for your alerting:
- use the commandline interface of GCViewer to generate a CSV file containing a lot of information (java -jar gcviewer-1.3x.jar gc.log summary.csv) -> parse the csv file and extract the information
- java/com/tagtraum/perf/gcviewer/imp/DataReaderFacade.java and use the resulting GCModel to extract the information you are looking for for the alerts.
Best regards, Jörg
That's excellent information. I think I want to try that DataReaderFacade
, as I'd probably be able to make a lot of use out of the GCModel
and such in a more fine-tuned manner. Thank you for the info!
So I've been using this API, and it works pretty well. Is there a way to just load more recent changes from the file, similar to what you would do with piping tail -f > some-java-command
would work? I could probably implement something using the WatchService API, but do I need to re-parse the entire .log
file in order to get the changes, or can I just add to a GCModel
the newest changes?
Hi Nick
Currently, there is no support in GCViewer for partial log file analysis.
I don't know, if this is a feasible workaround for you until there is support: If you can extract the part of the log, you would like to add, you can parse just that part. If you would then like to update an existing GCModel, please be aware, that you have to use GCModels "add(AbstractGCEvent)" method to add parsed events, otherwise statistics of the GCModel won't be updated.
I will look into it. I'm not sure how this will work, but it's worth a shot.