示例#1
0
  public String statString() {
    long timetotal = 0;

    if (_timestart != 0) {
      timetotal = System.currentTimeMillis() - _timestart;
    }

    return ("elapsedtime="
        + timetotal
        + "; rate="
        + HCUtil.megabytesPerSecond(timetotal, _bytesMoved)
        + " "
        + HCUtil.gigsPerDay(timetotal, _bytesMoved));
  }
示例#2
0
  public Metric[] getCurrentMetrics() {
    long timetotal = 0;
    if (_timestart != 0) {
      timetotal = System.currentTimeMillis() - _timestart;
    }

    Metric metrics[] = new Metric[6];
    metrics[0] = new Metric("TotalCalls", "calls", _totalcalls);
    metrics[1] = new Metric("BytesMoved", "bytes", _bytesMoved);
    metrics[2] = new Metric("BytesRemaining", "bytes", _size - _bytesMoved);
    metrics[3] =
        new Metric(
            "RateMegabytesPerSecond", "MB/sec", HCUtil.megabytesPerSecond(timetotal, _bytesMoved));
    metrics[4] =
        new Metric("RateGigabytesPerSecond", "GB/sec", HCUtil.gigsPerDay(timetotal, _bytesMoved));
    metrics[5] = new Metric("ElapsedTime", "milliseconds", timetotal);

    return (metrics);
  }
示例#3
0
 /**
  * Return the hash. Note that this can only be called once. Subsequent calls reset the hash.
  * MessageDigest doc says: Completes the hash computation by performing final operations such as
  * padding.
  */
 public String computeHash() {
   System.out.println(
       "XXXXXXXXXXXXXX calcHash="
           + calcHash
           + "TestRequestParameters.getCalcHash()="
           + TestRequestParameters.getCalcHash());
   if (calcHash && TestRequestParameters.getCalcHash())
     _hash = HCUtil.convertHashBytesToString(_md.digest());
   else _hash = "hash disabled";
   return _hash;
 }