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

co.paralleluniverse.fibers.MetricsFibersMonitor Maven / Gradle / Ivy

Go to download

The core library for Fibers on Java, compatible with Java 11-16. Forked from puniverse/quasar

There is a newer version: 10.0.6
Show newest version
package co.paralleluniverse.fibers;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

public abstract class MetricsFibersMonitor implements FibersMonitor {
	public static final String NUM_ACTIVE_FIBERS = "numActiveFibers";
	public static final String NUM_WAITING_FIBERS = "numWaitingFibers";
	public static final String SPURIOUS_WAKEUPS = "spuriousWakeups";
	public static final String TIMED_PARK_LATENCY = "timedParkLatency";
	public static final String RUNAWAY_FIBERS = "runawayFibers";
	protected Map problemFibers;

	protected final String metric(String poolName, String name) {
		return "co.paralleluniverse.fibers." + poolName + "." + name;
	}

	@Override
	public void setRunawayFibers(Collection fs) {
		if (fs == null || fs.isEmpty())
			this.problemFibers = null;
		else {
			this.problemFibers = new HashMap<>();
			for (Fiber f : fs)
				problemFibers.put(f, f.getStackTrace());
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy