All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.kiwiproject.dropwizard.util.metrics.ServerLoadGauge Maven / Gradle / Ivy

There is a newer version: 4.0.1
Show newest version
package org.kiwiproject.dropwizard.util.metrics;

import static org.kiwiproject.base.KiwiStrings.format;

import com.codahale.metrics.Gauge;

/**
 * A {@link Gauge} that reports the current server load average, as reported by the {@code uptime} command.
 * 

* If the load average was not obtainable for some reason, returns {@link ServerLoadFetcher#NO_VALUE} */ public class ServerLoadGauge implements Gauge{ public static final String NAME = format("{}.{}.load-average", ServerLoadGauge.class.getPackage().getName(), ServerLoadGauge.class.getSimpleName().replace("Gauge", "")); private final ServerLoadFetcher loadAverage = new ServerLoadFetcher(); @Override public String getValue() { return loadAverage.get().orElse(ServerLoadFetcher.NO_VALUE); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy