Package com.proofpoint.stats

Examples of com.proofpoint.stats.SparseTimeStat$Distribution


    @Test
    public void testStartedWithServices()
            throws Exception
    {
        ImmutableSet<URI> expected = ImmutableSet.of(URI.create("http://apple-a.example.com"), URI.create("https://apple-a.example.com"));
        SparseTimeStat failureTimeStat = mock(SparseTimeStat.class);
        when(httpServiceBalancerStats.requestTime(any(URI.class), eq(Status.FAILURE))).thenReturn(failureTimeStat);
        SparseTimeStat successTimeStat = mock(SparseTimeStat.class);
        when(httpServiceBalancerStats.requestTime(any(URI.class), eq(Status.SUCCESS))).thenReturn(successTimeStat);
        SparseCounterStat counterStat = mock(SparseCounterStat.class);
        when(httpServiceBalancerStats.failure(any(URI.class), eq("testing failure"))).thenReturn(counterStat);

        httpServiceBalancer.updateHttpUris(expected);
View Full Code Here


    public void testTakesUpdates()
            throws Exception
    {
        URI firstUri = URI.create("http://apple-a.example.com");
        URI secondUri = URI.create("https://apple-a.example.com");
        SparseTimeStat failureTimeStat = mock(SparseTimeStat.class);
        when(httpServiceBalancerStats.requestTime(any(URI.class), eq(Status.FAILURE))).thenReturn(failureTimeStat);
        SparseTimeStat successTimeStat = mock(SparseTimeStat.class);
        when(httpServiceBalancerStats.requestTime(any(URI.class), eq(Status.SUCCESS))).thenReturn(successTimeStat);
        SparseCounterStat counterStat = mock(SparseCounterStat.class);
        when(httpServiceBalancerStats.failure(any(URI.class), eq("testing failure"))).thenReturn(counterStat);

        httpServiceBalancer.updateHttpUris(ImmutableSet.of(firstUri));
View Full Code Here

    @Test
    public void testReuseUri()
            throws Exception
    {
        ImmutableSet<URI> expected = ImmutableSet.of(URI.create("http://apple-a.example.com"), URI.create("https://apple-a.example.com"));
        SparseTimeStat failureTimeStat = mock(SparseTimeStat.class);
        when(httpServiceBalancerStats.requestTime(any(URI.class), eq(Status.FAILURE))).thenReturn(failureTimeStat);
        SparseTimeStat successTimeStat = mock(SparseTimeStat.class);
        when(httpServiceBalancerStats.requestTime(any(URI.class), eq(Status.SUCCESS))).thenReturn(successTimeStat);
        SparseCounterStat counterStat = mock(SparseCounterStat.class);
        when(httpServiceBalancerStats.failure(any(URI.class), eq("testing failure"))).thenReturn(counterStat);

        httpServiceBalancer.updateHttpUris(expected);
View Full Code Here

    @Test
    public void testMinimizeConcurrentAttempts()
            throws Exception
    {
        ImmutableSet<URI> expected = ImmutableSet.of(URI.create("http://apple-a.example.com"), URI.create("https://apple-a.example.com"));
        SparseTimeStat failureTimeStat = mock(SparseTimeStat.class);
        when(httpServiceBalancerStats.requestTime(any(URI.class), eq(Status.FAILURE))).thenReturn(failureTimeStat);
        SparseTimeStat successTimeStat = mock(SparseTimeStat.class);
        when(httpServiceBalancerStats.requestTime(any(URI.class), eq(Status.SUCCESS))).thenReturn(successTimeStat);
        SparseCounterStat counterStat = mock(SparseCounterStat.class);
        when(httpServiceBalancerStats.failure(any(URI.class), eq("testing failure"))).thenReturn(counterStat);

        httpServiceBalancer.updateHttpUris(expected);
View Full Code Here

    public static class DetailedRequestStats implements com.proofpoint.http.server.DetailedRequestStats
    {
        @Override
        public SparseTimeStat requestTimeByCode(int responseCode)
        {
            return new SparseTimeStat();
        }
View Full Code Here

    m_isLeaf = false;
    m_isEmpty = false;
    m_sons = null;
    indeX = 0;
    sumOfWeights = data.sumOfWeights();
    noSplit = new NoSplit (new Distribution((Instances)data));
    if (leaf)
      m_localModel = noSplit;
    else
      m_localModel = m_toSelectModel.selectModel(data);
    if (m_localModel.numSubsets() > 1) {
View Full Code Here

    m_isLeaf = false;
    m_isEmpty = false;
    m_sons = null;
    indeX = 0;
    sumOfWeights = train.sumOfWeights();
    noSplit = new NoSplit (new Distribution((Instances)train));
    if (leaf)
      m_localModel = noSplit;
    else
      m_localModel = m_toSelectModel.selectModel(train, test);
    m_test = new Distribution(test, m_localModel);
    if (m_localModel.numSubsets() > 1) {
      localTrain = m_localModel.split(train);
      localTest = m_localModel.split(test);
      train = null;
      test = null;
View Full Code Here

  /**
   * Computes error estimate for tree.
   */
  private double errorsForTree() throws Exception {

    Distribution test;

    if (m_isLeaf)
      return errorsForLeaf();
    else {
      double error = 0;
View Full Code Here

    m_isLeaf = false;
    m_isEmpty = false;
    m_sons = null;
    indeX = 0;
    sumOfWeights = data.sumOfWeights();
    noSplit = new NoSplit (new Distribution((Instances)data));
    if (leaf)
      m_localModel = noSplit;
    else
      m_localModel = m_toSelectModel.selectModel(data);
    if (m_localModel.numSubsets() > 1) {
View Full Code Here

    } else {
      getSplitPoint();
      m_numSubsets = 2;
    }
    //create distribution for data
    m_distribution = new Distribution(data, this)
  }
View Full Code Here

TOP

Related Classes of com.proofpoint.stats.SparseTimeStat$Distribution

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.