Package com.yammer.metrics.core

Examples of com.yammer.metrics.core.HealthCheck


        this.mongo = mongo;
    }

    @Override
    protected void doStart() {
        HealthChecks.register(new HealthCheck(HEALTH_CHECK_NAME) {
            @Override
            protected Result check() throws Exception {
                try {
                    mongo.getDatabaseNames();
                    return Result.healthy(mongo.debugString());
View Full Code Here


    private MetricsHealthCheck check;

    public YammerHealthCheck( Class<?> origin, String name, final MetricsHealthCheck check )
    {
        this.check = check;
        HealthChecks.register( new HealthCheck( name )
        {
            @Override
            protected Result check()
                throws Exception
            {
View Full Code Here

*/
public class FreeFileHandlesHealthCheck implements HealthCheckFactory {

    @Override
    public HealthCheck create(ServiceContext context) {
        return new HealthCheck("Sufficient free file handles") {
            @Override
            protected Result check() throws Exception {
                try {
                    OperatingSystemMXBean osMbean = ManagementFactory.getOperatingSystemMXBean();
                    if(osMbean instanceof UnixOperatingSystemMXBean) {
View Full Code Here

* Date: 3/26/12
* Time: 9:01 AM
*/
public class LuceneIndexHealthCheck implements HealthCheckFactory {
    public HealthCheck create(final ServiceContext context) {
        return new HealthCheck("Lucene Index") {
            @Override
            protected Result check() throws Exception {
                GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME);

                SearchManager searchMan = gc.getBean(SearchManager.class);
View Full Code Here

* Date: 3/26/12
* Time: 9:01 AM
*/
public class NoIndexErrorsHealthCheck implements HealthCheckFactory {
    public HealthCheck create(final ServiceContext context) {
        return new HealthCheck("Metadata Index Errors") {
            @Override
            protected Result check() throws Exception {
                GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME);

                SearchManager searchMan = gc.getBean(SearchManager.class);
View Full Code Here

* Date: 3/26/12
* Time: 9:01 AM
*/
public class DatabaseHealthCheck implements HealthCheckFactory {
    public HealthCheck create(final ServiceContext context) {
        return new HealthCheck("Database Connection") {
            @Override
            protected Result check() throws Exception {
                try {
                    context.getBean(SettingRepository.class).count();
                    return Result.healthy();
View Full Code Here

* Date: 3/26/12
* Time: 9:01 AM
*/
public class CswGetCapabilitiesHealthCheck implements HealthCheckFactory {
    public HealthCheck create(final ServiceContext context) {
        return new HealthCheck("Csw GetCapabilities") {
            @Override
            protected Result check() throws Exception {
                try {
          LocalServiceRequest request = LocalServiceRequest.create("local://csw?request=GetCapabilities&service=CSW");
          request.setDebug(false);
View Full Code Here

* Date: 3/26/12
* Time: 9:01 AM
*/
public class CswGetRecordsHealthCheck implements HealthCheckFactory {
    public HealthCheck create(final ServiceContext context) {
        return new HealthCheck("Csw GetRecords") {
            @Override
            protected Result check() throws Exception {
                try {
          LocalServiceRequest request = LocalServiceRequest.create("local://csw?request=GetRecords&service=CSW&MaxRecords=1&constraintlanguage=FILTER&version=2.0.2&resulttype=results");
          request.setDebug(false);
View Full Code Here

*/
public class FreeConnectionsHealthCheck implements HealthCheckFactory {

    @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);
View Full Code Here

public class FieldCacheSanityHealthCheck implements HealthCheckFactory {

    @Override
    public HealthCheck create(ServiceContext context) {
        return new HealthCheck("Default Field Cache Sanity") {
            @Override
            protected Result check() throws Exception {
                StringBuilder b = new StringBuilder();
                check(b, FieldCache.DEFAULT);
View Full Code Here

TOP

Related Classes of com.yammer.metrics.core.HealthCheck

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.