It's confusing that speedtest.New() uses the same GlobalDataManager
Opened this issue · 3 comments
I assumed that each instance of the Speedtest
object would have its own state, but it turned out it shared the GlobalDataManager
which needed to be reset between runs to be able to give accurate results.
Hi, @eric. You are right. we fixed it and cache records of the last ten tests. reset is still needed.
Originally I did not have a Reset()
when the test was done (it still is unintuitive to me why I would need a Reset()
when I am creating a new object each time) and the numbers I was getting on the second run were 2x the actual numbers. I assumed that speedtest.New()
created a new session, but maybe introducing some sort of a session object for each test run would be a simpler way to understand from someone coming to the project for the first time.