Fix Proc.Limits limit name matching#667
Conversation
|
I've also been working on adding a benchmark for this function, in its current form I've got these results: I've been trying to add an algorithm that parses the limits file line to get the values, and it currently passes all tests and have the following results: Comparing using Currently the algorithm is quite awful, but I'm planning on improving it to make it more readable. If you think it's worth the effort, I could try and create a new pull request if needed. |
|
Kinda odd for the limit name having a trailing whitespace.. Any idea why that might happen? But not opposed to the change.. As for the performance improvement, feel free to submit a separate PR for that. |
11be0ac to
289d012
Compare
|
Thank you @discordianfish, I just pushed a signed-off commit. As for why it's happening I also found it odd but couldn't figure it out yet. |
I was working on improving this algorithm to reduce the number of allocations when I found out that with the addition of the additional test cases, `Max processes` was failing to match the `switch` statement as for some reason the limit name has a trailing whitespace. By trimming the spaces it now matches all cases. Signed-off-by: Leandro López (inkel) <leandro.lopez@grafana.com>
289d012 to
031eb61
Compare
|
Thank you @SuperQ! |
I was working on improving this algorithm to reduce the number of allocations when I found out that with the addition of the additional test cases,
Max processeswas failing to match theswitchstatement as for some reason the limit name has a trailing whitespace. By trimming the spaces it now matches all cases.I've also locally tested with changing the values of the fixture file for the rest of the limits and it was matching in all cases.