Package com.proofpoint.stats

Examples of com.proofpoint.stats.SparseTimeStat$BlockTimer


    @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

TOP

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

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.