Package com.opengamma.engine.calcnode.stats

Examples of com.opengamma.engine.calcnode.stats.FunctionCosts


    assertEquals(planner(factory).getMaximumConcurrency(), 50);
  }

  public void testFunctionCosts() {
    final MultipleNodeExecutorFactory factory = new MultipleNodeExecutorFactory();
    FunctionCosts costs = factory.getFunctionCosts();
    assertSame(costs, planner(factory).getFunctionCosts());
    costs = new FunctionCosts();
    factory.setFunctionCosts(costs);
    assertSame(factory.getFunctionCosts(), costs);
    assertSame(planner(factory).getFunctionCosts(), costs);
  }
View Full Code Here


  public void simpleInvocation() {
    final JobDispatcher jobDispatcher = new JobDispatcher();
    final Ready initialMessage = new Ready(1, "Test");
    final DirectFudgeConnection conduit = new DirectFudgeConnection(s_fudgeContext);
    final RemoteNodeJobInvoker jobInvoker = new RemoteNodeJobInvoker(Executors.newCachedThreadPool(), initialMessage, conduit.getEnd1(), new InMemoryIdentifierMap(), new FunctionCosts(),
        new DummyFunctionBlacklistQuery(), new DummyFunctionBlacklistMaintainer());
    jobDispatcher.registerJobInvoker(jobInvoker);
    final TestJobResultReceiver resultReceiver = new TestJobResultReceiver();
    final FudgeConnection remoteNode = conduit.getEnd2();
    remoteNode.setFudgeMessageReceiver(new FudgeMessageReceiver() {
View Full Code Here

  public void saturate() {
    final JobDispatcher jobDispatcher = new JobDispatcher();
    final Ready initialMessage = new Ready(3, "Test");
    final DirectFudgeConnection conduit = new DirectFudgeConnection(s_fudgeContext);
    final RemoteNodeJobInvoker jobInvoker = new RemoteNodeJobInvoker(Executors.newCachedThreadPool(), initialMessage, conduit.getEnd1(), new InMemoryIdentifierMap(), new FunctionCosts(),
        new DummyFunctionBlacklistQuery(), new DummyFunctionBlacklistMaintainer());
    jobDispatcher.registerJobInvoker(jobInvoker);
    final FudgeConnection remoteNode = conduit.getEnd2();
    final Random rnd = new Random();
    remoteNode.setFudgeMessageReceiver(new FudgeMessageReceiver() {
View Full Code Here

  private FunctionCosts _costs;

  @BeforeMethod
  public void setUp() {
    _master = new InMemoryFunctionCostsMaster();
    _costs = new FunctionCosts(_master);
  }
View Full Code Here

    // Update stats and check the document updates (and the average)
    stats.recordInvocation(100, 500.0, 600.0, 700.0);
    writer.run();
    assertEquals(2, _master.size());
    // Create a new repository and check the values were preserved
    FunctionCosts costs = new FunctionCosts(_master);
    stats = costs.getStatistics("Default", "Foo");
    assertEquals(5.0, stats.getInvocationCost(), 0.05);
    assertEquals(6.0, stats.getDataInputCost(), 0.05);
    assertEquals(7.0, stats.getDataOutputCost(), 0.05);
  }
View Full Code Here

    stats = _costs.getStatistics("Default", "Cow");
    assertEquals(1.3, stats.getInvocationCost(), 0.05);
    assertEquals(1.7, stats.getDataInputCost(), 0.05);
    assertEquals(2.0, stats.getDataOutputCost(), 0.05);
    // Create a new repository and check the average was preserved
    FunctionCosts costs = new FunctionCosts(_master);
    stats = costs.getStatistics("Default", "Man");
    assertEquals(1.3, stats.getInvocationCost(), 0.05);
    assertEquals(1.7, stats.getDataInputCost(), 0.05);
    assertEquals(2.0, stats.getDataOutputCost(), 0.05);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.engine.calcnode.stats.FunctionCosts

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.