Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.yammer.metrics.jetty;
  
 
 
     private final Timer duration;
     private final Meter acceptsconnectsdisconnects;
     private final Counter connections;
 
     public InstrumentedSslSocketConnector(int port) {
         this(Metrics.defaultRegistry(), port);
     }
 
     public InstrumentedSslSocketConnector(MetricsRegistry registryint port) {
         super();
         setPort(port);
         this. = registry.newTimer(SocketConnector.class,
                                           "connection-duration",
                                           Integer.toString(port),
                                           .,
                                           .);
         this. = registry.newMeter(SocketConnector.class,
                                          "accepts",
                                          Integer.toString(port),
                                          "connections",
                                          .);
         this. = registry.newMeter(SocketConnector.class,
                                           "connects",
                                           Integer.toString(port),
                                           "connections",
                                           .);
         this. = registry.newMeter(SocketConnector.class,
                                              "disconnects",
                                              Integer.toString(port),
                                              "connections",
                                              .);
         this. = registry.newCounter(SocketConnector.class,
                                                "active-connections",
                                                Integer.toString(port));
     }
 
     public InstrumentedSslSocketConnector(SslContextFactory contextFactoryint port) {
         this(contextFactory, Metrics.defaultRegistry(), port);
     }
 
     public InstrumentedSslSocketConnector(SslContextFactory contextFactoryMetricsRegistry registryint port) {
         super(contextFactory);
         setPort(port);
         this. = registry.newTimer(SocketConnector.class,
                                           "connection-duration",
                                           Integer.toString(port),
                                           .,
                                           .);
         this. = registry.newMeter(SocketConnector.class,
                                          "accepts",
                                          Integer.toString(port),
                                          "connections",
                                          .);
         this. = registry.newMeter(SocketConnector.class,
                                           "connects",
                                           Integer.toString(port),
                                           "connections",
                                           .);
         this. = registry.newMeter(SocketConnector.class,
                                              "disconnects",
                                              Integer.toString(port),
                                              "connections",
                                              .);
         this. = registry.newCounter(SocketConnector.class,
                                                "active-connections",
                                                Integer.toString(port));
     }
 
     @Override
     public void accept(int acceptorIDthrows IOExceptionInterruptedException {
         super.accept(acceptorID);
         .mark();
     }
 
     @Override
     protected void connectionOpened(Connection connection) {
         .inc();
         super.connectionOpened(connection);
         .mark();
     }
 
     @Override
     protected void connectionClosed(Connection connection) {
        super.connectionClosed(connection);
        .mark();
        final long duration = System.currentTimeMillis() - connection.getTimeStamp();
        this..update(duration.);
        .dec();
    }
New to GrepCode? Check out our FAQ X