Skip to content

Commit

Permalink
update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
atimin committed Oct 27, 2023
1 parent b8597fe commit cdec489
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:17-slim
FROM node:18-slim

COPY package.json .
COPY package-lock.json .
Expand Down
14 changes: 5 additions & 9 deletions index.mjs
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import {Client, QuotaType} from 'reduct-js';
import {Client} from 'reduct-js';
import crypto from 'crypto';
import md5 from 'md5';

const serverUrl = process.env.REDUCT_STORAGE_URL;
const apiToken = process.env.REDUCT_API_TOKEN;
const size30Gb = 30_000_000_000;
const entryName = 'test-entry';
const intervalMs = process.env.TIME_INTERVAL ? process.env.TIME_INTERVAL : 1000;

console.log(`Server URL ${serverUrl}`);

const clientReader = new Client(serverUrl, {apiToken: apiToken});
const clientWriter = new Client(serverUrl, {apiToken: apiToken});
const client = new Client(serverUrl, {apiToken: apiToken});

const bigBlob = crypto.randomBytes(2 ** 20);

Expand Down Expand Up @@ -40,8 +38,7 @@ const reader = async (bucket) => {
await sleep(1000);
while (true) {
const entryInfo = await bucket.getEntryList();
const info = entryInfo.find(entry => entry.name === entryName);

entryInfo.find(entry => entry.name === entryName);
console.info('query');
for await (const record of bucket.query(entryName)) {
const now = Date.now();
Expand All @@ -62,16 +59,15 @@ const reader = async (bucket) => {

console.log(`IO interval ${intervalMs} ms`);

clientWriter.getOrCreateBucket('stress_test',
{quotaType: QuotaType.FIFO, quotaSize: size30Gb}).then(async (bucket) => {
client.getBucket('stress_test').then(async (bucket) => {
console.info('Run writer');
await writer(bucket);
}).catch((err) => {
console.error('[ERROR] %s', err);
process.exit(-1);
});

clientReader.getBucket('stress_test').then(async (bucket) => {
client.getBucket('stress_test').then(async (bucket) => {
console.info('Run reader');
await reader(bucket);
}).catch((err) => {
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
"homepage": "https://github.com/reduct-storage/data-checker#readme",
"dependencies": {
"md5": "^2.3.0",
"reduct-js": "1.4.1"
"reduct-js": "1.7.2"
}
}

0 comments on commit cdec489

Please sign in to comment.