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

io.datakernel.jmx.JmxModuleInitializers Maven / Gradle / Ivy

Go to download

An intelligent way of booting complex applications and services according to their dependencies

There is a newer version: 3.1.0
Show newest version
package io.datakernel.jmx;

import com.google.inject.Key;
import com.google.inject.name.Names;
import io.datakernel.eventloop.Eventloop;
import io.datakernel.util.Initializer;

public class JmxModuleInitializers {
	private JmxModuleInitializers() {
	}

	public static final String GLOBAL_EVENTLOOP_NAME = "GlobalEventloopStats";
	public static final Key GLOBAL_EVENTLOOP_KEY = Key.get(Eventloop.class, Names.named(GLOBAL_EVENTLOOP_NAME));

	public static Initializer ofGlobalEventloopStats() {
		return jmxModule -> jmxModule
				.withGlobalMBean(Eventloop.class, GLOBAL_EVENTLOOP_KEY)
				.withOptional(GLOBAL_EVENTLOOP_KEY, "fatalErrors_total")
				.withOptional(GLOBAL_EVENTLOOP_KEY, "businessLogicTime_smoothedAverage")
				.withOptional(GLOBAL_EVENTLOOP_KEY, "loops_totalCount")
				.withOptional(GLOBAL_EVENTLOOP_KEY, "loops_smoothedRate")
				.withOptional(GLOBAL_EVENTLOOP_KEY, "idleLoops_totalCount")
				.withOptional(GLOBAL_EVENTLOOP_KEY, "idleLoops_smoothedRate")
				.withOptional(GLOBAL_EVENTLOOP_KEY, "selectOverdues_totalCount")
				.withOptional(GLOBAL_EVENTLOOP_KEY, "selectOverdues_smoothedRate");
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy