コード例 #1
0
 public boolean hasFlights(String airport_code) {
   Histogram<String> h = this.getFightsPerAirportHistogram(airport_code);
   if (h != null) {
     return (h.getSampleCount() > 0);
   }
   return (false);
 }
コード例 #2
0
  @Override
  public void benchmarkHasUpdated(BenchmarkResults br) {
    if (this.stop) return;

    Pair<Long, Long> p = br.computeTotalAndDelta();
    assert (p != null);

    boolean new_eviction = this.evicting.compareAndSet(true, false);

    // INTERVAL THROUGHPUT
    long txnDelta = p.getSecond();
    double intervalThroughput = txnDelta / (double) (br.getIntervalDuration()) * 1000.0;

    // INTERVAL LATENCY
    Histogram<Integer> lastLatencies = br.getLastSinglePartitionLatencies();
    double intervalLatency =
        HistogramUtil.sum(lastLatencies) / (double) lastLatencies.getSampleCount();

    Object row[] = {
      this.intervalCounter++,
      br.getElapsedTime(),
      br.getLastTimestamp(),
      txnDelta,
      intervalThroughput,
      intervalLatency,
      0,
    };
    this.results.add(row);

    if (new_eviction) {
      synchronized (CSVResultsPrinter.class) {
        if (this.last_eviction_stop == -1) {
          this.last_eviction_row = row;
        } else {
          this.updateLastEviction(row);
          this.last_eviction_row = null;
        }
      } // SYNCH
    }
  }