Exclude the first few requests/events for each url/page/resource after a restart when evaluating Smart Detection, since those are not repres
Exclude the first few requests/events for each url/page/resource after a restart when evaluating Smart Detection.
The initial requests to a url/page/resource typically take much longer time than what is normal.
So the timing and measurements of the initial requests to a page/url only misleads the Smart Detection evaluation and produces a lot of random and useless results.
Suggestion
1. Figure out when a resource is restarted (probably the same time that AI is initialized).
2. Keep an internal dictionary for requests, dependencies and other stuff. Reset when restarted.
3. Every time a request/dependency/resource is processed by AP, add it to the dictionary if it doesn't already exist, and increase it's counter by one.
4. When sending the event to the AI servers, include a property indicating # times it has been called since restart (on this host)
5. Use this counter property on the server side and make it part of your Smart Detection evaluation.
Now, there could be Smart Evaluation that indicates that the initial request to a resource is slower than normal, while "normal" requests behave OK once the counter is greater than, for example 3.
Alternatively, allow for developers to set a flag on AI, indication if the metrics produced for the request should be part of Smart Detection or not.
