Package restx.common.metrics.dummy

Examples of restx.common.metrics.dummy.DummyMetricRegistry


                // this won't be used if a MetricsRegistry is provided through a higher priority machine
                .put("MetricRegistryMachine", new SingleNameFactoryMachine<>(10000,
                        new NoDepsMachineEngine<MetricRegistry>(METRICS_NAME, 10000, BoundlessComponentBox.FACTORY) {
                            @Override
                            protected MetricRegistry doNewComponent(SatisfiedBOM satisfiedBOM) {
                                return new DummyMetricRegistry();
                            }
                        }))

                ;

        if (!warehouse.getProviders().isEmpty()) {
            machineBuilder
                    .put("WarehouseProvidersMachine", new WarehouseProvidersMachine(warehouse.getProviders()));
        }

        machinesByBuilder = machineBuilder
                .putAll(machines)
                .build();

        this.machines = ImmutableList.copyOf(
                Ordering.from(new Comparator<FactoryMachine>() {
                    @Override
                    public int compare(FactoryMachine o1, FactoryMachine o2) {
                        return Integer.compare(o1.priority(), o2.priority());
                    }
                }).sortedCopy(machinesByBuilder.values()));
        this.id = String.format("%03d-%s(%d)", ID.incrementAndGet(), warehouse.getId(), machinesByBuilder.size());
        this.warehouse = checkNotNull(warehouse);

        this.metrics = new DummyMetricRegistry(); // give a value so that we can call getComponent which uses metrics to trace
                                             // the MetricRegistry building itself
        this.metrics = getComponent(MetricRegistry.class);
    }
View Full Code Here

TOP

Related Classes of restx.common.metrics.dummy.DummyMetricRegistry

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.