Skip to content

Commit ccba184

Browse files
committed
feat: initial commit
0 parents  commit ccba184

25 files changed

+6582
-0
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.js

.eslintrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "eslint-config-dasprid",
3+
"parserOptions": {
4+
"project": "tsconfig.json"
5+
}
6+
}

.github/workflows/commitlint.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Lint Commit Messages
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
commitlint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
with:
11+
fetch-depth: 0
12+
13+
- name: Setup Node
14+
uses: actions/setup-node@v3
15+
with:
16+
node-version: 18
17+
18+
- name: Cache node modules
19+
uses: actions/cache@v3
20+
env:
21+
cache-name: cache-node-modules
22+
with:
23+
path: ~/.npm
24+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
25+
restore-keys: |
26+
${{ runner.os }}-build-${{ env.cache-name }}-
27+
${{ runner.os }}-build-
28+
${{ runner.os }}-
29+
30+
- name: Install dependencies
31+
run: npm ci
32+
33+
- name: Validate all commits from PR
34+
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose

.github/workflows/release.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
name: Release
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Use Node.js 18.x
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 18
20+
21+
- name: Cache node modules
22+
uses: actions/cache@v3
23+
env:
24+
cache-name: cache-node-modules
25+
with:
26+
path: ~/.npm
27+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
28+
restore-keys: |
29+
${{ runner.os }}-build-${{ env.cache-name }}-
30+
${{ runner.os }}-build-
31+
${{ runner.os }}-
32+
33+
- name: Install Dependencies
34+
run: npm ci
35+
36+
- name: Lint
37+
run: npm run lint
38+
39+
- name: Build
40+
run: npm run build
41+
42+
- name: Semantic Release
43+
uses: cycjimmy/semantic-release-action@v3
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
47+
HUSKY: 0
48+
id: semantic
49+
with:
50+
semantic_version: 19.0.5
51+
extra_plugins: |
52+
@semantic-release/[email protected]
53+
@semantic-release/[email protected]

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/node_modules
2+
/dist
3+
/.eslintcache

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx --no -- commitlint --edit ${1}

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx lint-staged

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Copyright (c) 2023, Bloop Box
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
7+
1. Redistributions of source code must retain the above copyright notice, this
8+
list of conditions and the following disclaimer.
9+
2. Redistributions in binary form must reproduce the above copyright notice,
10+
this list of conditions and the following disclaimer in the documentation
11+
and/or other materials provided with the distribution.
12+
13+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
17+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
20+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Bloop Server Tester
2+
3+
[![Release](https://github.com/bloop-box/bloop-server-tester/actions/workflows/release.yml/badge.svg)](https://github.com/bloop-box/bloop-server-tester/actions/workflows/release.yml)
4+
5+
Utility for testing bloop server implementations and performance.
6+
7+
## Installation
8+
9+
```bash
10+
npm i -g bloop-server-tester
11+
```
12+
13+
## Usage
14+
15+
To get a list of all commands and their arguments/options, run:
16+
17+
```bash
18+
bloop-server-tester --help
19+
```
20+
21+
By default, the tester will not validate server certificates. If you wish to do so, you can enable validation for any
22+
command by supplying the `--validate-cert` option.
23+
24+
Each command uses an auth string to connect. An auth string is always in the following format:
25+
26+
```
27+
<client-id>:<client-secret>@<host>:<port>
28+
```
29+
30+
### Test authentication
31+
32+
Test authentication with a given client ID and secret:
33+
34+
```bash
35+
bloop-server-tester auth <auth-string>
36+
```
37+
38+
### Test ping reply time
39+
40+
Test the ping reply time of a server with a given number of iterations (defaults to 10):
41+
42+
```bash
43+
bloop-server-tester ping -i 10 <auth-string>
44+
```
45+
46+
### Load test server
47+
48+
You can continuously load test your server with a given number of connections and UIDs:
49+
50+
```bash
51+
bloop-server-tester load-test -c 15 -u ababababababab acacacacacacac <auth-string>
52+
```
53+
54+
This will send a bloop through every connection every 500ms.

bin/bloop-server-tester.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env node
2+
import '../dist/cli.js';

commitlint.config.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = {extends: ['@commitlint/config-conventional']}

0 commit comments

Comments
 (0)