When I am running my NewRelic plugin, it seems to be calling pollCycle twice in a row.

82 Views Asked by At

I have written a NewRelic plugin. I have been debugging it, and noticed that the pollCycle is being called twice in a row. Since we are resetting our data after each call, this is causing some very skewed numbers. Anybody have any idea why this is happening or how I can stop it?

1

There are 1 best solutions below

0
On BEST ANSWER

In the New Relic Java SDK for plugin development, the pollCycle() method is invoked once for each Agent that is added via the runner.add() method. The runner will call the pollCycle() method once for each component created by these agent factories.

You can verify that this is the case by only adding one of the two factories and seeing that pollCycle() is called only once.