diff options
| author | Grant Limberg <[email protected]> | 2021-09-15 09:45:10 -0700 |
|---|---|---|
| committer | Grant Limberg <[email protected]> | 2021-09-20 15:39:44 -0700 |
| commit | 90025555969532c5ceaf668068345115820bf003 (patch) | |
| tree | 20dbf2263a29cd6ccf86ee49c056178165d2427f /controller/PostgreSQL.cpp | |
| parent | 3b375b55c2437a97942aba9fe7662e748a6909ff (diff) | |
ensure count > 0
Diffstat (limited to 'controller/PostgreSQL.cpp')
| -rw-r--r-- | controller/PostgreSQL.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/controller/PostgreSQL.cpp b/controller/PostgreSQL.cpp index 89f5cb9b..50b12841 100644 --- a/controller/PostgreSQL.cpp +++ b/controller/PostgreSQL.cpp @@ -594,12 +594,14 @@ void PostgreSQL::initializeNetworks() auto dur = std::chrono::duration_cast<std::chrono::microseconds>(end - start);; total += dur.count(); ++count; - if (count % 10000 == 0) { + if (count > 0 && count % 10000 == 0) { fprintf(stderr, "Averaging %llu us per network\n", (total/count)); } } - fprintf(stderr, "Took %llu us per network to load\n", (total/count)); + if (count > 0) { + fprintf(stderr, "Took %llu us per network to load\n", (total/count)); + } stream.complete(); w.commit(); @@ -748,11 +750,13 @@ void PostgreSQL::initializeMembers() auto dur = std::chrono::duration_cast<std::chrono::microseconds>(end - start);; total += dur.count(); ++count; - if (count % 10000 == 0) { + if (count > 0 && count % 10000 == 0) { fprintf(stderr, "Averaging %llu us per member\n", (total/count)); } } - fprintf(stderr, "Took %llu us per member to load\n", (total/count)); + if (count > 0) { + fprintf(stderr, "Took %llu us per member to load\n", (total/count)); + } stream.complete(); |
