total_rows in copyto metrics
This commit is contained in:
parent
58b91275f0
commit
b9474e7fc3
@ -74,7 +74,8 @@ function handleCopyTo (statsClient) {
|
|||||||
let metrics = {
|
let metrics = {
|
||||||
size: 0,
|
size: 0,
|
||||||
time: null,
|
time: null,
|
||||||
format: getFormatFromCopyQuery(req.query.sql)
|
format: getFormatFromCopyQuery(req.query.sql),
|
||||||
|
total_rows: null
|
||||||
};
|
};
|
||||||
|
|
||||||
res.header("Content-Disposition", `attachment; filename=${encodeURIComponent(filename)}`);
|
res.header("Content-Disposition", `attachment; filename=${encodeURIComponent(filename)}`);
|
||||||
@ -97,6 +98,7 @@ function handleCopyTo (statsClient) {
|
|||||||
.on('data', data => metrics.size += data.length)
|
.on('data', data => metrics.size += data.length)
|
||||||
.on('end', () => {
|
.on('end', () => {
|
||||||
metrics.time = (Date.now() - startTime) / 1000;
|
metrics.time = (Date.now() - startTime) / 1000;
|
||||||
|
metrics.total_rows = copyToStream.rowCount;
|
||||||
statsClient.set('copyTo', JSON.stringify(metrics));
|
statsClient.set('copyTo', JSON.stringify(metrics));
|
||||||
})
|
})
|
||||||
.pipe(res);
|
.pipe(res);
|
||||||
|
Loading…
Reference in New Issue
Block a user