Skip to content
Snippets Groups Projects
Commit 5169d15d authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Report average user record data size (in bytes) too

parent 837bb3c9
No related branches found
No related tags found
No related merge requests found
......@@ -420,6 +420,7 @@ bool upgrade_users(bool verify)
uint last = v31x_lastuser(&scfg);
uint largest = 0;
size_t maxlen = 0;
size_t total_bytes = 0;
char userdat[USER_RECORD_LINE_LEN];
char path[MAX_PATH + 1];
SAFEPRINTF(path, "%suser/user.tab", scfg.data_dir);
......@@ -455,6 +456,7 @@ bool upgrade_users(bool verify)
maxlen = len;
largest = user.number;
}
total_bytes += len;
if(verify) {
user_t new;
ZERO_VAR(new);
......@@ -478,8 +480,9 @@ bool upgrade_users(bool verify)
fclose(out);
time_t diff = time(NULL) - start;
printf("%u users converted successfully (%lu users/second), largest (#%u) = %u bytes\n"
,total_users, (ulong)(diff ? total_users / diff : total_users), largest, (unsigned)maxlen);
printf("%u users converted successfully (%lu users/second), largest (#%u) = %u bytes, avg = %u bytes\n"
,total_users, (ulong)(diff ? total_users / diff : total_users), largest, (unsigned)maxlen
,(unsigned int)total_bytes / total_users);
return result;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment