{"action":"created","issue":{"url":"https://api.github.com/repos/ReactiveX/RxNetty/issues/464","labels_url":"https://api.github.com/repos/ReactiveX/RxNetty/issues/464/labels{/name}","comments_url":"https://api.github.com/repos/ReactiveX/RxNetty/issues/464/comments","events_url":"https://api.github.com/repos/ReactiveX/RxNetty/issues/464/events","html_url":"https://github.com/ReactiveX/RxNetty/issues/464","id":126538624,"number":464,"title":"4.X - AbstractClientBuilder : creation of MetricEventsListener not useful ","user":{"login":"fzakaria","id":605070,"avatar_url":"https://avatars.githubusercontent.com/u/605070?v=3","gravatar_id":"","url":"https://api.github.com/users/fzakaria","html_url":"https://github.com/fzakaria","followers_url":"https://api.github.com/users/fzakaria/followers","following_url":"https://api.github.com/users/fzakaria/following{/other_user}","gists_url":"https://api.github.com/users/fzakaria/gists{/gist_id}","starred_url":"https://api.github.com/users/fzakaria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fzakaria/subscriptions","organizations_url":"https://api.github.com/users/fzakaria/orgs","repos_url":"https://api.github.com/users/fzakaria/repos","events_url":"https://api.github.com/users/fzakaria/events{/privacy}","received_events_url":"https://api.github.com/users/fzakaria/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-13T23:14:24Z","updated_at":"2016-01-14T00:00:52Z","closed_at":null,"body":"Hello,\r\n\r\nI'm trying to follow along the guide for registering MetricListenerFactory.\r\nThe README.md outlines using the global registration\r\n\r\nFor example\r\n```\r\n        RxNetty.useMetricListenersFactory(new SpectatorEventsListenerFactory());\r\n```\r\n\r\nThis however doesn't seem useful as it will create MetricsEventListeners in the *AbstractClientBuilder* that are not accessible\r\n\r\n\r\n```\r\npublic abstract class AbstractClientBuilder<I, O, B extends AbstractClientBuilder, C extends RxClient<I, O>> {\r\n...\r\npublic C build() {\r\n       ...\r\n        C client = createClient();\r\n        if (null != eventListenersFactory) {\r\n            MetricEventsListener<? extends ClientMetricsEvent<?>> listener =\r\n                    newMetricsListener(eventListenersFactory, client);\r\n            client.subscribe(listener);\r\n        }\r\n        return client;\r\n    }\r\n```\r\n\r\nAm I missing a piece of the puzzle here or is this not useful / bug ?"},"comment":{"url":"https://api.github.com/repos/ReactiveX/RxNetty/issues/comments/171476692","html_url":"https://github.com/ReactiveX/RxNetty/issues/464#issuecomment-171476692","issue_url":"https://api.github.com/repos/ReactiveX/RxNetty/issues/464","id":171476692,"user":{"login":"NiteshKant","id":820005,"avatar_url":"https://avatars.githubusercontent.com/u/820005?v=3","gravatar_id":"","url":"https://api.github.com/users/NiteshKant","html_url":"https://github.com/NiteshKant","followers_url":"https://api.github.com/users/NiteshKant/followers","following_url":"https://api.github.com/users/NiteshKant/following{/other_user}","gists_url":"https://api.github.com/users/NiteshKant/gists{/gist_id}","starred_url":"https://api.github.com/users/NiteshKant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NiteshKant/subscriptions","organizations_url":"https://api.github.com/users/NiteshKant/orgs","repos_url":"https://api.github.com/users/NiteshKant/repos","events_url":"https://api.github.com/users/NiteshKant/events{/privacy}","received_events_url":"https://api.github.com/users/NiteshKant/received_events","type":"User","site_admin":false},"created_at":"2016-01-14T00:00:52Z","updated_at":"2016-01-14T00:00:52Z","body":"@fzakaria The idea of the global metric listener factory is to specify a metrics listener for __all__ clients created in the JVM without having to specify them separately for each client individually.\r\n\r\nThis usually is useful if you as an application writer use different libraries that create different clients. As, you do not have control over the metrics they use, you can control the metrics publishing for all clients globally.\r\n\r\nIf you need to control which metric listener to use individually for each client/server, you can instantiate and subscribe that listener to the client in question. This way you will have access to the listener instance and control on what you would want to do per client.\r\n\r\nHaving said the above, why would you need to access the instance of the listener created?"}}