Skip to content
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

Enhancement - Save/load request logs to/from disk #42

Closed
phillee007 opened this issue Aug 12, 2017 · 5 comments
Closed

Enhancement - Save/load request logs to/from disk #42

phillee007 opened this issue Aug 12, 2017 · 5 comments
Labels

Comments

@phillee007
Copy link
Contributor

Just thinking, in one of the scenarios we have, the Wiremock standalone instance is used as either:

  • a fallback when one of our real services goes down in development, or
  • we just want to avoid depending on the real service.

Sometimes the service can run for days, or weeks. When this happens and there are multiple developers using the standalone mock service, the request logs can grow very large, and use a lot of memory. To address this, one option would be to manually clear them, however I was thinking I might (this will likely not be till October when I get back from holiday) instead provide a setting to have the request logs saved to disk instead, much like the mappings, and then when requests come to retrieve a log entry or a search, parse the files and return the matching ones.

Another scenario I can see this being useful for is where there is a long-running proxy/record instance.

I'm thinking that the RequestLogs collection could be changed into a custom List or IEnumerable implementation, which just stores the request id and filename. When GetEnumerator or other methods are called, it would then read the actual request files from disk and return them.

An alternative option would be to provide a setting such as RequestLogExpirationDuration, or MaxRequestLogCount, which could be used to ensure that request logs are purged when they reach a certain age, or when a certain amount build up. This might be easier, but is another way to address the same issue.

Thoughts Stef?

@phillee007 phillee007 changed the title Enhancement - Save/load requests to/from disk Enhancement - Save/load request logs to/from disk Aug 12, 2017
@StefH
Copy link
Collaborator

StefH commented Aug 12, 2017

For this scenario I think implementing RequestLogExpirationDuration / MaxRequestLogCount is the easiest.

About memory issues : I dont think that will be a real issue unless you send/receive complete byte[] array blob data like complete files.

Note that I'm currently working on using netstandard/netcore 2.0 preview in relation to docker image.
My goal is to create a docker image based on linux or windows nano to run wiremock.net in a container.

@StefH
Copy link
Collaborator

StefH commented Aug 14, 2017

@phillee007 ; another question : are you available for code-reviews in the next weeks? Or do you have holiday planned?

@phillee007
Copy link
Contributor Author

phillee007 commented Aug 14, 2017 via email

@StefH
Copy link
Collaborator

StefH commented Aug 14, 2017

Hi Phil,

Code reviews are more related to #42 and #43

For the .net preview 2.0 stuff, I don't specifically need your review comments, most code-changes are done now I hope.

BTW : where are you going for holiday ?

@phillee007
Copy link
Contributor Author

Ok. Just let me know if/when you need me to have a look. I could write the code too when i get back if you're busy.

Holiday - Greece, Croatia, Italy, Hungary, Serbia :-)

@StefH StefH closed this as completed Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants