01: // SocketClientFactoryStats.java
02: // $Id: SocketClientFactoryStats.java,v 1.2 2000/08/16 21:37:42 ylafon Exp $
03: // (c) COPYRIGHT MIT, INRIA and Keio, 1999.
04: // Please first read the full copyright statement in file COPYRIGHT.html
05:
06: package org.w3c.jigsaw.http.socket;
07:
08: public class SocketClientFactoryStats /* extends ClientFactoryStats */{
09: SocketClientFactory pool = null;
10:
11: private static final String __avg[] = { "Light", "Average", "High",
12: "Dead" };
13:
14: public int getFreeConnectionsCount() {
15: return pool.freeCount;
16: }
17:
18: public int getIdleConnectionsCount() {
19: return pool.idleCount;
20: }
21:
22: public int getClientCount() {
23: return pool.clientCount;
24: }
25:
26: public int getLoadAverage() {
27: return pool.loadavg;
28: }
29:
30: public String getServerLoad() {
31: return __avg[pool.loadavg - 1];
32: }
33:
34: /*
35: SocketClientState cs = null;
36: cs = (SocketClientState) pool.freeList.getHead();
37: while (cs != null) {
38: System.out.println(cs.client
39: + " reqcount="
40: + cs.client.getRequestCount()
41: + ", bindcount="
42: + cs.client.getBindCount());
43: cs = (SocketClientState)pool.freeList.getNext((LRUAble)cs);
44: }
45: */
46:
47: public SocketClientFactoryStats(SocketClientFactory pool) {
48: this.pool = pool;
49: }
50: }
|