Examples of addObservation()


Examples of com.jamieallen.sdisruptor.collections.Histogram.addObservation()

    @Test
    public void shouldNotAddObservation()
    {
        Histogram histogram = new Histogram(new long[]{ 10, 20, 30 });
        assertFalse(histogram.addObservation(31));
    }

    @Test
    public void shouldAddObservations()
    {
View Full Code Here

Examples of com.jamieallen.sdisruptor.collections.Histogram.addObservation()

        final long[] INTERVALS = new long[]{ 100, 110, 120, 130, 140, 150, 1000, 10000 };
        final Histogram histogram = new Histogram(INTERVALS);

        for (long i = 100; i < 152; i++)
        {
            histogram.addObservation(i);
        }

        assertThat(histogram.getMean(), is(new BigDecimal("125.02")));
    }
View Full Code Here

Examples of com.jamieallen.sdisruptor.collections.Histogram.addObservation()

        final long[] INTERVALS = new long[]{ 1, 10, 100, 1000, 10000 };
        final Histogram histogram = new Histogram(INTERVALS);

        for (long i = 1; i < 101; i++)
        {
            histogram.addObservation(i);
        }

        assertThat(Long.valueOf(histogram.getTwoNinesUpperBound()), is(Long.valueOf(100L)));
    }
View Full Code Here

Examples of com.jamieallen.sdisruptor.collections.Histogram.addObservation()

        final long[] INTERVALS = new long[]{ 1, 10, 100, 1000, 10000 };
        final Histogram histogram = new Histogram(INTERVALS);

        for (long i = 1; i < 102; i++)
        {
            histogram.addObservation(i);
        }

        assertThat(Long.valueOf(histogram.getFourNinesUpperBound()), is(Long.valueOf(1000L)));
    }
View Full Code Here

Examples of com.lmax.disruptor.collections.Histogram.addObservation()

        if (monitoring != null) {
            monitoring.shutdownNow();
        }
        final Histogram histogram = new Histogram(sizeHistogramBounds);
        for (final int observation : endpointSizeQueue) {
            histogram.addObservation(observation);
        }
        System.out.printf("%82s %s%n", "Endpoint size (# exchanges pending):", histogram.toString());
    }

    @Override
View Full Code Here

Examples of com.lmax.disruptor.collections.Histogram.addObservation()

        }

        public Histogram getLatencyHistogram() {
            final Histogram histogram = new Histogram(LATENCY_HISTOGRAM_BOUNDS);
            for (final Long latencyValue : latencyQueue) {
                histogram.addObservation(latencyValue / 1000000);
            }
            return histogram;
        }
    }
View Full Code Here

Examples of de.uniluebeck.itm.ncoap.application.server.webservice.ObservableWebservice.addObservation()

                    coapResponse.setToken(coapRequest.getToken());

                    if(coapResponse.isUpdateNotification()){
                        if(webservice instanceof ObservableWebservice && coapRequest.getObserve() == 0){
                            ObservableWebservice observableWebservice = (ObservableWebservice) webservice;
                            observableWebservice.addObservation(remoteEndpoint, coapResponse.getToken(),
                                    coapResponse.getContentFormat());
                            sendUpdateNotification(ctx, remoteEndpoint, coapResponse, observableWebservice);
                        }
                        else{
                            coapResponse.removeOptions(OptionValue.Name.OBSERVE);
View Full Code Here

Examples of org.jfree.data.statistics.SimpleHistogramDataset.addObservation()

        assertTrue(d1.getClass() == d2.getClass());
        assertTrue(d1.equals(d2));

        // check that clone is independent of the original
        d2.addBin(new SimpleHistogramBin(2.0, 3.0));
        d2.addObservation(2.3);
        assertFalse(d1.equals(d2));
    }

    /**
     * Serialize an instance, restore it, and check for equality.
View Full Code Here

Examples of org.jfree.data.statistics.SimpleHistogramDataset.addObservation()

    public void testClearObservations() {
        SimpleHistogramDataset d1 = new SimpleHistogramDataset("D1");
        d1.clearObservations();
        assertEquals(0, d1.getItemCount(0));
        d1.addBin(new SimpleHistogramBin(0.0, 1.0));
        d1.addObservation(0.5);
        assertEquals(1.0, d1.getYValue(0, 0), EPSILON);
    }

    /**
     * Some checks for the removeAllBins() method.
View Full Code Here

Examples of org.jfree.data.statistics.SimpleHistogramDataset.addObservation()

     * Some checks for the removeAllBins() method.
     */
    public void testRemoveAllBins() {
        SimpleHistogramDataset d1 = new SimpleHistogramDataset("D1");
        d1.addBin(new SimpleHistogramBin(0.0, 1.0));
        d1.addObservation(0.5);
        d1.addBin(new SimpleHistogramBin(2.0, 3.0));
        assertEquals(2, d1.getItemCount(0));
        d1.removeAllBins();
        assertEquals(0, d1.getItemCount(0));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.