F #4901: Updates MEM & CPU when RESERVED_ attributes are updated. Adds TOTAL_CPU

and TOTAL_MEM shares to store raw monitoring cpu/mem metrics. Adds
migrator and increases local DB version number.
This commit is contained in:
Ruben S. Montero committed 2016-11-12 21:18:25 +01:00
1 parent 09825bd7ba
commit 08d88e0119
8 files changed
+211 -12

No files matched your search

+15 -2
View File
@@ -318,6 +318,9 @@ public:
*/
void reset_capacity()
{
total_cpu = 0;
total_mem = 0;
max_cpu = 0;
max_mem = 0;
@@ -342,6 +345,13 @@ public:
*/
void set_capacity(Host *host, const string& crcpu, const string& crmem);
/**
* Update the capacity attributes when the RESERVED_CPU and RESERVED_MEM
* are updated.
* @param host for this share
*/
void update_capacity(Host *host);
/**
* Return the number of running VMs in this host
*/
@@ -356,9 +366,12 @@ private:
long long mem_usage; /**< Memory allocated to VMs (in KB) */
long long cpu_usage; /**< CPU allocated to VMs (in percentage) */
long long total_mem; /**< Total memory capacity (in KB) */
long long total_cpu; /**< Total cpu capacity (in percentage) */
long long max_disk; /**< Total disk capacity (in MB) */
long long max_mem; /**< Total memory capacity (in KB) */
long long max_cpu; /**< Total cpu capacity (in percentage) */
long long max_mem; /**< Total memory capacity (in KB) +/- reserved */
long long max_cpu; /**< Total cpu capacity (in percentage) +/- reserved*/
long long free_disk; /**< Free disk from the IM monitor */
long long free_mem; /**< Free memory from the IM monitor */
+1 -1
View File
@@ -353,7 +353,7 @@ public:
*/
static string local_db_version()
{
return "4.90.0";
return "5.2.0";
}
/**