view 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 source

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;
    }
}