use of org.ow2.proactive_grid_cloud_portal.common.StatHistoryCaching.StatHistoryCacheEntry in project scheduling by ow2-proactive.
the class RMRest method getStatHistory.
@Override
public String getStatHistory(String sessionId, String range1, String function) throws ReflectionException, InterruptedException, IntrospectionException, NotConnectedException, InstanceNotFoundException, MalformedObjectNameException, IOException {
String newRange = MBeanInfoViewer.possibleModifyRange(range1, dataSources, 'a');
StatHistoryCacheEntry entry = StatHistoryCaching.getInstance().getEntryOrCompute(newRange, () -> {
RMProxyUserInterface rm = checkAccess(sessionId);
AttributeList attrs = rm.getMBeanAttributes(new ObjectName(RMJMXBeans.RUNTIMEDATA_MBEAN_NAME), new String[] { "StatisticHistory" });
Attribute attr = (Attribute) attrs.get(0);
// content of the RRD4J database backing file
byte[] rrd4j = (byte[]) attr.getValue();
return MBeanInfoViewer.rrdContent(rrd4j, newRange, dataSources, function);
});
return entry.getValue();
}
Aggregations