-
Notifications
You must be signed in to change notification settings - Fork 980
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
Support GC log file rotation #61
Comments
Hi Haim, That looks like an interesting option - I'll have to look into it. Regards, Jörg |
Hi Jörg , really sorry |
Hi Haim, No problem. It is a very good idea to open an issue as a preliminary action before solving it! I am looking forward to seeing your pull request! Regards, Jörg |
Any progress on this? |
It looks, like Haim never got round to implement this issue. If you have some time to work on this one, I'll happily assign it to you. Would you like to have some hints on where to start? By the way: Please pull the latest commits from the "develop" branch. I have just merged a feature, that included quite some refactoring to GCViewer. |
Yes, hints are very welcome. I'll make sure to pull the develop-branch. What I have been thinking about: How should non-consecutive logfiles be handled? Edit: I already looked into this. |
I think, I'd start here:
To tackle your question concerning non-consecutive logfiles: The class Probably, the DataReader interface should be extended, so that an Maybe, as a second step, a menu item could be added to be able to turn To complete the whole thing, a command line parameter could be added to What do you think? Can you start with this information? If you would |
If already started in the meantime and followed the apporach that I use when doing this by hand:
What do you think of this approach? |
I like the idea to have a new menu option for the new feature. Like
this, it is very clear for the user, if he uses the new / different
functionality or still the one he was used to.
Your approach with first merging the files and then parsing them will
also work. As long as you keep the logic of how to find out, which files
to merge and parse under control of the DataReaderFacade, extending the
implementation for usage with commandline will be very easy.
Implementing the logic inside DataReaderFacade will probably proove to
be more difficult, because more classes need to be changed. If you
prefer to implement a more straightforward approach, just go ahead.
Refactoring it later should not be overly difficult.
By the way: The current implementation of GCModel relies on the parser
to add the events sorted by timestamp. It contains no sorting logic of
its own.
|
You can have a look at a current WIP state here: As far as my testing goes this works fine. I'll start with the refactoring you mentioned next. |
Looks good! I very much like your unittesting!
The FileMerger class, especially #getFirstTimeStamp() is yet
inefficient, but you obviously know that. I am looking forward to your
refactoring.
Would it help your refactoring, if there was a method
DataReader#read(GCModel model) that would append to an existing GCModel?
|
Check the latest state (incl. some refactoring) here: I hope I have tackled the issues you mentioned. I've done some refactoring as you suggested. Hopefully I didn't go overboard. Open points from my side:
I'll address those points next. Let me know if you have feedback. |
Did you get a chance to look into this already? |
Unfortunately not. I am currently very busy. I might have time to take a very short look until end of this week. I'll let you know what comes out. -------- Original Message -------- Did you get a chance to look into this already? You are receiving this because you commented. |
Ok, I have now taken a look. Since I am currently on vacation, I could only check the diffs and the code online, which makes the review a bit more difficult. From what I see there, it looks good! Your approach is quite flexible. From checking the code, I have one small question: in GcSeriesLoader#getCreationDate() you log a warning, if there are no datestamps present in the logfile. Does model#getfirstDateStamp() infer a datestamp, if there are only timestamps? If so, the fallback would only be necessary, if there was neither datestamp nor timestamp present. Some remarks to details, I have found:
I might find more after vacation, when I can test on my computer, but that will probably again take at least three weeks from now. In general, I'd say, it looks good. I'd be glad, if you could do the formatting cleanup and then you may open a pull request. Unless you would like to wait a few weeks until I'll have time to take a deeper look. Thank you very much and best regards, Jörg -------- Original Message -------- Unfortunately not. I am currently very busy. I might have time to take a very short look until end of this week. I'll let you know what comes out. -------- Original Message -------- Did you get a chance to look into this already? You are receiving this because you commented. |
Thanks for having having a look before your vacation! I've just finished the code style changes. I didn't use 6 blanks, but tabs instead of spaces. This wasn't consistent in all places before. I tried to only align this in the places I've touched, but I may have also aligned some lines surrounding that. GcModel#getfirstDateStamp() doesn't infer a datestamp if ony a timestamp exists. You are right, I'll also add a check for the timestamp. The only thing that remains open from my side is adding a seperate icon for "load series". Enjoy your vacation! I am looking forward to your review after that. Edit: As a bonus I've also improved the parsing times of logs. It doesn't strictly belong to this issue, but avoids rebasing the change. If you don't want this as part of the same pull request, let me know. |
Support for rotated logfiles has been added. This allows to open a series of consecutive logfiles and treat them as one (merged) gc log. This allows to analyze logfiles that have been created over a longer period in a production environment.
…ewiebug#61) When a series of logfiles was recently opened, it can now be reopened from the "recent" menu. In order to support this, GCResourceGroup was refactored and now only stores the URL of a Resource instead of the whole resource (as it apparently was already before). This allows to also store GcResourceSeries in the same way as regular GcResources.
Commandline support for parsing logfile series has been added. Syntactically this is close to existing commandline arguments. Some additional refactoring was done to have a unified handling of the various types of resources that can be used.
Ok, I 'd also prefer to have some more time for a proper review, where I can also test the implementation. I hope to be able to do it within two or three weeks.
Good hint concerning code style template! It will help to avoid these small inconsistencies that make reviewing code more difficult.
I think, there is currently some implementation in the gui (the code that switches the timeline between "time between start" and "absolute date"), which sits exactly this inference of the start date based on the file date, if there is no datestamp in the file. That code had probably better be moved into gcmodel to accommodate your usecase.
Best regards, Jörg
|
Hmm, unfortunately, I still didn't find the time to do the proper
review. A passing glance tells me, that your latest commit breaks the
deployment mechanism, I built with Maven.
Since you added a library to the dependencies, there is now the need for
an assembly for the distribution, which includes that library. I assume,
that the same mechanism can be used, as is in place for the mac
distribution (see src/man/assembly). There needs one additional step -
download the library.
Do you know Maven enough, that you could also fix this?
Concerning the review, I don't think, I'll have time before end of July,
I am afraid!
|
Ok, finally, I have had time to check your branch. I must say, I am still very impressed of you work - I especially like, how many unittests you write to test your code. You have also found a way around the 2 times loading of all files - very good! I agree, that the feature is almost finished with implementation! I have only minor things to remark. Please tell me, if you would like to work on them, or if you leave it to me. In that case, I'd add the few remaining bits and merge it to develop, after. I have found just one thing, that doesn't work as expected: using the commandline mode with a series of files results in an UnsupportedOperationException because the GCResource passed to DataReaderFacade#loadModel() is a GCResourceSeries. I believe, you could allow for that inside DataReaderFacade and decide there, which mechanism for loading to use. One cosmetic detail: The display string of a series in the recent menu is a bit long. I think, I'd prefer to have something like " (series, 6 more files)" or something similar. That's already all I have found. Concerning the icon: I'll try to find something. Concerning the bonus: Thank you - and yes, I would like to have it in a separate pull request, because it will need some work in the build process. Thanks again! Best regards, |
Thanks for having a thorough look! You are right that the build is broken with the added dependency. I've tried already to get this to work but failed. Apparently it is nowadays suggested to use the maven-shade plugin to built a fat-jar with dependencies for apps like this. I could try this out and will prepare a second pull request for that. |
- In the "recent" menu, show shortened description for GcSeries - Added calculation of start date to GCModel - Fixed error when loading a GcSeries via Commandline - Other smaller improvements
# Conflicts: # src/main/java/com/tagtraum/perf/gcviewer/ctrl/impl/GCModelLoaderControllerImpl.java # src/main/java/com/tagtraum/perf/gcviewer/ctrl/impl/GCViewerGuiBuilder.java # src/main/java/com/tagtraum/perf/gcviewer/ctrl/impl/GCViewerGuiController.java
Thank you! I've added PR #177 which contains the remaining performance improvement & build adjustments. |
Hi Thank you very much for your second pull request! I have reviewed it, implementation looks ok. Concerning distribution, I'll have to draw a diagram to visualise, what the result should be. Unfortunately, I think, the deistribution process is a little complicated. I'll post it as a comment to pull request #177. Best regards, |
Java 7 supports Rolling GC logs files with the parameters
-XX:+UseGCLogFileRotation
-XX:GCLogFileSize=M
-XX:NumberOfGCLogFiles=
the files will be suffexed with .1 .2 .3 etc....
GCViewer should be able to read all the files at once and merge them in correct order.
Add a checkbox to load all related files or add a popup dialog to ask if you want to load all related log files.
The text was updated successfully, but these errors were encountered: