Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added opportunity add any registry to merge with clusters #280

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rimdus
Copy link

@rimdus rimdus commented Jul 25, 2019

Hello. We used cluster in project. Master process make logics to exclusively write to db extra data and used metrics too. This commit allow to add master repository to merge with clusters optionals.

@siimon
Copy link
Owner

siimon commented Sep 8, 2019

@zbjornson do you have any opinions?

@zbjornson
Copy link
Collaborator

This will fix #183 👍 and I think is the correct approach. Could you add a test case for it and update the changelog please?

@siimon
Copy link
Owner

siimon commented Feb 12, 2020

Still waiting for a test before merging this one

@SimenB SimenB linked an issue Feb 12, 2020 that may be closed by this pull request
@zbjornson
Copy link
Collaborator

Poke @rimdus -- could you add a test please? This is a more versatile solution than #324 so would like to get this in.

const requestId = requestCtr++;

if (opt && opt.registry) {
additionRegistry = opt.registry;

Choose a reason for hiding this comment

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

I might be missing something here as I'm new to this codebase, but it seems odd to call an instance method (anAggregatorRegistryInstance.clusterMetrics()) which has the side effect of affecting a static method (AggregatorRegistry.aggregate()). There is an implicit dependency here in that the execution path will ultimately call AggregatorRegistry.aggregate() with the hope the right additionRegistry is still set.

Perhaps this additionalRegistry should be stored with the inflight request (perhaps by modifying the shape of data stored in requests) state so it's metrics can later be retrieved before the call to AggregatorRegistry.aggregate().

Again I'm pretty new to looking at this, so forgive me if this is off base.

Copy link
Collaborator

Choose a reason for hiding this comment

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

(16 months later)

Fair point, that would be a good improvement.

We already have module-level state with AggregatorRegistry.setRegistries(). That should maybe be changed also (in a separate PR).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow master to add its own metrics
4 participants