diff src/org/dancres/blitz/stats/IOStat.java @ 0:3dc0c5604566

Initial checkin of blitz 2.0 fcs - no installer yet.
author Dan Creswell <dan.creswell@gmail.com>
date Sat, 21 Mar 2009 11:00:06 +0000
parents
children 6f68e94c1fb8
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/dancres/blitz/stats/IOStat.java	Sat Mar 21 11:00:06 2009 +0000
@@ -0,0 +1,54 @@
+package org.dancres.blitz.stats;
+
+/**
+   <p>Tracks WriteDaemon statistics.  This stat is permanently enabled and
+   cannot be switched on or off.  It's maintenance costs are entirely absorbed
+   by the caller recovering stats from StatsBoard.</p>
+
+   @see org.dancres.blitz.disk.WriteDaemon
+ */
+public class IOStat implements Stat {
+    private long theId;
+
+    private double theTimePerIn;
+    private double theTimePerOut;
+    private double theInOutRatio;
+    private int theQueueSize;
+    private int theThrottleCount;
+
+    public IOStat(long anId, double aTimePerIn, double aTimePerOut, 
+                  double anInOutRatio, int aQueueSize, int aThrottleCount) {
+        theId = anId;
+        theTimePerIn = aTimePerIn;
+        theTimePerOut = aTimePerOut;
+        theInOutRatio = anInOutRatio;
+        theQueueSize = aQueueSize;
+        theThrottleCount = aThrottleCount;
+    }
+
+    public long getId() {
+        return theId;
+    }
+
+    public double getTimePerIn() {
+        return theTimePerIn;
+    }
+
+    public double getTimePerOut() {
+        return theTimePerOut;
+    }
+
+    public double getInOutRatio() {
+        return theInOutRatio;
+    }
+
+    public int getQueueSize() {
+        return theQueueSize;
+    }
+
+    public String toString() {
+        return "IO TPI: " + theTimePerIn + " TPO: " + theTimePerOut + " IOR: " +
+            theInOutRatio + " QSZ: " + theQueueSize + " THROTTLE: " +
+            theThrottleCount;
+    }
+}