com.netease.cloud.util.TimingInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nos-sdk-java-publiccloud Show documentation
Show all versions of nos-sdk-java-publiccloud Show documentation
nos java sdk to the Central Repository
The newest version!
package com.netease.cloud.util;
import java.util.HashMap;
import java.util.Map;
public class TimingInfo {
private final long startTime;
private long endTime;
private Map subMeasurementsByName = new HashMap();
private Map countersByName = new HashMap();
public TimingInfo() {
this(System.currentTimeMillis(), -1);
}
public TimingInfo(long startTime) {
this(startTime, -1);
}
public TimingInfo(long startTime, long endTime) {
this.startTime = startTime;
this.endTime = endTime;
}
/**
* Returns the time, in epoch milliseconds, at which this timing period started.
*
* @return the time, in epoch milliseconds, at which this timing period started.
*/
public long getStartTime() {
return startTime;
}
public long getEndTime() {
return endTime;
}
public void setEndTime(long endTime) {
this.endTime = endTime;
}
public void addSubMeasurement(String subMeasurementName, TimingInfo timingInfo) {
subMeasurementsByName.put(subMeasurementName, timingInfo);
}
public TimingInfo getSubMeasurement(String subMeasurementName) {
return subMeasurementsByName.get(subMeasurementName);
}
public void addCounter(String key, Number value) {
countersByName.put(key, value);
}
public Number getCounter(String key) {
return countersByName.get(key);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy