com.custardsource.parfait.timing.ThreadMetricSuite Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of parfait-core Show documentation
Show all versions of parfait-core Show documentation
Java performance monitoring framework, including PCP bridge
The newest version!
package com.custardsource.parfait.timing;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
public class ThreadMetricSuite {
private final List metrics;
private ThreadMetricSuite(Collection extends ThreadMetric> metrics) {
this.metrics = new CopyOnWriteArrayList(metrics);
}
public final void addMetric(ThreadMetric metric) {
metrics.add(metric);
}
public final void addAllMetrics(Collection metrics) {
this.metrics.addAll(metrics);
}
public final List metrics() {
return Collections.unmodifiableList(metrics);
}
public static ThreadMetricSuite blank() {
return new ThreadMetricSuite(Collections.emptyList());
}
public static ThreadMetricSuite withDefaultMetrics() {
return new ThreadMetricSuite(StandardThreadMetrics.defaults());
}
}