Refactor statistic and metric system
Currently orleans metric and statistic system has some problems which made it confusing to use, and error prone
- [ ] use assembly loading to configure default
IMetricsDataPublisherandIStatisticsPublisher, which is error prone and also against the new way of configuring providers - [ ] use questionable way to determine to use default metric publisher and statistic publisher or not. See
CanUseAzureTableinClientStatisticsManageras an example. - [x] has multiple interfaces, such as
IStatisticsPublisher,IMetricDataPublisher, whose difference isn't clear. For example, Which metrics belongs to statistics, and which belongs to metrics? - [ ] overlap with telemetry. So basically now we have three system reporting metrics in orleans, and their responsibility and infrastructure overlap with each other. This made metrics harder to maintain and harder to use.
Considering refactor it.
The plan here is to remove the notion of metrics altogether, as they have outlived their utility, and to get out of assembly loading for statistics. Refactoring and reconciliation of statistics and telemetry will be considered post 2.0.0.
SiloPerformanceMetrics is used in a few places still, after #3988:
- For gateway load shedding
IsOverloaded+ the related test hooks to force the value) - For thread injection in
WorkerPoolThread - As the basis for
SiloRuntimeStatisticswhich is pushed to other silos inDeploymentLoadPublisher.
Should we keep that or try to remove it? Either way, I can try to slim it down
I think we can remove it.
Most of its metrics is covered by IAppEnvironmentStatistics and IHostEnvironmentStatistics. So for SiloRuntimeStatistics and WorkerPoolThread, we can use those two , instead of SiloPerformanceMetrics. Right?
For gateway load shedding, we can use a combination of LoadSheddingOptions and IHostEnvironmentStatistics to determine where it is over loaded or not. So we don't need to keep iSiloPerformanceMetrics here either.
Am I right? Or Am I missing anything?
What about for manipulating the value in tests? CpuUsage and IsOverloaded are the important ones. I guess tests can inject a dummy implementation
EDIT: I removed SiloPerformanceMetrics in the latest revision of that PR
For the just-in-time assembly loading of the Azure statistics publishes, can we just axe that? I'm talking about this code
