Package jeeves.server.resources

Examples of jeeves.server.resources.Stats


        return metricsRegistry.newGauge(DataSource.class, name,new Gauge<T>() {
            @Override
            public T value() {
                T finalValue;
                try {
                    T val = valueImpl(new Stats(context));
                    if(val == null) {
                        finalValue = defaultValue();
                    } else {
                        finalValue = val;
                    }
View Full Code Here


    @Override
    public HealthCheck create(final ServiceContext context) {
        return new HealthCheck("Sufficient free connections in "+Geonet.Res.MAIN_DB) {
            @Override
            protected Result check() throws Exception {
                Stats stats;
                try {
                    stats = new Stats(context);
                    int free = stats.maxActive - stats.numActive;
                    double fivePercent = Math.max(2.0, ((double) stats.maxActive) * 0.01);
                    if (free < fivePercent) {
                        Result.unhealthy("There are insufficient free connections on database" + Geonet.Res.MAIN_DB
                                + ".  Connections free:" + free);
View Full Code Here

TOP

Related Classes of jeeves.server.resources.Stats

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.