Package com.opengamma.util.monitor

Examples of com.opengamma.util.monitor.OperationTimer


          res += function.evaluate(x);
        }
      }
      res *= 2;
      if (BENCHMARK_CYCLES > 0) {
        final OperationTimer timer = new OperationTimer(s_logger, "processing {} cycles on integral", BENCHMARK_CYCLES);
        for (int count = 0; count < BENCHMARK_CYCLES; count++) {
          for (int i = 0; i < 100; i++) {
            final double x = -0. + i * 1000. / 100.0;
            res += function.evaluate(x);
          }
        }
        timer.finished();
      }
      res *= 3;
    }
  }
View Full Code Here


      if (bundle2WithDates.size() == 1) {
        System.out.printf("Loading ts for %s: dataField: %s dataProvider: %s startDate: %s endDate: %s\n", Iterables.get(bundle2WithDates.keySet(), 0), dataField, dataProvider, startDate, endDate);
      } else {
        System.out.printf("Loading %d ts:  dataField: %s dataProvider: %s startDate: %s endDate: %s\n", identifiersSize, dataField, dataProvider, startDate, endDate);
      }
      OperationTimer timer = new OperationTimer(s_logger, " loading " + identifiersSize + " timeseries from Bloomberg");
      Map<ExternalIdBundle, LocalDateDoubleTimeSeries> tsMap = provideTimeSeries(bundle2WithDates.keySet(), dataField, dataProvider, startDate, endDate);
      timer.finished();
     
      timer = new OperationTimer(s_logger, " storing " + identifiersSize + " timeseries from Bloomberg");
      storeTimeSeries(tsMap, dataField, dataProvider, withDates2ExternalId, bundle2WithDates, result);
      timer.finished();
    }
  }
View Full Code Here

  //-------------------------------------------------------------------------
  public WebViewGrid setIncludeDepGraph(WebGridCell cell, boolean includeDepGraph) {
    if (includeDepGraph) {
      String gridName = getName() + ".depgraph-" + cell.getRowId() + "-" + cell.getColumnId();
      OperationTimer timer = new OperationTimer(s_logger, "depgraph");
      Pair<String, ValueSpecification> columnMappingPair = getGridStructure().findCellSpecification(cell, getViewClient().getLatestCompiledViewDefinition());
      s_logger.debug("includeDepGraph took {}", timer.finished());
      WebViewDepGraphGrid grid = new WebViewDepGraphGrid(gridName, getViewClient(), getConverterCache(),
          getLocalSession(), getRemoteSession(), cell, columnMappingPair.getFirst(), columnMappingPair.getSecond(), getComputationTargetResolver());
      _depGraphGrids.putIfAbsent(cell, grid);
      return grid;
    } else {
View Full Code Here

      final DoubleMatrix1D startPosition) {
    for (int i = 0; i < HOTSPOT_WARMUP_CYCLES; i++) {
      doTest(minimizer, function, grad, startPosition);
    }
    if (BENCHMARK_CYCLES > 0) {
      final OperationTimer timer = new OperationTimer(s_logger, "processing {} cycles on " + name, BENCHMARK_CYCLES);
      for (int i = 0; i < BENCHMARK_CYCLES; i++) {
        doTest(minimizer, function, grad, startPosition);
      }
      timer.finished();
    }
  }
View Full Code Here

  public void doExactHotSpot() {
    for (int i = 0; i < HOTSPOT_WARMUP_CYCLES; i++) {
      solveExactWithoutGradientTest();
    }
    if (BENCHMARK_CYCLES > 0) {
      final OperationTimer timer = new OperationTimer(s_logger, "processing {} cycles on Levenberg-Marquardt", BENCHMARK_CYCLES);
      for (int i = 0; i < BENCHMARK_CYCLES; i++) {
        solveExactWithoutGradientTest();
      }
      timer.finished();
    }
  }
View Full Code Here

  public void doChiSqHotSpot() {
    for (int i = 0; i < HOTSPOT_WARMUP_CYCLES; i++) {
      solveExactFromChiSqTest();
    }
    if (BENCHMARK_CYCLES > 0) {
      final OperationTimer timer = new OperationTimer(s_logger, "processing {} cycles on Conjugate gradient", BENCHMARK_CYCLES);
      for (int i = 0; i < BENCHMARK_CYCLES; i++) {
        solveExactFromChiSqTest();
      }
      timer.finished();
    }
  }
View Full Code Here

        final double[] prices = multiPricers[i].price(VOL);
      }
    }

    if (benchmarkCycles > 0) {
      final OperationTimer timer = new OperationTimer(LOGGER, "processing {} cycles on timeTest - multiPricer", benchmarkCycles);
      for (int count = 0; count < benchmarkCycles; count++) {
        for (int i = 0; i < nStrikes; i++) {
          final double[] prices = multiPricers[i].price(VOL);
        }
      }
      timer.finished();
    }

    for (int count = 0; count < warmup; count++) {
      for (int i = 0; i < nStrikes; i++) {
        final int n = pricers[i].length;
        for (int j = 0; j < n; j++) {
          final double p = pricers[i][j].price(VOL);
        }
      }
    }

    if (benchmarkCycles > 0) {
      final OperationTimer timer2 = new OperationTimer(LOGGER, "processing {} cycles on timeTest - single Pricer", benchmarkCycles);
      for (int count = 0; count < benchmarkCycles; count++) {
        for (int i = 0; i < nStrikes; i++) {
          final int n = pricers[i].length;
          for (int j = 0; j < n; j++) {
            final double p = pricers[i][j].price(VOL);
          }
        }
      }
      timer2.finished();
    }
  }
View Full Code Here

        final double[] vols = multiPricers[i].impliedVols(VOL);
      }
    }

    if (benchmarkCycles > 0) {
      final OperationTimer timer = new OperationTimer(LOGGER, "processing {} cycles on timeTest - multiPricer", benchmarkCycles);
      for (int count = 0; count < benchmarkCycles; count++) {
        for (int i = 0; i < nStrikes; i++) {
          final double[] vols = multiPricers[i].impliedVols(VOL);
        }
      }
      timer.finished();
    }

    for (int count = 0; count < warmup; count++) {
      for (int i = 0; i < nStrikes; i++) {
        final int n = pricers[i].length;
        for (int j = 0; j < n; j++) {
          final double v = pricers[i][j].impliedVol(VOL);
        }
      }
    }

    if (benchmarkCycles > 0) {
      final OperationTimer timer2 = new OperationTimer(LOGGER, "processing {} cycles on timeTest - single Pricer", benchmarkCycles);
      for (int count = 0; count < benchmarkCycles; count++) {
        for (int i = 0; i < nStrikes; i++) {
          final int n = pricers[i].length;
          for (int j = 0; j < n; j++) {
            final double v = pricers[i][j].impliedVol(VOL);
          }
        }
      }
      timer2.finished();
    }
  }
View Full Code Here

  // GraphExecutionPlanner

  @Override
  public GraphExecutionPlan createPlan(final DependencyGraph graph, final ExecutionLogModeSource logModeSource, final long functionInitializationId) {
    final OperationTimer timer = new OperationTimer(s_logger, "Creating execution plan for {}", graph);
    try {
      if (graph.getSize() <= getMinimumJobItems()) {
        // If the graph is too small, run it as-is
        return createSingleNodePlan(graph, logModeSource, functionInitializationId);
      } else {
        // Split the graph into multiple fragments
        return createMultipleNodePlan(graph, logModeSource, functionInitializationId);
      }
    } finally {
      timer.finished();
    }
  }
View Full Code Here

      _subscriptionsLock.unlock();
    }
  }

  private void removeMarketDataSubscriptions(final Set<ValueSpecification> unusedSubscriptions) {
    final OperationTimer timer = new OperationTimer(s_logger, "Removing {} market data subscriptions", unusedSubscriptions.size());
    _subscriptionsLock.lock();
    try {
      _marketDataProvider.unsubscribe(unusedSubscriptions);
      ZonedDateTime removalTime = ZonedDateTime.now();
      for (ValueSpecification subscription : unusedSubscriptions) {
        if (!_removedSubscriptions.containsKey(subscription)) {
          _activeSubscriptions.remove(subscription);
          _pendingSubscriptions.remove(subscription);
          _failedSubscriptions.remove(subscription);
          _removedSubscriptions.put(subscription, removalTime);
        }
      }
    } finally {
      _subscriptionsLock.unlock();
    }
    timer.finished();
  }
View Full Code Here

TOP

Related Classes of com.opengamma.util.monitor.OperationTimer

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.