This commit addresses 2 problems we've encountered:
Broken RAD telemetry plots (collected statistics) for AZ::IO::Streamer;
Rare crashes of game client.
For the first issue we have a following visualization:
Streamer stat names appeared to be corrupted. This happened because of Statistic::CreateXXX(...) functions, accepting AZStd::string_view as a first argument, were supplied withAZStd::string variables living in method scope. To fix this we've introduced a separate cache for stat names.
Second issue (crash) was preceded by the following assertion:
This can happen due to the fact that DedicatedCache::CollectStatistics() and DedicatedCache::DestroyDedicatedCache() methods can be called from different threads (main and streamer threads respectively). While this happens rarely, access to DedicatedCache internal structures should be protected with sync constructs.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
This commit addresses 2 problems we've encountered:
For the first issue we have a following visualization:
Streamer stat names appeared to be corrupted. This happened because of
Statistic::CreateXXX(...)
functions, acceptingAZStd::string_view
as a first argument, were supplied withAZStd::string
variables living in method scope. To fix this we've introduced a separate cache for stat names.Second issue (crash) was preceded by the following assertion:
This can happen due to the fact that
DedicatedCache::CollectStatistics()
andDedicatedCache::DestroyDedicatedCache()
methods can be called from different threads (main and streamer threads respectively). While this happens rarely, access toDedicatedCache
internal structures should be protected with sync constructs.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.