Skip to content

Commit

Permalink
Fix: division by zero in throughput
Browse files Browse the repository at this point in the history
  • Loading branch information
masumsoft committed Oct 12, 2017
1 parent c1491df commit a69a9d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion export.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function processTableExport(table) {
var startTime = Date.now();
jsonfile.on('finish', function () {
var timeTaken = (Date.now() - startTime) / 1000;
var throughput = processed / timeTaken;
var throughput = timeTaken ? processed / timeTaken : 0.00;
console.log('Done with table, throughput: ' + throughput.toFixed(1) + ' rows/s');
resolve();
});
Expand Down
2 changes: 1 addition & 1 deletion import.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function processTableImport(table) {
Promise.all(queryPromises)
.then(function (){
var timeTaken = (Date.now() - startTime) / 1000;
var throughput = processed / timeTaken;
var throughput = timeTaken ? processed / timeTaken : 0.00;
console.log('Done with table, throughput: ' + throughput.toFixed(1) + ' rows/s');
resolve();
})
Expand Down

0 comments on commit a69a9d0

Please sign in to comment.