com.ajjpj.asysmon.data.AHierarchicalData Maven / Gradle / Ivy
package com.ajjpj.asysmon.data;
import java.util.Collections;
import java.util.List;
import java.util.Map;
/**
* @author arno
*/
public class AHierarchicalData {
private final boolean isSerial;
private final long startTimeMillis;
private final long durationNanos;
private final String identifier;
private final Map parameters;
private final List children;
/**
* @param isSerial true
designates the intuitive situation that a parent 'contains' several non-overlapping measurements,
* with the sum of the children's durations being less than or equals to the parent's duration and the difference
* being spent in the parent itself.
* false
designates more exotic measurements that may 'overlap' other measurements etc., providing
* additional data but not being an additive part of the parent's duration. This could e.g. be the delay between
* sending an asynchronous request and receiving the response.
* @param identifier is used for aggregated rendering of results - measurements with equal identifiers are treated
* as 'equivalent'.
*/
public AHierarchicalData(boolean isSerial, long startTimeMillis, long durationNanos, String identifier, Map parameters, List children) {
this.isSerial = isSerial;
this.startTimeMillis = startTimeMillis;
this.durationNanos = durationNanos;
this.identifier = identifier;
this.parameters = Collections.unmodifiableMap(parameters);
this.children = Collections.unmodifiableList(children);
}
public boolean isSerial() {
return isSerial;
}
public long getStartTimeMillis() {
return startTimeMillis;
}
public long getDurationNanos() {
return durationNanos;
}
public String getIdentifier() {
return identifier;
}
public Map getParameters() {
return parameters;
}
public List getChildren() {
return children;
}
@Override
public String toString() {
return "AHierarchicalData {" + identifier + " " + parameters + " : " + children + "}";
}
}