Package jmt.engine.dataAnalysis.measureOutputs

Examples of jmt.engine.dataAnalysis.measureOutputs.VerboseCSVMeasureOutputReader


  }
 
  //reads file and generates graph. Code linked with code of CSVOutputReader.
  private void loadCSV() throws IOException, ParseException {
    File measureFile = new File(filename);
    VerboseCSVMeasureOutputReader reader = new VerboseCSVMeasureOutputReader(measureFile, measureDefinition.getLogDecimalSeparator(),measureDefinition.getLogCsvDelimiter());
    statistics = new SampleStatistics();
   
    // Skips header.
    updateProgress(0.0);
    reader.openFile(start > 1 ? start : 1);
    try {
      long lastUpdateTime = System.currentTimeMillis();
      while(reader.hasMoreLines()) {
        reader.readLine();
        statistics.putNewSample(reader.getParsedSample(), reader.getParsedWeight());
        // Fills distribution if present
        if (dist != null) {
          dist.addSample(reader.getParsedSample(), reader.getParsedWeight());
        }
        if (System.currentTimeMillis() - lastUpdateTime > UPDATE_PCT_MILLIS) {
          updateProgress(reader.getParsedPercentage());
          lastUpdateTime = System.currentTimeMillis();
        }
        if (end > 0 && reader.getLineNumber() >= end) {
          break;
        }
      }
      // If totalLines was not set, count them.
      if (totalLines <= 0) {
        while(reader.hasMoreLines()) {
          reader.readLine();
        }
        totalLines = reader.getLineNumber();
      }
    } finally {
      reader.closeFile();
      updateProgress(100.0);
    }
  }
View Full Code Here

TOP

Related Classes of jmt.engine.dataAnalysis.measureOutputs.VerboseCSVMeasureOutputReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.