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
Automated backups of last saved JMX files #3591
Comments
@FSchumacher (migrated from Bugzilla): I wonder, if it would be nicer to enumerate the backup files and keep the .jmx suffix. The time and date of the save operation, will most probably be available by looking at the file stats. And I don't know if I like the idea of a directory called after the file name. Apart from that, a few nitpicks:
|
@pmouawad (migrated from Bugzilla): Regards |
Benoit Vatan (migrated from Bugzilla): Wouldn't it be better to have some default backup directory, say in JMETER_HOME/backups or something ? This could be controlled by some jmeter.property with a default destination that could be user overridden in user.property ? This would then leave the JMX save directory as clean as possible. I will update the code and provide a patch after your above comments. Thanks for your feedback. Benoit. |
Benoit Vatan (migrated from Bugzilla): |
Benoit Vatan (migrated from Bugzilla): I think I have updated the patch to take all your remarks into account. Backup files are now stored by default in ${JMETER_HOME}/backups unless jmeter.gui.action.save.backup_directory is set to a different location. jmeter.gui.action.save.backup_on_save has been renamed according to Felix's advice. Backup file names are now timestamp free, replaced by a version number auto-incremented from the highest version found in the already existing backup files. Backup extensions is now .jmx instead of a timestamp. I have rework the code to make it simpler and make use of commons-io filters. Reworked the javado, mistyped comments and renamed variable names as well according to your recommandations. Properties have been moved to system.properties with the default values. I have updated hints_and_tips documentation but I'm not sure of the format so it might have to be checked. Regards. |
@pmouawad (migrated from Bugzilla): URL: http://svn.apache.org/r1679098 Modified: |
@pmouawad (migrated from Bugzilla): |
@pmouawad (migrated from Bugzilla): URL: http://svn.apache.org/r1683855 Modified: |
@milamberspace (migrated from Bugzilla): If you save a new file (the first time), you have a error in jmeter.log: 2015/06/07 09:24:09 INFO - jmeter.services.FileServer: Default base='/home/milamber/W-workspaces/Workspaces-JMeter/Jmeter/bin' I think a test condition must be adding before create the backup file (don't copy if that is the first save) |
@FSchumacher (migrated from Bugzilla): URL: http://svn.apache.org/r1684029 Modified: |
Benoit Vatan (Bug 57913):
After an OOME occured while saving my test plan, a significant part of it was lost and made the whole work unusable without "handworking" the XML. Given that no recent copy of my work was available to me anymore, I was really angry and in bad situatio, lesson learnt : don't ever forget backing up your work.
I thus have brought some enhancement to the JMX save process so that it keeps a copy istory of the last saved JMX.
What's more I am aware that this did happened to someone else so I come to the conclusion that sharing it might be usefull to someone else.
The attached patch adds logic to the JMX save process so that the last saved JMX file is copied with a timestamp suffix.
user.properties contains properties to control backup history :
Enable backup history, defaults to true
Set to false to return to the default behaviour
#jmeter.gui.action.save.backup_when_saving=true
Set the max number of hours that existing backups are kept
older backups are delete when a save operation occurs
Default is keep backup for ever
#jmeter.gui.action.save.keep_backup_max_hours=0
Set maximum number of backup to be kept
Default is 10, so while we set no max_hours we only keep at most 10 backups
#jmeter.gui.action.save.keep_backup_max_count=10
Backup files are created in a subdirectory of the main JMX file and is named from the JMX name suffixed with ".backups"
Example:
We are saving to an existing jmeter.jmx file in some /path/to directory , we'll then have :
/path/to/jmeter.jmx
/path/to/jmeter.jmx.backups
where /path/to/jmeterx.jmx.backups will contains the backups history :
jmeter.jmx.20150502-180909
jmeter.jmx.20150502-180911
jmeter.jmx.20150502-180915
jmeter.jmx.20150502-180916
jmeter.jmx.20150502-180917
jmeter.jmx.20150502-180919
jmeter.jmx.20150502-180920
jmeter.jmx.20150502-180921
jmeter.jmx.20150502-180922
jmeter.jmx.20150502-180923
This would prevent anyone to lose work anymore...
Regards.
Benoit
Created attachment jmeter-2.13-backup-when-saving.patch: Patch for backing JMX file when saving
OS: All
The text was updated successfully, but these errors were encountered: