Makes the session event counting logic more extensible for #505
Problem
SessionManager should decide if the sessionEventCount is under the sessionEventLimit, not EventCache. This PR gives that responsibility to SessionManager by removing EventCache.canRecord and implementing SessionManager.shouldSample, making it extensible to check for sessionEventLimitOverride(s) (#480).
Purpose
Makes the session event counting logic more extensible for #505
Problem
SessionManager should decide if the sessionEventCount is under the sessionEventLimit, not EventCache. This PR gives that responsibility to SessionManager by removing
EventCache.canRecord
and implementingSessionManager.shouldSample
, making it extensible to check for sessionEventLimitOverride(s) (#480).Engineering plan for #480 summarized here https://github.com/aws-observability/aws-rum-web/issues/480#issuecomment-1933212088
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.