return command;
}
@Override
protected void collectData(ToolConfig config, long time, MigrationResult result) {
HPROF_Parser p = new HPROF_Parser();
p.parse(makeOutputFilename(config, time)+".hprof");
for (Measure measure: getMeasures()) {
Measurement m = new Measurement();
m.setMeasureId(measure.getUri());
PositiveFloatValue v = (PositiveFloatValue) measure.getScale().createValue();
// if (property.getName().equals(MigrationResult.MIGRES_MEMORY_GROSS)) {
// v.setValue(p.getTotal_allocated());
// }
// if (property.getName().equals(MigrationResult.MIGRES_MEMORY_NET)) {
// v.setValue(p.getTotal_virtual());
// }
if (measure.getUri().equals(MigrationResult.MIGRES_MEMORY_GROSS)) {
v.setValue(p.getTotal_allocated());
}
/**
* this is NOT the total virtual memory used during execution
* it's the virtual memory still allocated when HProf collects information
* - if garbage collector was called, this value is lower than the actual v-memory consumption
*/
if (measure.getUri().equals("performance:totalVirtualMemory")) {
v.setValue(p.getTotal_virtual());
}
if (measure.getUri().equals("performance:totalAllocatedMemory")) {
v.setValue(p.getTotal_allocated());
}
m.setValue(v);
result.getMeasurements().put(measure.getUri(), m);
}
}