use of com.emc.storageos.vasa.data.internal.StatList in project coprhd-controller by CoprHD.
the class SyncManager method getStatistics.
public synchronized StatList getStatistics(Date date) throws SOSFailure {
final String methodName = "getStatistics(): ";
final String TIMESTAMP_PATTERN = "yyyy-MM-dd'T'HH";
String timestamp = new SimpleDateFormat(TIMESTAMP_PATTERN).format(date);
log.trace(methodName + "Entry with timestamp[" + timestamp + "]");
StatList statListObj = null;
statListObj = this.getStatistics(timestamp);
log.trace(methodName + "Exit returing statListObj[" + statListObj + "]");
return statListObj;
}
use of com.emc.storageos.vasa.data.internal.StatList in project coprhd-controller by CoprHD.
the class SyncManager method getStatistics.
/**
* Returns Bourne stats list based on given timestamp
*
* @param timestamp
* of the format <code>YYYY-MM-DDTHH:mm</code>
* @return Object of <code>EventList</code>
* @throws SOSFailure
* if call(s) to Bourne fails
*/
public synchronized StatList getStatistics(String timestamp) throws SOSFailure {
final String methodName = "getStatistics(): ";
final String METER_URI = "/metering/stats.xml/?time_bucket=%s";
log.trace(methodName + "Entry with timestamp[" + timestamp + "]");
StatList statListObj = null;
try {
statListObj = _client.queryObject(String.format(METER_URI, timestamp), StatList.class);
} catch (NoSuchAlgorithmException e) {
log.error(methodName + "NoSuchAlgorithmException occured", e);
throw new SOSFailure(e);
} catch (UniformInterfaceException e) {
log.error(methodName + "UniformInterfaceException occured", e);
throw new SOSFailure(e);
}
log.trace(methodName + "Exit returing eventListObj[" + statListObj + "]");
return statListObj;
}
Aggregations