annotate src/org/dancres/blitz/stats/IOStat.java @ 34:6f68e94c1fb8 default tip

Add CondensedStats monitoring utility, equivalent to vmstat
author Dominic Cleal <dominic-cleal@cdo2.com>
date Thu, 05 Aug 2010 11:07:25 +0100
parents 3dc0c5604566
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
1 package org.dancres.blitz.stats;
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
2
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
3 /**
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
4 <p>Tracks WriteDaemon statistics. This stat is permanently enabled and
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
5 cannot be switched on or off. It's maintenance costs are entirely absorbed
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
6 by the caller recovering stats from StatsBoard.</p>
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
7
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
8 @see org.dancres.blitz.disk.WriteDaemon
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
9 */
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
10 public class IOStat implements Stat {
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
11 private long theId;
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
12
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
13 private double theTimePerIn;
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
14 private double theTimePerOut;
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
15 private double theInOutRatio;
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
16 private int theQueueSize;
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
17 private int theThrottleCount;
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
18
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
19 public IOStat(long anId, double aTimePerIn, double aTimePerOut,
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
20 double anInOutRatio, int aQueueSize, int aThrottleCount) {
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
21 theId = anId;
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
22 theTimePerIn = aTimePerIn;
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
23 theTimePerOut = aTimePerOut;
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
24 theInOutRatio = anInOutRatio;
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
25 theQueueSize = aQueueSize;
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
26 theThrottleCount = aThrottleCount;
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
27 }
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
28
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
29 public long getId() {
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
30 return theId;
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
31 }
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
32
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
33 public double getTimePerIn() {
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
34 return theTimePerIn;
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
35 }
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
36
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
37 public double getTimePerOut() {
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
38 return theTimePerOut;
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
39 }
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
40
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
41 public double getInOutRatio() {
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
42 return theInOutRatio;
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
43 }
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
44
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
45 public int getQueueSize() {
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
46 return theQueueSize;
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
47 }
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
48
34
6f68e94c1fb8 Add CondensedStats monitoring utility, equivalent to vmstat
Dominic Cleal <dominic-cleal@cdo2.com>
parents: 0
diff changeset
49 public int getThrottleCount() {
6f68e94c1fb8 Add CondensedStats monitoring utility, equivalent to vmstat
Dominic Cleal <dominic-cleal@cdo2.com>
parents: 0
diff changeset
50 return theThrottleCount;
6f68e94c1fb8 Add CondensedStats monitoring utility, equivalent to vmstat
Dominic Cleal <dominic-cleal@cdo2.com>
parents: 0
diff changeset
51 }
6f68e94c1fb8 Add CondensedStats monitoring utility, equivalent to vmstat
Dominic Cleal <dominic-cleal@cdo2.com>
parents: 0
diff changeset
52
0
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
53 public String toString() {
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
54 return "IO TPI: " + theTimePerIn + " TPO: " + theTimePerOut + " IOR: " +
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
55 theInOutRatio + " QSZ: " + theQueueSize + " THROTTLE: " +
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
56 theThrottleCount;
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
57 }
3dc0c5604566 Initial checkin of blitz 2.0 fcs - no installer yet.
Dan Creswell <dan.creswell@gmail.com>
parents:
diff changeset
58 }