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 InstrumentedSslSelectChannelConnector(int port) {
         this(Metrics.defaultRegistry(), port);
     }
 
     public InstrumentedSslSelectChannelConnector(SslContextFactory factoryint port) {
         this(Metrics.defaultRegistry(), portfactory);
     }
 
     public InstrumentedSslSelectChannelConnector(MetricsRegistry registryint port) {
         super();
         setPort(port);
         this. = registry.newTimer(SelectChannelConnector.class,
                                           "connection-duration",
                                           Integer.toString(port),
                                           .,
                                           .);
         this. = registry.newMeter(SelectChannelConnector.class,
                                          "accepts",
                                          Integer.toString(port),
                                          "connections",
                                          .);
         this. = registry.newMeter(SelectChannelConnector.class,
                                           "connects",
                                           Integer.toString(port),
                                           "connections",
                                           .);
         this. = registry.newMeter(SelectChannelConnector.class,
                                              "disconnects",
                                              Integer.toString(port),
                                              "connections",
                                              .);
         this. = registry.newCounter(SelectChannelConnector.class,
                                                "active-connections",
                                                Integer.toString(port));
 
     }
 
                                                  int port,
                                                  SslContextFactory factory) {
         super(factory);
         setPort(port);
         this. = registry.newTimer(SslSelectChannelConnector.class,
                                           "connection-duration",
                                           Integer.toString(port),
                                           .,
                                           .);
         this. = registry.newMeter(SslSelectChannelConnector.class,
                                          "accepts",
                                          Integer.toString(port),
                                          "connections",
                                          .);
         this. = registry.newMeter(SslSelectChannelConnector.class,
                                           "connects",
                                           Integer.toString(port),
                                           "connections",
                                           .);
         this. = registry.newMeter(SslSelectChannelConnector.class,
                                              "disconnects",
                                              Integer.toString(port),
                                              "connections",
                                              .);
         this. = registry.newCounter(SslSelectChannelConnector.class,
                                                "active-connections",
                                                Integer.toString(port));
 
     }
 
     public InstrumentedSslSelectChannelConnector(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 IOException {
        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