/** * This method should be called when non-idle activity has taken place. */ public void notIdle() { idleTimestamp = Millisecond100Clock.currentTimeMillis(); }
/** * This method should be called when non-idle activity has taken place. */ public void notIdle() { idleTimestamp = Millisecond100Clock.currentTimeMillis(); }
@Override public long getDuration() { if (closeTime > 0) { return closeTime - openTime; } else { return Millisecond100Clock.currentTimeMillis() - openTime; } }
@Override public long getDuration() { if (closeTime > 0) { return closeTime - openTime; } else { return Millisecond100Clock.currentTimeMillis() - openTime; } }
/** * This method should be called when non-idle activity has taken place. */ public void notIdle() { idleTimestamp = Millisecond100Clock.currentTimeMillis(); }
public SSLContext getSSLContextWithManager(KeyManager[] km, TrustManager[] tm, SecureRandom random) throws NoSuchAlgorithmException, KeyManagementException, NoSuchProviderException { long start = Millisecond100Clock.currentTimeMillis(); final SSLContext sslContext = SSLContext.getInstance("TLSv1.2", provideName); sslContext.init(km, tm, random); long end = Millisecond100Clock.currentTimeMillis(); log.info("creating Conscrypt SSL context spends {} ms", (end - start)); return sslContext; }
public SSLContext getSSLContextWithManager(KeyManager[] km, TrustManager[] tm, SecureRandom random) throws NoSuchAlgorithmException, KeyManagementException { long start = Millisecond100Clock.currentTimeMillis(); final SSLContext sslContext = SSLContext.getInstance("TLSv1.2"); sslContext.init(km, tm, random); long end = Millisecond100Clock.currentTimeMillis(); log.info("creating SSL context spends {} ms", (end - start)); return sslContext; }
public void flush() { if (bufferedOutputStream != null) { try { bufferedOutputStream.flush(); lastFlushTime = Millisecond100Clock.currentTimeMillis(); } catch (IOException e) { System.err.println("flush log buffer exception, " + e.getMessage()); } } }
AsynchronousTcpSession(int sessionId, Config config, SessionMetric sessionMetric, NetEvent netEvent, AsynchronousSocketChannel socketChannel) { this.sessionId = sessionId; this.openTime = Millisecond100Clock.currentTimeMillis(); this.config = config; this.netEvent = netEvent; this.socketChannel = socketChannel; this.sessionMetric = sessionMetric; this.sessionMetric.getActiveSessionCount().inc(); }
private long flushAllPerSecond(final long lastFlushedTime) { // flush all log buffer per one second long timeDifference = Millisecond100Clock.currentTimeMillis() - lastFlushedTime; if (timeDifference > 1000) { LogFactory.getInstance().flushAll(); return Millisecond100Clock.currentTimeMillis(); } else { return lastFlushedTime; } }
@Override public long getIdleTimeout() { return Millisecond100Clock.currentTimeMillis() - getLastActiveTime(); }
public SSLContext getSSLContextWithManager(KeyManager[] km, TrustManager[] tm, SecureRandom random) throws NoSuchAlgorithmException, KeyManagementException { long start = Millisecond100Clock.currentTimeMillis(); final SSLContext sslContext = SSLContext.getInstance("TLSv1.2"); sslContext.init(km, tm, random); _handle_BUG_JDK_8022063(sslContext); long end = Millisecond100Clock.currentTimeMillis(); log.info("creating SSL context spends {} ms", (end - start)); return sslContext; }
AsynchronousTcpSession(int sessionId, Config config, SessionMetric sessionMetric, NetEvent netEvent, AsynchronousSocketChannel socketChannel) { this.sessionId = sessionId; this.openTime = Millisecond100Clock.currentTimeMillis(); this.config = config; this.netEvent = netEvent; this.socketChannel = socketChannel; this.sessionMetric = sessionMetric; this.sessionMetric.getActiveSessionCount().inc(); }
@Override public CompletableFuture<Boolean> put(String key, HTTPSession value) { if (key != null && value != null) { if (!value.isNewSession()) { value.setLastAccessedTime(Millisecond100Clock.currentTimeMillis()); } map.put(key, value); } return success(); }
@Override public CompletableFuture<Boolean> put(String key, HTTPSession value) { if (key != null && value != null) { if (!value.isNewSession()) { value.setLastAccessedTime(Millisecond100Clock.currentTimeMillis()); } map.put(key, value); } return success(); }
public PooledObject(T object, Pool<T> pool, Action0 leakCallback) { this.object = object; this.pool = pool; this.leakCallback = leakCallback; createTime = Millisecond100Clock.currentTimeMillis(); activeTime = createTime; phantomReference = pool.getLeakDetector().register(this, () -> { pool.decreaseCreatedObjectSize(); leakCallback.call(); }); }
public PooledObject(T object, Pool<T> pool, Action0 leakCallback) { this.object = object; this.pool = pool; this.leakCallback = leakCallback; createTime = Millisecond100Clock.currentTimeMillis(); activeTime = createTime; phantomReference = pool.getLeakDetector().register(this, () -> { pool.decreaseCreatedObjectSize(); leakCallback.call(); }); }
@Override public CompletableFuture<Boolean> put(String key, HTTPSession value) { value.setLastAccessedTime(Millisecond100Clock.currentTimeMillis()); return toFuture(map.fastPut(key, value, ttl, TimeUnit.SECONDS, value.getMaxInactiveInterval(), TimeUnit.SECONDS)); }
public static HTTPSession create(String id, int maxInactiveInterval) { HTTPSession session = new HTTPSession(); session.setId(id); session.setMaxInactiveInterval(maxInactiveInterval); session.setCreationTime(Millisecond100Clock.currentTimeMillis()); session.setLastAccessedTime(session.getCreationTime()); session.setAttributes(new HashMap<>()); session.setNewSession(true); return session; }
public static HTTPSession create(String id, int maxInactiveInterval) { HTTPSession session = new HTTPSession(); session.setId(id); session.setMaxInactiveInterval(maxInactiveInterval); session.setCreationTime(Millisecond100Clock.currentTimeMillis()); session.setLastAccessedTime(session.getCreationTime()); session.setAttributes(new HashMap<>()); session.setNewSession(true); return session; }