Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • Thanks for the nice answer! Indeed, the naming in the original question was very misleading, mainly because I had to change the actual naming in my system to avoid disclosing too much about it. What you are proposing is indeed very similar to what I had in mind, but there are a few problems: resource1 (and the rest of resources) are members of Supervisor. That's fine, I'm ok with Collector being managed by Supervisor. But the problem is that I don't really have a resource.getData(), especially not in an uniform way like this. Commented Oct 17, 2019 at 8:30
  • In my system, the resources are quite complex, and store a variety of stuff (all related, of course). They do provide a bunch of getters for what they have, but it's not a simple getData. That's why my ideal was to have a way for the metric classes to access the resources and get what they need from there. Actually, my ideal system would register in collector the metrics and the resources, and then only call collector.collect(). Then, the collector would call metrics.store(), and metrics would select what they need. Commented Oct 17, 2019 at 8:33
  • The downside is that I need some references to resources in collector, which I don't think is very nice and here comes this question. If you have any other insight, it would be greatly appreciated. Commented Oct 17, 2019 at 8:34