-
Notifications
You must be signed in to change notification settings - Fork 601
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
MiniPorfiler Keep repeating the requests #659
Comments
I'm not sure I'm clear on the report/ask - it looks like you indeed have those requests all distinct with times, etc. MiniProfiler is only reporting what it sees here. |
@NickCraver |
@Abanoub98 I agree that seems to be happening, but what does that have to do with MiniProfiler? It's only recording the requests it sees. |
@NickCraver are there any alternatives to it? or any other options I can add? maybe the order of lines in the program.cs? |
@Abanoub98 Again, I think you're chasing the wrong thing here. You're asking "why are there duplicate requests?", which is absolutely the question you should be asking - but you seem to be focused on MiniProfiler causing them, rather than what it's almost certainly doing: reporting they exist. I cannot say why you're fetching every 2 seconds, my assumption would be errant JavaScript somewhere along the way causing reloads. |
That must be same problem as #653. I faced it too :( |
We have the same problem. I think #550 is the cause.
|
Same error here. |
@NickCraver Could you please lend a hand here? The other commenters might not have explained it quite right, but this is an actual issue with MiniProfiler - I've found what's causing it. Although it wasn't shown correctly in the screenshot above, here's what's happening on the results-index page: The client script calls The results will be something like this. They will be sorted in descending order, by The client script then appends them to the HTML table. Then it takes the bottom guid (which is the first request to have occurred, because descending order), and uses that for the So Then the process repeats, until it reaches the actual last request. So the calls we get are as follows: Then, Then, Finally, Obviously this process goes on for longer, the more requests you start with in the first request. For completeness, this is what the table ends up looking like. Note the "Started" column in the table is in the wrong order too. Also, the times/guids are different in the final screenshot vs. the others because I restarted the server in between - sorry. I suspect the issue is here, in private async Task<string> ResultsListAsync(HttpContext context)
{
if (!await AuthorizeRequestAsync(context, isList: true))
{
return "Unauthorized";
}
// `guids` is returned in Descending order. This is required for the `last-id` logic
var guids = await Options.Storage.ListAsync(100).ConfigureAwait(false);
// Requires guids in descending order
if (context.Request.Query.TryGetValue("last-id", out var lastId) && Guid.TryParse(lastId, out var lastGuid))
{
guids = guids.TakeWhile(g => g != lastGuid);
}
// Here the guids are returned, still in descending order.
return guids
.Select(g => Options.Storage.Load(g))
.Where(p => p != null)
.Select(p => new
{
p!.Id,
p.Name,
p.ClientTimings,
p.Started,
p.HasUserViewed,
p.MachineName,
p.User,
p.DurationMilliseconds
}).ToJson();
} I can see here that the guids used to be reversed, but that was removed for some reason. I suspect this has been broken ever since. So the question is where the fix is best implemented:
If it's the .Reverse() option, I can submit a PR. I probably wouldn't feel that comfortable submitting a PR for the client script. It'll probably be a little more involved and I don't have a whole lot of time to test it properly... which is how we got here to start with. P.S. You mention here that "The most recent being at the top ... is the intended behavior", but that might be broken too because now the records are added to the bottom of the HTML table. |
…ent calls first Fix both MiniProfiler#653 and MiniProfiler#659
Is there the latest progress? I also encounter the trouble brought by this situation. |
I'm using a mini profiler to examine my project performance however, I have a problem where the requests in profiler/results-index is repeated as I am using an infinite loop
My solution consists of Asp.net core web API for the back end and Blazor for the view
here is the profiler code in program.cs inside the Api project
The text was updated successfully, but these errors were encountered: