LoadStopwatchReport.java :  » Profiler » stopwatch » com » commsen » stopwatch » reports » Java Open Source

Java Open Source » Profiler » stopwatch 
stopwatch » com » commsen » stopwatch » reports » LoadStopwatchReport.java
/*
 * $Id: LoadStopwatchReport.java,v 1.1 2006/03/01 17:48:05 azzazzel Exp $
 *
 * Copyright 2006 Commsen International
 * 
 * Licensed under the Common Public License, Version 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.opensource.org/licenses/cpl1.0.txt
 * 
 * THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
 * EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS 
 * OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
 *
 */
package com.commsen.stopwatch.reports;


/**
 * This report contains additional "load" statistics.  
 * The value of "load" shows how many instances of the code being measured are running simultaneously.
 * This report is udes by  {@link com.commsen.stopwatch.engines.LoadStopwatchEngine} 
 *
 * @author Milen Dyankov
 */
public class LoadStopwatchReport extends DefaultStopwatchReport {

  private static final long serialVersionUID = 1L;
  
  private long minLoad;
  private long maxLoad;
  private long averageLoad;


  /**
   * @param group
   * @param label
   * @param count
   * @param minTime
   * @param maxTime
   * @param averageTime
   * @param totalTime
   * @param minLoad
   * @param maxLoad
   * @param averageLoad
   */
  public LoadStopwatchReport(String group, String label, long count, long minTime, long maxTime, long averageTime, long totalTime, long minLoad, long maxLoad, long averageLoad) {
    super (group, label, count, minTime, maxTime, averageTime, totalTime);
    this.minLoad = minLoad;
    this.maxLoad = maxLoad;
    this.averageLoad = averageLoad;
  }

  /**
   * Generates string representation of this report
   * @see java.lang.Object#toString()
   */
  public String toString() {
    return 
      new StringBuffer(super.toString())
      .append("  MinLoad=").append(minLoad) 
      .append("  AvgLoad=").append(averageLoad) 
      .append("  MaxLoad=").append(maxLoad) 
      .toString();
  }
  

  /**
   * @return Returns the averageLoad.
   */
  public long getAverageLoad() {
    return averageLoad;
  }

  /**
   * @return Returns the maxLoad.
   */
  public long getMaxLoad() {
    return maxLoad;
  }

  /**
   * @return Returns the minLoad.
   */
  public long getMinLoad() {
    return minLoad;
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.