orleans icon indicating copy to clipboard operation
orleans copied to clipboard

Refactor statistic and metric system

Open xiazen opened this issue 8 years ago • 5 comments

Currently orleans metric and statistic system has some problems which made it confusing to use, and error prone

  • [ ] use assembly loading to configure default IMetricsDataPublisher and IStatisticsPublisher, 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 CanUseAzureTable in ClientStatisticsManager as 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.

xiazen avatar Feb 06 '18 21:02 xiazen

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.

sergeybykov avatar Feb 08 '18 16:02 sergeybykov

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 SiloRuntimeStatistics which is pushed to other silos in DeploymentLoadPublisher.

Should we keep that or try to remove it? Either way, I can try to slim it down

ReubenBond avatar Feb 08 '18 22:02 ReubenBond

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?

xiazen avatar Feb 09 '18 01:02 xiazen

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

ReubenBond avatar Feb 09 '18 06:02 ReubenBond

For the just-in-time assembly loading of the Azure statistics publishes, can we just axe that? I'm talking about this code image

ReubenBond avatar Feb 10 '18 00:02 ReubenBond