AsyncLoad 0.1.2__tar.gz → 0.1.3__tar.gz

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.
@@ -0,0 +1,420 @@
1
+ Metadata-Version: 2.4
2
+ Name: AsyncLoad
3
+ Version: 0.1.3
4
+ Summary: Asynchronous HTTP Load Testing Tool with Database Storage and Betterstack Integration
5
+ Author-email: Saptarshi Dutta <saptarshidutta2001@gmail.com>
6
+ Maintainer-email: Saptarshi Dutta <saptarshidutta2001@gmail.com>
7
+ License: MIT License
8
+
9
+ Copyright (c) 2025 Your Name
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
28
+
29
+ Project-URL: Homepage, https://github.com/Saptarshi2001/AsyncLoad
30
+ Project-URL: Documentation, https://github.com/Saptarshi2001/AsyncLoad#readme
31
+ Project-URL: Repository, https://github.com/Saptarshi2001/AsyncLoad
32
+ Project-URL: Issues, https://github.com/Saptarshi2001/AsyncLoad/issues
33
+ Project-URL: Changelog, https://github.com/Saptarshi2001/AsyncLoad/blob/main/CHANGELOG.md
34
+ Keywords: load-testing,http,async,aiohttp,performance,monitoring,betterstack
35
+ Classifier: Development Status :: 4 - Beta
36
+ Classifier: Intended Audience :: Developers
37
+ Classifier: Intended Audience :: System Administrators
38
+ Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
39
+ Classifier: Topic :: Software Development :: Testing :: Traffic Generation
40
+ Classifier: Topic :: System :: Benchmark
41
+ Classifier: License :: OSI Approved :: MIT License
42
+ Classifier: Programming Language :: Python :: 3
43
+ Classifier: Programming Language :: Python :: 3.7
44
+ Classifier: Programming Language :: Python :: 3.8
45
+ Classifier: Programming Language :: Python :: 3.9
46
+ Classifier: Programming Language :: Python :: 3.10
47
+ Classifier: Programming Language :: Python :: 3.11
48
+ Classifier: Operating System :: OS Independent
49
+ Classifier: Framework :: AsyncIO
50
+ Requires-Python: >=3.7
51
+ Description-Content-Type: text/markdown
52
+ License-File: LICENSE
53
+ Requires-Dist: aiohttp>=3.7.0
54
+ Requires-Dist: requests>=2.25.0
55
+ Requires-Dist: python-dotenv>=0.15.0
56
+ Requires-Dist: logtail-python>=0.3.4
57
+ Provides-Extra: dev
58
+ Requires-Dist: pytest>=6.0.0; extra == "dev"
59
+ Requires-Dist: pytest-asyncio>=0.14.0; extra == "dev"
60
+ Requires-Dist: coverage>=5.0.0; extra == "dev"
61
+ Requires-Dist: black>=21.0.0; extra == "dev"
62
+ Requires-Dist: flake8>=3.8.0; extra == "dev"
63
+ Provides-Extra: test
64
+ Requires-Dist: pytest>=6.0.0; extra == "test"
65
+ Requires-Dist: pytest-asyncio>=0.14.0; extra == "test"
66
+ Dynamic: license-file
67
+
68
+ # AsyncLoad
69
+
70
+ AsyncLoad is an asynchronous load testing CLI designed to stress test your applications under heavy concurrent load. It contains database storage for session history as well as a Betterstack integration for monitoring and observability.
71
+
72
+ ---
73
+
74
+ ## Installation
75
+
76
+ ### Install from pip
77
+
78
+ For version releases, use pip:
79
+
80
+ ```bash
81
+ pip install AsyncLoad
82
+ asyncload -setup
83
+
84
+ Set your betterstack env variables inside the global config file thats created."%LOCALAPPDATA%/loadtester/config.env" for Windows,"~/.config/loadtester/config.env" for linux and Mac. You can setup the number of requests,concurrent requests, as well as the http method either in the config file or simply use the cmd flags to override the values. Default values for number of requests,concurrent requests,http method is 100,10,GET.
85
+
86
+ ```
87
+ Head over to your cmd and type:
88
+
89
+ ```bash
90
+ asyncload https://httpbin.org/ -n 100 -c 10 -GET
91
+ ```
92
+
93
+ ### Install from GitHub source
94
+
95
+ For building from source, install directly from the git repository:
96
+
97
+ ```bash
98
+ git clone <repository-url>
99
+ cd Asyncload
100
+ pip install .
101
+ cp config.env.example config.env # set up your config file
102
+ python -m unittest discover tests/ # Run all tests
103
+ asyncload https://httpbin.org/ -n 100 -c 10 -GET
104
+ ```
105
+
106
+ Or Use Docker to build and run the source:
107
+
108
+ ```bash
109
+ docker compose build
110
+ docker compose run --rm asyncload https://httpbin.org/ -n 100 -c 10 -GET
111
+ ```
112
+
113
+
114
+ ### Running the tests
115
+
116
+ ```bash
117
+ # Run all tests
118
+ python -m unittest discover tests/
119
+
120
+ # Run specific test modules
121
+ python -m unittest tests.testload
122
+ python -m unittest tests.testasync
123
+ python -m unittest tests.testdb
124
+
125
+ # Run with verbose output
126
+ python -m unittest -v tests.testload
127
+ ```
128
+
129
+
130
+
131
+
132
+
133
+ ## Examples
134
+
135
+ ### Basic load test
136
+
137
+ ```bash
138
+ asyncload https://jsonplaceholder.typicode.com/posts -n 5 -c 2 -GET
139
+ ```
140
+
141
+ ```
142
+ Running....
143
+ ============================================================
144
+ Load Test Results
145
+ ============================================================
146
+ Total Requests: 5
147
+ Concurrent Requests: 2
148
+ Successful Requests: 5
149
+ Failed Requests: 0
150
+ ------------------------------------------------------------
151
+ Individual Request Details
152
+ ------------------------------------------------------------
153
+ Request ID | Timestamp | URL | Status | Method | Response Time
154
+ ----------------------------------------------------------------------------------------------------------
155
+ 594 | 24:05:2026 14:53:36 | https://jsonplaceholder.typico | 200 | get | 0.337788
156
+ 595 | 24:05:2026 14:53:36 | https://jsonplaceholder.typico | 200 | get | 0.392194
157
+ 596 | 24:05:2026 14:53:36 | https://jsonplaceholder.typico | 200 | get | 0.453631
158
+ 597 | 24:05:2026 14:53:36 | https://jsonplaceholder.typico | 200 | get | 0.535650
159
+ 598 | 24:05:2026 14:53:36 | https://jsonplaceholder.typico | 200 | get | 0.573828
160
+ ============================================================
161
+
162
+
163
+ Performance Statistics
164
+ ------------------------------------------------------------
165
+ Total Response Time (seconds)
166
+ Maximum: 0.573828
167
+ Minimum: 0.337788
168
+ Average: 0.458618
169
+
170
+ First Byte Time (seconds)
171
+ Maximum: 0.573208
172
+ Minimum: 0.337749
173
+ Average: 0.456585
174
+
175
+ Last Byte Time (seconds)
176
+ Maximum: 0.573827
177
+ Minimum: 0.337787
178
+ Average: 0.458618
179
+ ============================================================
180
+ ```
181
+
182
+ ### Viewing history
183
+
184
+ ```bash
185
+ asyncload -history
186
+ ```
187
+
188
+ ```
189
+ Request ID | Timestamp | URL | Status | Method | Response Time
190
+ -------------------------------------------------------------------------------------------------------
191
+ 594 | 24:05:2026 14:53:36 | https://jsonplaceholder.t | 200 | get | 0.337788
192
+ 595 | 24:05:2026 14:53:36 | https://jsonplaceholder.t | 200 | get | 0.392194
193
+ 596 | 24:05:2026 14:53:36 | https://jsonplaceholder.t | 200 | get | 0.453631
194
+ 597 | 24:05:2026 14:53:36 | https://jsonplaceholder.t | 200 | get | 0.535650
195
+ 598 | 24:05:2026 14:53:36 | https://jsonplaceholder.t | 200 | get | 0.573828
196
+ ```
197
+
198
+ ### Viewing weekly history
199
+
200
+ ```bash
201
+ asyncload -history -weekly
202
+ ```
203
+
204
+ ```
205
+ Request ID | Timestamp | URL | Status | Method | Response Time | Week
206
+ --------------------------------------------------------------------------------------------------------------
207
+ 594 | 24:05:2026 14:53:36 | https://jsonplaceholder.t | 200 | get | 0.337788 | 21
208
+ 595 | 24:05:2026 14:53:36 | https://jsonplaceholder.t | 200 | get | 0.392194 | 21
209
+ 596 | 24:05:2026 14:53:36 | https://jsonplaceholder.t | 200 | get | 0.453631 | 21
210
+ 597 | 24:05:2026 14:53:36 | https://jsonplaceholder.t | 200 | get | 0.535650 | 21
211
+ 598 | 24:05:2026 14:53:36 | https://jsonplaceholder.t | 200 | get | 0.573828 | 21
212
+ ```
213
+
214
+ ### POST request with payload
215
+
216
+ ```bash
217
+ asyncload https://jsonplaceholder.typicode.com/posts -n 5 -c 2 -POST -d '{"title": "foo", "body": "bar", "userId": 1}'
218
+ ```
219
+
220
+ ```
221
+ Running....
222
+ ============================================================
223
+ Load Test Results
224
+ ============================================================
225
+ Total Requests: 5
226
+ Concurrent Requests: 2
227
+ Successful Requests: 5
228
+ Failed Requests: 0
229
+ ------------------------------------------------------------
230
+ Individual Request Details
231
+ ------------------------------------------------------------
232
+ Request ID | Timestamp | URL | Status | Method | Response Time
233
+ ----------------------------------------------------------------------------------------------------------
234
+ 599 | 24:05:2026 14:56:05 | https://jsonplaceholder.typico | 201 | post | 0.592419
235
+ 600 | 24:05:2026 14:56:05 | https://jsonplaceholder.typico | 201 | post | 1.002274
236
+ 601 | 24:05:2026 14:56:05 | https://jsonplaceholder.typico | 201 | post | 1.025395
237
+ 602 | 24:05:2026 14:56:05 | https://jsonplaceholder.typico | 201 | post | 1.347690
238
+ 603 | 24:05:2026 14:56:05 | https://jsonplaceholder.typico | 201 | post | 1.392546
239
+ ============================================================
240
+
241
+
242
+ Performance Statistics
243
+ ------------------------------------------------------------
244
+ Total Response Time (seconds)
245
+ Maximum: 1.392546
246
+ Minimum: 0.592419
247
+ Average: 1.072065
248
+
249
+ First Byte Time (seconds)
250
+ Maximum: 1.392511
251
+ Minimum: 0.592399
252
+ Average: 1.072046
253
+
254
+ Last Byte Time (seconds)
255
+ Maximum: 1.392546
256
+ Minimum: 0.592419
257
+ Average: 1.072064
258
+ ============================================================
259
+ ```
260
+
261
+ ### High concurrency test
262
+
263
+ ```bash
264
+ asyncload https://jsonplaceholder.typicode.com/posts -n 20 -c 10 -GET
265
+ ```
266
+
267
+ ```
268
+ Running....
269
+ ============================================================
270
+ Load Test Results
271
+ ============================================================
272
+ Total Requests: 20
273
+ Concurrent Requests: 10
274
+ Successful Requests: 20
275
+ Failed Requests: 0
276
+ ------------------------------------------------------------
277
+ Individual Request Details
278
+ ------------------------------------------------------------
279
+ Request ID | Timestamp | URL | Status | Method | Response Time
280
+ ----------------------------------------------------------------------------------------------------------
281
+ 609 | 24:05:2026 14:57:12 | https://jsonplaceholder.typico | 200 | get | 0.395732
282
+ 610 | 24:05:2026 14:57:12 | https://jsonplaceholder.typico | 200 | get | 0.397407
283
+ ...
284
+ 628 | 24:05:2026 14:57:12 | https://jsonplaceholder.typico | 200 | get | 1.824638
285
+ ============================================================
286
+
287
+
288
+ Performance Statistics
289
+ ------------------------------------------------------------
290
+ Total Response Time (seconds)
291
+ Maximum: 1.824638
292
+ Minimum: 0.395732
293
+ Average: 0.861470
294
+
295
+ First Byte Time (seconds)
296
+ Maximum: 1.824627
297
+ Minimum: 0.383778
298
+ Average: 0.857246
299
+
300
+ Last Byte Time (seconds)
301
+ Maximum: 1.824638
302
+ Minimum: 0.395731
303
+ Average: 0.861470
304
+ ============================================================
305
+ ```
306
+
307
+ ---
308
+
309
+ ## API Reference
310
+
311
+ ## GlobalConfig
312
+
313
+ ### platform_path
314
+
315
+ sets up the global config variable accordingly with the underlying os
316
+
317
+ - "%LOCALAPPDATA%/asyncload/config.env" for Windows
318
+ - "~/.config/asyncload/config.env" for Linux/Mac
319
+
320
+ ### ensure_global_config()
321
+
322
+ Creates the global config file in the user's system
323
+
324
+
325
+ ## Loadtester
326
+
327
+ ### read()
328
+
329
+ Reads the command line arguments before executing the load test.
330
+
331
+ ---
332
+
333
+ ### testurl(url, numreq, conreq, reqtype, headers=None)
334
+
335
+ The core function of AsyncLoad. Sends requests to the specified URL asynchronously.
336
+
337
+ **Parameters:**
338
+
339
+ | Name | Type | Description |
340
+ |------|------|-------------|
341
+ | `url` | `str` | The URL to test |
342
+ | `numreq` | `int` | Number of total requests |
343
+ | `conreq` | `int` | Number of concurrent requests |
344
+ | `reqtype` | `str` | HTTP method (GET, POST, PUT, DELETE, etc.) |
345
+ | `headers` | `dict` | Optional HTTP headers |
346
+
347
+ ---
348
+
349
+ ### insertpayload(reqlist)
350
+
351
+ Stores the return values from the requests in an SQLite database instance.
352
+
353
+ **Parameters:**
354
+
355
+ | Name | Type | Description |
356
+ |------|------|-------------|
357
+ | `reqlist` | `list` | http request results to be stored |
358
+
359
+ ---
360
+
361
+ ### history(timemode=None)
362
+
363
+ Retrieves the session history from the database instance.
364
+
365
+ **Parameters:**
366
+
367
+ | Name | Type | Description |
368
+ |------|------|-------------|
369
+ | `timemode` | `str` | Optional filter: 'weekly', 'monthly', or 'yearly' |
370
+
371
+ ---
372
+
373
+ ### stats(totresponsetime, firstbytetime, lastbytetime)
374
+
375
+ Calculates minimum, maximum, and average of total response time, first byte time, and last byte time.
376
+
377
+ **Parameters:**
378
+
379
+ | Name | Type | Description |
380
+ |------|------|-------------|
381
+ | `totresponsetime` | `list` | List of total response times |
382
+ | `firstbytetime` | `list` | List of first byte times |
383
+ | `lastbytetime` | `list` | List of last byte times |
384
+
385
+
386
+ ---
387
+
388
+ ### desc()
389
+
390
+ Displays the load test statistics in the terminal.
391
+
392
+
393
+
394
+ ### Options
395
+
396
+ | Flag | Description |
397
+ |------|-------------|
398
+ | `-n` | Number of requests |
399
+ | `-c` | Number of concurrent requests |
400
+ | `-GET` / `-POST` / `-DELETE` / `-PUT` / `-HEAD` / `-PATCH` | HTTP method |
401
+ | `-d` | JSON data for POST/PUT/PATCH/DELETE |
402
+ | `-history` | View session history |
403
+ | `-history -weekly` | View weekly session history |
404
+ | `-history -monthly` | View monthly session history |
405
+ | `-history -yearly` | View yearly session history |
406
+
407
+ ---
408
+
409
+ ## Changelog
410
+
411
+ ### [1.0.0] - 2026-05-11
412
+ #### Added
413
+ - Initial release of AsyncLoad
414
+ - Asynchronous load testing CLI with concurrent request support
415
+ - Database storage for session history using SQLite
416
+ - Betterstack integration for monitoring and observability
417
+ - Support for multiple HTTP methods (GET, POST, PUT, DELETE, HEAD, PATCH)
418
+ - Configurable concurrency and request count
419
+ - Session history viewing (weekly, monthly, yearly)
420
+ - Load testing stats