slightly improve indexing stats by keep a count of file errors and remembering the total files

This commit is contained in:
Jean-Francois Dockes
2016-04-11 17:23:02 +02:00
parent adacb86605
commit d0400bdce7
4 changed files with 53 additions and 44 deletions
+13 -11
View File
@@ -39,12 +39,11 @@ void RclMain::idxStatus()
cs.get("phase", val);
status.phase = DbIxStatus::Phase(atoi(val.c_str()));
cs.get("fn", status.fn);
cs.get("docsdone", val);
status.docsdone = atoi(val.c_str());
cs.get("filesdone", val);
status.filesdone = atoi(val.c_str());
cs.get("dbtotdocs", val);
status.dbtotdocs = atoi(val.c_str());
cs.get("docsdone", &status.docsdone);
cs.get("filesdone", &status.filesdone);
cs.get("fileerrors", &status.fileerrors);
cs.get("dbtotdocs", &status.dbtotdocs);
cs.get("totfiles", &status.totfiles);
QString phs;
switch (status.phase) {
@@ -60,11 +59,14 @@ void RclMain::idxStatus()
msg += phs + " ";
if (status.phase == DbIxStatus::DBIXS_FILES) {
char cnts[100];
if (status.dbtotdocs > 0)
sprintf(cnts,"(%d/%d/%d) ", status.docsdone, status.filesdone,
status.dbtotdocs);
else
sprintf(cnts, "(%d/%d) ", status.docsdone, status.filesdone);
if (status.dbtotdocs > 0) {
sprintf(cnts, "(%d docs/%d files/%d errors/%d tot files) ",
status.docsdone, status.filesdone, status.fileerrors,
status.totfiles);
} else {
sprintf(cnts, "(%d docs/%d files/%d errors) ",
status.docsdone, status.filesdone, status.fileerrors);
}
msg += QString::fromUtf8(cnts) + " ";
}
string mf;int ecnt = 0;