src/com/newrelic/metrics/publish/Runner.java
/**
         * Collect and report metric data.
         */
Collect and report metric data.
Collect and report metric data .
@Override
        public void run() {
            try {
                logger.debug("Harvest and report data");
                Request request = context.createRequest();
                for (Iterator<Agent> iterator = componentAgents.iterator(); iterator.hasNext();) {
                    Agent agent = iterator.next();
                    agent.getCollector().setRequest(request);
                    logger.debug("Beginning poll cycle for agent: '", agent.getAgentName(), "'");
                    agent.pollCycle();
                    logger.debug("Ending poll cycle for agent: '", agent.getAgentName(), "'");
                }
                request.deliver();
            } catch (Exception e) {
                System.err.println("SEVERE: An error has occurred");
                e.printStackTrace();
            }
        }
@ Override public void run ( ) { try { logger . debug ( "Harvest and report data" ) ; Request request = context . createRequest ( ) ; for ( Iterator < Agent > iterator = componentAgents . iterator ( ) ; iterator . hasNext ( ) ; ) { Agent agent = iterator . next ( ) ; agent . getCollector ( ) . setRequest ( request ) ; logger . debug ( "Beginning poll cycle for agent: '" , agent . getAgentName ( ) , "'" ) ; agent . pollCycle ( ) ; logger . debug ( "Ending poll cycle for agent: '" , agent . getAgentName ( ) , "'" ) ; } request . deliver ( ) ; } catch ( Exception e ) { System . err . println ( "SEVERE: An error has occurred" ) ; e . printStackTrace ( ) ; } }
Collect and report metric data.
Collect and report metric data .
// log exception and continue polling -- could be a transient issue // java.lang.Error(s) are thrown and handled by the main thread