提交 d85c3a54 编写于 作者: J Jiri Denemark

Report auto convergence throttle rate in migration stats

Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
上级 445853e1
......@@ -2985,6 +2985,14 @@ int virDomainAbortJob(virDomainPtr dom);
*/
# define VIR_DOMAIN_JOB_COMPRESSION_OVERFLOW "compression_overflow"
/**
* VIR_DOMAIN_JOB_AUTO_CONVERGE_THROTTLE:
*
* virDomainGetJobStats field: current percentage guest CPUs are throttled
* to when auto-convergence decided migration was not converging, as
* VIR_TYPED_PARAM_INT.
*/
# define VIR_DOMAIN_JOB_AUTO_CONVERGE_THROTTLE "auto_converge_throttle"
/**
......
......@@ -458,6 +458,12 @@ qemuDomainJobInfoToParams(qemuDomainJobInfoPtr jobInfo,
goto error;
}
if (stats->cpu_throttle_percentage &&
virTypedParamsAddInt(&par, &npar, &maxpar,
VIR_DOMAIN_JOB_AUTO_CONVERGE_THROTTLE,
stats->cpu_throttle_percentage) < 0)
goto error;
*type = jobInfo->type;
*params = par;
*nparams = npar;
......
......@@ -807,6 +807,10 @@ qemuMigrationCookieStatisticsXMLFormat(virBufferPtr buf,
stats->xbzrle_overflow);
}
virBufferAsprintf(buf, "<%1$s>%2$d</%1$s>\n",
VIR_DOMAIN_JOB_AUTO_CONVERGE_THROTTLE,
stats->cpu_throttle_percentage);
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</statistics>\n");
}
......@@ -1152,6 +1156,8 @@ qemuMigrationCookieStatisticsXMLParse(xmlXPathContextPtr ctxt)
virXPathULongLong("string(./" VIR_DOMAIN_JOB_COMPRESSION_OVERFLOW "[1])",
ctxt, &stats->xbzrle_overflow);
virXPathInt("string(./" VIR_DOMAIN_JOB_AUTO_CONVERGE_THROTTLE "[1])",
ctxt, &stats->cpu_throttle_percentage);
cleanup:
ctxt->node = save_ctxt;
return jobInfo;
......
......@@ -562,6 +562,8 @@ struct _qemuMonitorMigrationStats {
unsigned long long xbzrle_pages;
unsigned long long xbzrle_cache_miss;
unsigned long long xbzrle_overflow;
int cpu_throttle_percentage;
};
int qemuMonitorGetMigrationStats(qemuMonitorPtr mon,
......
......@@ -2673,6 +2673,9 @@ qemuMonitorJSONGetMigrationStatsReply(virJSONValuePtr reply,
&stats->setup_time) == 0)
stats->setup_time_set = true;
ignore_value(virJSONValueObjectGetNumberInt(ret, "cpu-throttle-percentage",
&stats->cpu_throttle_percentage));
switch ((qemuMonitorMigrationStatus) stats->status) {
case QEMU_MONITOR_MIGRATION_STATUS_INACTIVE:
case QEMU_MONITOR_MIGRATION_STATUS_SETUP:
......
......@@ -5759,6 +5759,7 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
int nparams = 0;
unsigned long long value;
unsigned int flags = 0;
int ivalue;
int rc;
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
......@@ -5994,6 +5995,14 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
vshPrint(ctl, "%-17s %-13llu\n", _("Compression overflows:"), value);
}
if ((rc = virTypedParamsGetInt(params, nparams,
VIR_DOMAIN_JOB_AUTO_CONVERGE_THROTTLE,
&ivalue)) < 0) {
goto save_error;
} else if (rc) {
vshPrint(ctl, "%-17s %-13d\n", _("Auto converge throttle:"), ivalue);
}
ret = true;
cleanup:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册