Skip to content

Commit

Permalink
add more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
atimin committed Jul 13, 2024
1 parent fae93d6 commit 5e16f7f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const reader = async (bucket) => {
console.info('query');
const now = Date.now();
console.log(`start query ${entry.latestRecord - 10_000_000n}`)
for await (const record of bucket.query(entryName, entry.latestRecord - 10_000_000n , undefined, {limit: 5})) {
for await (const record of bucket.query(entryName, entry.latestRecord - 10_000_000n, undefined, {limit: 5})) {
console.info(`start reading ${record.time}`);
const blob = await record.read();
console.info(`end reading ${record.time}`);
Expand All @@ -57,6 +57,8 @@ const reader = async (bucket) => {
timestamp: record.time,
};
}
console.info(`end md5 calc ${record.time}`);

}

await sleep(intervalMs - (Date.now() - now));
Expand All @@ -67,13 +69,13 @@ const reader = async (bucket) => {
console.log(`IO interval ${intervalMs} ms`);

if (role !== 'reader') {
client.getBucket('stress_test').then(async (bucket) => {
console.info('Run writer');
await writer(bucket);
}).catch((err) => {
console.error('WRITER %s', err);
process.exit(-1);
});
client.getBucket('stress_test').then(async (bucket) => {
console.info('Run writer');
await writer(bucket);
}).catch((err) => {
console.error('WRITER %s', err);
process.exit(-1);
});
}

if (role === 'reader') {
Expand Down

0 comments on commit 5e16f7f

Please sign in to comment.