Spring Framework AbstractMonitoringInterceptor - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework AbstractMonitoringInterceptor class.

This code example shows how to use the following methods:createInvocationTraceName
        this.port = port; 
    } 
 
    @Override 
    protected Object invokeUnderTrace(MethodInvocation invocation, Log logger) throws Throwable { 
        String name = createInvocationTraceName(invocation); 
        long start = System.currentTimeMillis(); 
        try { 
            return invocation.proceed(); 
        } finally { 
            long end = System.currentTimeMillis(); 
            notifyStatsdCollector(name, end - start); 
        } 
    } 
 
    private void notifyStatsdCollector(String name, long durationMillis) { 
        try { 
            byte[] data = String.format("%s:%d|ms", name, durationMillis).getBytes("UTF-8"); 
            socket.send(new DatagramPacket(data, data.length, host, port)); 
        } catch (Exception e) { 
4
CodeRank