Examples of Counter


Examples of com.asakusafw.runtime.directio.Counter

        LocalFileSystem fs = FileSystem.getLocal(format.getConf());
        ModelInput<T> input = format.createInput(
                format.getSupportedType(),
                fs, new Path(file.toURI()),
                0, file.length(),
                new Counter());
        try {
            List<T> results = new ArrayList<T>();
            while (true) {
                @SuppressWarnings("unchecked")
                T value = (T) format.getDataModelDescriptor().createDataModelObject();
View Full Code Here

Examples of com.cloud.network.as.Counter

        return s_name;
    }

    @Override
    public void create() {
        Counter ctr = null;
        ctr = _autoScaleService.createCounter(this);

        if (ctr != null) {
            this.setEntityId(ctr.getId());
            this.setEntityUuid(ctr.getUuid());
            CounterResponse response = _responseGenerator.createCounterResponse(ctr);
            response.setResponseName(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create Counter with name " + getName());
View Full Code Here

Examples of com.codahale.metrics.Counter

    private MetricRegistry getMockMetricRegistry() {
        final MetricRegistry mockMetricRegistry = mock(MetricRegistry.class);
        final Meter mockMeter = mock(Meter.class);
        final Timer mockTimer = mock(Timer.class);
        final Counter mockCounter = mock(Counter.class);
        when(mockMetricRegistry.meter(anyString())).thenReturn(mockMeter);
        when(mockMetricRegistry.timer(anyString())).thenReturn(mockTimer);
        when(mockMetricRegistry.counter(anyString())).thenReturn(mockCounter);

        return mockMetricRegistry;
View Full Code Here

Examples of com.example.Counter

        Registry r = buildRegistry(ReloadAwareModule.class);

        assertEquals(ReloadAwareModule.counterInstantiations, 0);
        assertEquals(ReloadAwareModule.counterReloads, 0);

        Counter counter = r.proxy(Counter.class, CounterImpl.class);

        assertEquals(ReloadAwareModule.counterInstantiations, 0);

        assertEquals(counter.increment(), 1);
        assertEquals(counter.increment(), 2);

        assertEquals(ReloadAwareModule.counterInstantiations, 1);

        URL classURL = CounterImpl.class.getResource("CounterImpl.class");

        File classFile = new File(classURL.toURI());

        touch(classFile);

        assertEquals(ReloadAwareModule.counterInstantiations, 1);
        assertEquals(ReloadAwareModule.counterReloads, 0);

        fireUpdateCheck(r);

        assertEquals(ReloadAwareModule.counterInstantiations, 2);
        assertEquals(ReloadAwareModule.counterReloads, 1);

        // Check that internal state has reset

        assertEquals(counter.increment(), 1);

        r.shutdown();
    }
View Full Code Here

Examples of com.google.appengine.tools.mapreduce.Counter

    return out.toString();
  }

  @Override
  public Counter getCounter(String name) {
    Counter counter = values.get(name);
    if (counter == null) {
      counter = new CounterImpl(name);
      values.put(name, counter);
    }
    return counter;
View Full Code Here

Examples of com.gs.collections.impl.Counter

    }

    @Override
    public int hashCode()
    {
        final Counter counter = new Counter();
        this.forEachWithOccurrences(new ObjectIntProcedure<T>()
        {
            public void value(T each, int count)
            {
                counter.add((each == null ? 0 : each.hashCode()) ^ count);
            }
        });
        return counter.getCount();
    }
View Full Code Here

Examples of com.netflix.servo.monitor.Counter

            LoggerFactory.getLogger(NormalizationTransform.class);

    private static final String DEFAULT_DSTYPE = DataSourceType.RATE.name();

    static Counter newCounter(String name) {
        Counter c = Monitors.newCounter(name);
        DefaultMonitorRegistry.getInstance().register(c);
        return c;
    }
View Full Code Here

Examples of com.netflix.zuul.plugins.Counter

        LOG.info("Registering Servo Tracer");
        TracerFactory.initialize(new Tracer());

        LOG.info("Registering Servo Counter");
        CounterFactory.initialize(new Counter());

        LOG.info("Starting CPU stats");
        final ThreadCpuStats stats = ThreadCpuStats.getInstance();
        stats.start();
    }
View Full Code Here

Examples of com.openkm.kea.util.Counter

          .toString()));
      Iterator<String> it = hash.keySet().iterator();
     
      while (it.hasNext()) {
        String phrase = it.next();
        Counter counter = (Counter) m_KEAFilter.m_Dictionary.get(phrase);
        if (counter == null) {
          m_KEAFilter.m_Dictionary.put(phrase, new Counter());
        } else {
          counter.increment();
        }
      }
    }
  }
View Full Code Here

Examples of com.proofpoint.stats.BucketedCounter.Counter

    private void assertPreviousCount(BucketedCounter counter, double expected)
            throws Exception
    {
        Method method = Bucketed.class.getDeclaredMethod("getPreviousBucket");
        method.setAccessible(true);
        Counter previousBucket = (Counter) method.invoke(counter);
        assertEquals(previousBucket.getCount(), expected);
    }
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.