Skip to content

Commit

Permalink
adjust the changes to fit the cd needs
Browse files Browse the repository at this point in the history
  • Loading branch information
avifenesh committed Mar 1, 2024
1 parent 4639a9b commit b2017ba
Show file tree
Hide file tree
Showing 29 changed files with 770 additions and 717 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint-ts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ jobs:

- name: lint ts
run: |
npm install @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-tsdoc eslint typescript eslint-plugin-import@latest eslint-config-prettier
npm i
npm install @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-tsdoc eslint typescript eslint-plugin-import@latest eslint-config-prettier prettier
npx eslint .
npx prettier --check .
2 changes: 1 addition & 1 deletion .github/workflows/npm-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
run: |
# Remove the "cpu" and "os" fileds so the base package would be able to install it on ubuntu
SED_FOR_MACOS=`if [[ "${{ matrix.build.OS }}" =~ .*"macos".* ]]; then echo "''"; fi`
sed -i $SED_FOR_MACOS '/"cpu":/d' ./package.json && sed -i $SED_FOR_MACOS '/"os":/d' ./package.json
sed -i $SED_FOR_MACOS '/"\/\/\/cpu": \[/,/]/d' ./package.json && sed -i $SED_FOR_MACOS '/"\/\/\/os": \[/,/]/d' ./package.json
mkdir -p bin
npm pack --pack-destination ./bin
ls ./bin
Expand Down
6 changes: 4 additions & 2 deletions benchmarks/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"description": "",
"main": "node_benchmark.ts",
"scripts": {
"bench": "node node_benchmark.js"
"bench": "node node_benchmark.js",
"prettier:check:ci": "./node_modules/.bin/prettier --check .",
"prettier:format": "./node_modules/.bin/prettier --write . "
},
"author": "",
"license": "ISC",
Expand All @@ -20,7 +22,7 @@
},
"devDependencies": {
"@types/node": "^18.7.9",
"prettier": "^2.7.1",
"prettier": "^2.8.8",
"typescript": "^4.8.4"
}
}
186 changes: 93 additions & 93 deletions benchmarks/node/tsconfig.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions benchmarks/utilities/fill_db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async function fill_database(
host: string,
isCluster: boolean,
tls: boolean,
port: number
port: number,
) {
const client = await createRedisClient(host, isCluster, tls, port);
const data = generateValue(data_size);
Expand All @@ -27,7 +27,7 @@ async function fill_database(
const key = (i * CONCURRENT_SETS + index).toString();
await client.set(key, data);
}
}
},
);

await Promise.all(sets);
Expand All @@ -37,14 +37,14 @@ async function fill_database(
Promise.resolve()
.then(async () => {
console.log(
`Filling ${receivedOptions.host} with data size ${receivedOptions.dataSize}`
`Filling ${receivedOptions.host} with data size ${receivedOptions.dataSize}`,
);
await fill_database(
receivedOptions.dataSize,
receivedOptions.host,
receivedOptions.clusterModeEnabled,
receivedOptions.tls,
receivedOptions.port
receivedOptions.port,
);
})
.then(() => {
Expand Down
10 changes: 5 additions & 5 deletions benchmarks/utilities/flush_db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ async function flush_database(
host: string,
isCluster: boolean,
tls: boolean,
port: number
port: number,
) {
if (isCluster) {
const client = (await createRedisClient(
host,
isCluster,
tls,
port
port,
)) as RedisClusterType;
await Promise.all(
client.masters.map((master) => {
return flush_database(master.host, false, tls, master.port);
})
}),
);
await client.quit();
} else {
const client = (await createRedisClient(
host,
isCluster,
tls,
port
port,
)) as RedisClientType;
await client.connect();
await client.flushAll();
Expand All @@ -44,7 +44,7 @@ Promise.resolve()
receivedOptions.host,
receivedOptions.clusterModeEnabled,
receivedOptions.tls,
receivedOptions.port
receivedOptions.port,
);
})
.then(() => {
Expand Down
9 changes: 6 additions & 3 deletions benchmarks/utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"fill": "node fill_db.js",
"flush": "node flush_db.js"
"flush": "node flush_db.js",
"prettier:check:ci": "./node_modules/.bin/prettier --check .",
"prettier:format": "./node_modules/.bin/prettier --write . "
},
"author": "",
"license": "ISC",
"dependencies": {
"command-line-args": "^5.2.1",
"prettier": "^3.2.5",
"redis": "^4.6.8"
},
"devDependencies": {
"@types/command-line-args": "^5.2.1",
"typescript": "^4.8.4",
"@types/node": "^20.6.3"
"@types/node": "^20.6.3",
"typescript": "^4.8.4"
}
}
Loading

0 comments on commit b2017ba

Please sign in to comment.