mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 14:20:29 +01:00
Enhancement - Save/load request logs to/from disk #34
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @phillee007 on GitHub (Aug 12, 2017).
Just thinking, in one of the scenarios we have, the Wiremock standalone instance is used as either:
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?
@StefH commented on GitHub (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 commented on GitHub (Aug 14, 2017):
@phillee007 ; another question : are you available for code-reviews in the next weeks? Or do you have holiday planned?
@phillee007 commented on GitHub (Aug 14, 2017):
I go on holiday to Europe in a few days till October 5, but should be able
to look at some code while on planes/buses etc. Is it for the core 2 stuff?
Phil
On 14/08/2017 7:27 PM, "Stef Heyenrath" notifications@github.com wrote:
@StefH commented on GitHub (Aug 14, 2017):
Hi Phil,
Code reviews are more related to https://github.com/WireMock-Net/WireMock.Net/issues/42 and https://github.com/WireMock-Net/WireMock.Net/issues/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 commented on GitHub (Aug 14, 2017):
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 :-)