@ably-labs/locust 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/lib/Message.d.ts +1 -1
- package/lib/Worker.d.ts +1 -1
- package/lib/Worker.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ See [example/users.ts](/example/users.ts) for an example of defining Locust user
|
|
|
14
14
|
|
|
15
15
|
The example can be run by copying `example/.env.sample` to `example/.env`, setting `ABLY_API_KEY` to your Ably API key, and running [Docker Compose](https://docs.docker.com/compose/):
|
|
16
16
|
|
|
17
|
-
```
|
|
17
|
+
```bash
|
|
18
18
|
cd example
|
|
19
19
|
|
|
20
20
|
cp .env.sample .env
|
|
@@ -36,7 +36,7 @@ Locust has the concept of a User which runs a set of requests during a load test
|
|
|
36
36
|
|
|
37
37
|
`ably-locust` is an implementation of a Locust worker process in JavaScript. It can be installed by running:
|
|
38
38
|
|
|
39
|
-
```
|
|
39
|
+
```bash
|
|
40
40
|
npm install @ably-labs/locust
|
|
41
41
|
```
|
|
42
42
|
|
|
@@ -48,7 +48,7 @@ One of the messages a worker receives is a `spawn` message which declares how ma
|
|
|
48
48
|
|
|
49
49
|
For example, assuming there is a Locust master running at `locust.example.com:5557` which is using the following `locustfile.py`:
|
|
50
50
|
|
|
51
|
-
```
|
|
51
|
+
```python
|
|
52
52
|
from locust import User
|
|
53
53
|
|
|
54
54
|
class ExampleUser(User):
|
|
@@ -57,7 +57,7 @@ class ExampleUser(User):
|
|
|
57
57
|
|
|
58
58
|
Then here's an example program where each user reports a successful request every second:
|
|
59
59
|
|
|
60
|
-
```
|
|
60
|
+
```javascript
|
|
61
61
|
const { Worker } = require('@ably-labs/locust');
|
|
62
62
|
|
|
63
63
|
const worker = new Worker({
|
|
@@ -88,7 +88,7 @@ worker.run();
|
|
|
88
88
|
|
|
89
89
|
Start an instance of Locust and run the tests:
|
|
90
90
|
|
|
91
|
-
```
|
|
91
|
+
```bash
|
|
92
92
|
cd tests
|
|
93
93
|
|
|
94
94
|
docker compose up --build
|
package/lib/Message.d.ts
CHANGED
package/lib/Worker.d.ts
CHANGED
package/lib/Worker.js
CHANGED
|
@@ -64,7 +64,7 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
|
64
64
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
65
|
exports.Worker = void 0;
|
|
66
66
|
var winston = __importStar(require("winston"));
|
|
67
|
-
var zeromq_1 = require("zeromq");
|
|
67
|
+
var zeromq_1 = require("@ably/zeromq");
|
|
68
68
|
var constants_1 = require("./constants");
|
|
69
69
|
var Message_1 = require("./Message");
|
|
70
70
|
var Stats_1 = require("./Stats");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ably-labs/locust",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "A JavaScript load generator for Locust.io.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"typescript": "^4.4.4"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
+
"@ably/zeromq": "^6.0.0-beta.ably.3",
|
|
39
40
|
"msgpack5": "^5.3.2",
|
|
40
|
-
"winston": "^3.3.3"
|
|
41
|
-
"zeromq": "^6.0.0-beta.6"
|
|
41
|
+
"winston": "^3.3.3"
|
|
42
42
|
}
|
|
43
43
|
}
|