Search in sources :

Example 1 with StatList

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;
}
Also used : StatList(com.emc.storageos.vasa.data.internal.StatList) SimpleDateFormat(java.text.SimpleDateFormat)

Example 2 with StatList

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;
}
Also used : StatList(com.emc.storageos.vasa.data.internal.StatList) UniformInterfaceException(com.sun.jersey.api.client.UniformInterfaceException) SOSFailure(com.emc.storageos.vasa.fault.SOSFailure) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException)

Aggregations

StatList (com.emc.storageos.vasa.data.internal.StatList)2 SOSFailure (com.emc.storageos.vasa.fault.SOSFailure)1 UniformInterfaceException (com.sun.jersey.api.client.UniformInterfaceException)1 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1 SimpleDateFormat (java.text.SimpleDateFormat)1