Page MenuHomePhabricator

Add and export MetricsClient#isStreamInSample()
Closed, ResolvedPublic3 Estimated Story Points

Description

Description

As an instrument engineer
I need to determine whether my instrument should execute
So that I can minimise the performance impact of my instrument

As an instrument engineer
I need to determine whether my instrument should execute based on centrally-defined configuration
So that my instrument can be managed centrally

Acceptance Criteria

  • SamplingController#streamInSample() is renamed to isStreamInSample() for consistency
  • MetricsClient#isStreamInSample() is defined
  • mw.eventLog.isStreamInSample() is defined (and proxies to the above)

Required

  • Unit/Integration tests
  • Passed QA?

Notes

Here's an example implementation of the method:

metrics-platform/js/src/MetricsClient.js
MetricsClient.prototype.isStreamInSample = function ( streamName ) {
  const streamConfig = getStreamConfigInternal( this.streamConfigs, streamName );

  return streamConfig ? this.samplingController.isStreamInSample( streamConfig ) : false;
};

Event Timeline

phuedx created this object with edit policy "All Users".
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
phuedx set the point value for this task to 3.Jan 16 2024, 10:47 AM

Related gitlab MR https://gitlab.wikimedia.org/repos/data-engineering/metrics-platform/-/merge_requests/27

Not able to push to gerrit today due to planned maintenance . See screenshot for

image.png (2×3 px, 961 KB)

Change 992390 had a related patch set uploaded (by Sg912; author: Sg912):

[mediawiki/extensions/EventLogging@master] T352966

https://gerrit.wikimedia.org/r/992390

phuedx updated the task description. (Show Details)