@ PostConstruct public final void init ( ) throws URISyntaxException { final String address = getConfig ( ADDRESS , null ) ; if ( address != null ) { final URI uri = new URI ( "udp://" + address ) ; final String prefix = getConfig ( PREFIX , "mapfish-print" ) . replace ( "%h" , getHostname ( ) ) ; final int period = Integer . parseInt ( getConfig ( PERIOD , "10" ) ) ; LOGGER . info ( "Starting a StatsD reporter targeting {} with prefix {} and period {}s" , uri , prefix , period ) ; this . reporter = StatsDReporter . forRegistry ( this . metricRegistry ) . prefixedWith ( prefix ) . build ( uri . getHost ( ) , uri . getPort ( ) ) ; this . reporter . start ( period , TimeUnit . SECONDS ) ; } }
Start the StatsD reporter if configured .