mirror of
https://github.com/OpenNebula/one.git
synced 2025-02-03 13:47:01 +03:00
Feature #1678: Make the DS monitorization more generic
System DS do not have ln and clone targets, and this change allows monitorization to return any arbitrary values to be used in SCHED_REQ and SCHED_RANK, like FS speed
This commit is contained in:
parent
149dab3525
commit
79472b23e1
@ -170,6 +170,21 @@ public:
|
||||
used_mb = used;
|
||||
}
|
||||
|
||||
void process_poll(Template &monitor_data)
|
||||
{
|
||||
string err;
|
||||
|
||||
monitor_data.get("TOTAL_MB", total_mb);
|
||||
monitor_data.get("FREE_MB", free_mb);
|
||||
monitor_data.get("USED_MB", used_mb);
|
||||
|
||||
monitor_data.erase("TOTAL_MB");
|
||||
monitor_data.erase("FREE_MB");
|
||||
monitor_data.erase("USED_MB");
|
||||
|
||||
obj_template->merge(&monitor_data, err);
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the available capacity in the datastore.
|
||||
* @params avail the total available size in the datastore (MB)
|
||||
|
@ -663,18 +663,7 @@ void ImageManagerDriver::process_poll(Datastore* ds, const string &monitor_str)
|
||||
return;
|
||||
}
|
||||
|
||||
long long total, free, used;
|
||||
string ln_tgt, cl_tgt;
|
||||
|
||||
monitor_data.get("TOTAL_MB", total);
|
||||
monitor_data.get("FREE_MB", free);
|
||||
monitor_data.get("USED_MB", used);
|
||||
monitor_data.get("LN_TARGET", ln_tgt);
|
||||
monitor_data.get("CLONE_TARGET", cl_tgt);
|
||||
|
||||
ds->update_monitor(total, free, used);
|
||||
ds->replace_template_attribute("LN_TARGET", ln_tgt);
|
||||
ds->replace_template_attribute("CLONE_TARGET", cl_tgt);
|
||||
ds->process_poll(monitor_data);
|
||||
|
||||
dspool->update(ds);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user