Skip to content

Conversation

galvesribeiro
Copy link
Member

More work for #2122

@galvesribeiro
Copy link
Member Author

CC: @jason-bragg / @jdom

@@ -163,7 +162,7 @@ public void OnStartProcessing()
firstStart = false;
if (StatisticsCollector.CollectContextSwitchesStats)
{
TrackContextSwitches();
logger.IncrementMetric(metricName);
Copy link
Contributor

@jason-bragg jason-bragg Sep 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is a good way to trigger logging these metrics. In general, all we are doing here is telling the telemetry that there is a metric of this name that is being incremented, which is not the case. We are then relying on the Orleans perf counter metric consumer to detect this metric and perform special processing on it. This is quite kludgy.

The problem is that we don't have anything to log here, we just need to signal something else to retrieve and log the data, so this is really a signal to an framework extension point. I suspect that DI could help.

Suggest something like:

  1. Create public IThreadTrackingStatistic interface with the public surface of ThreadTrackingStatistic.
  2. Move ThreadTrackingStatistic to OrleansTelemetryConsumers.Counters as an implementation of IThreadTrackingStatistic.
  3. Add extension function to register ThreadTrackingStatistic type in the service collection for DI.
    4 Update Orleans to get IThreadTrackingStatistic form DI.

Copy link
Contributor

@tsibelman tsibelman Sep 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I second your coment. What will happen if I implement another telemetry consumer ? I will get just a single call to Context Switches/sec, what is it means for me ?

Obviosly telemetry data coming into interface should make sense to all consumers and not to be custom fit for one specific implementation.

It just one specific example of a more general leaking abstraction in design of IMetricTelemetryConsumer. Orleans has many metrics constructed from other metrics but IMetricTelemetryConsumer don't have any general interface to implement this.

jdom added a commit to jdom/orleans that referenced this pull request Sep 20, 2016
@sergeybykov sergeybykov added this to the 1.4.0 milestone Sep 23, 2016
@galvesribeiro
Copy link
Member Author

Hey guys, this PR is outdated with the lots of changes recently made by @jason-bragg

Should we close it?

@jason-bragg
Copy link
Contributor

Yeah, I've a work item to create a tracking issue for this and close it out. I'll do that today.

@jason-bragg
Copy link
Contributor

Closing as alternative solutions are preferred and PR is out of date.
Added tracking issue "Remove performance counters from ThreadTrackingStatistic #2609"

@github-actions github-actions bot locked and limited conversation to collaborators Dec 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants