1 17 package org.apache.geronimo.jetty6; 18 19 import javax.management.j2ee.statistics.CountStatistic ; 20 import javax.management.j2ee.statistics.RangeStatistic ; 21 import javax.management.j2ee.statistics.TimeStatistic ; 22 23 import org.apache.geronimo.management.stats.CountStatisticImpl; 24 import org.apache.geronimo.management.stats.RangeStatisticImpl; 25 import org.apache.geronimo.management.stats.StatisticImpl; 26 import org.apache.geronimo.management.stats.StatsImpl; 27 import org.apache.geronimo.management.stats.TimeStatisticImpl; 28 29 34 public class JettyWebContainerStatsImpl extends StatsImpl implements JettyWebContainerStats { 35 private CountStatisticImpl totalConnectionCount; 36 private RangeStatisticImpl openConnectionCount; 37 private RangeStatisticImpl connectionRequestCount; 38 private TimeStatisticImpl connectionDuration; 39 private CountStatisticImpl totalErrorCount; 40 private CountStatisticImpl totalRequestCount; 41 private RangeStatisticImpl activeRequestCount; 42 private TimeStatisticImpl requestDuration; 43 private boolean statsOn=false; 44 45 public JettyWebContainerStatsImpl() { 46 totalConnectionCount = new CountStatisticImpl("Total Connections", StatisticImpl.UNIT_COUNT, 47 "The total number of connections since last reset"); 48 openConnectionCount = new RangeStatisticImpl("Open Connections", StatisticImpl.UNIT_COUNT, 49 "The number of connections open at present"); 50 connectionRequestCount = new RangeStatisticImpl("Connection Request Count", StatisticImpl.UNIT_COUNT, 51 "The number of requests handled by a particular connection"); 52 connectionDuration = new TimeStatisticImpl("Connection Duration", StatisticImpl.UNIT_TIME_MILLISECOND, 53 "The legnth of time that individual connections have been open"); 54 totalErrorCount = new CountStatisticImpl("Error Count", StatisticImpl.UNIT_COUNT, 55 "The number of reponses that were errors since statistics gathering started"); 56 totalRequestCount = new CountStatisticImpl("Request Count", StatisticImpl.UNIT_COUNT, 57 "The number of requests that were handled since statistics gathering started"); 58 activeRequestCount = new RangeStatisticImpl("Active Request Count", StatisticImpl.UNIT_COUNT, 59 "The number of requests being processed concurrently"); 60 requestDuration = new TimeStatisticImpl("Request Duration", StatisticImpl.UNIT_TIME_MILLISECOND, 61 "The length of time that it's taken to handle individual requests"); 62 63 addStat("TotalConnectionCount", totalConnectionCount); 64 addStat("OpenConnectionCount", openConnectionCount); 65 addStat("ConnectionRequestCount", connectionRequestCount); 66 addStat("ConnectionDuration", connectionDuration); 67 addStat("TotalErrorCount", totalErrorCount); 68 addStat("TotalRequestCount", totalRequestCount); 69 addStat("ActiveRequestCount", activeRequestCount); 70 addStat("RequestDuration", requestDuration); 71 } 72 73 public CountStatistic getTotalConnectionCount() { 74 return totalConnectionCount; 75 } 76 77 public RangeStatistic getOpenConnectionCount() { 78 return openConnectionCount; 79 } 80 81 public RangeStatistic getConnectionRequestCount() { 82 return connectionRequestCount; 83 } 84 85 public TimeStatistic getConnectionDuration() { 86 return connectionDuration; 87 } 88 89 public CountStatistic getTotalErrorCount() { 90 return totalErrorCount; 91 } 92 93 public CountStatistic getTotalRequestCount() { 94 return totalRequestCount; 95 } 96 97 public RangeStatistic getActiveRequestCount() { 98 return activeRequestCount; 99 } 100 101 public TimeStatistic getRequestDuration() { 102 return requestDuration; 103 } 104 105 public boolean isStatsOn() { 106 return statsOn; 107 } 108 109 public void setStatsOn(boolean on) { 110 statsOn = on; 111 } 112 113 public CountStatisticImpl getTotalConnectionCountImpl() { 114 return totalConnectionCount; 115 } 116 117 public RangeStatisticImpl getOpenConnectionCountImpl() { 118 return openConnectionCount; 119 } 120 121 public RangeStatisticImpl getConnectionRequestCountImpl() { 122 return connectionRequestCount; 123 } 124 125 public TimeStatisticImpl getConnectionDurationImpl() { 126 return connectionDuration; 127 } 128 129 public CountStatisticImpl getTotalErrorCountImpl() { 130 return totalErrorCount; 131 } 132 133 public CountStatisticImpl getTotalRequestCountImpl() { 134 return totalRequestCount; 135 } 136 137 public RangeStatisticImpl getActiveRequestCountImpl() { 138 return activeRequestCount; 139 } 140 141 public TimeStatisticImpl getRequestDurationImpl() { 142 return requestDuration; 143 } 144 } 145 | Popular Tags |