nearform / anger Goto Github PK
View Code? Open in Web Editor NEWpub-sub tester for Nes
License: MIT License
pub-sub tester for Nes
License: MIT License
Currently a batch of messages are triggered, and then the tester wait fot all to complete. This is extremely stressful for an application.
I think a more realistic test is to send all the messages are the beginning, but then trigger a new one once the previous one has completed. In this way we can reproduce a more stable load, rather than a series of spikes.
I would like to set a timeout option that applies to each sender request, within which if all expected responses haven't been received we continue to the next trigger or complete if all done.
The existing tail
option kind of does this if there's no more requests to be sent:
tail: 200
requests: 1
senders: 1
connections: 3
----------x 0ms (request sent)
-------x +80ms receive response
-----------x +130ms receive response
-------------------! +200ms tail is triggered, 1 missing response
However if you have >= 2 requests and 1 sender it never gets triggered, so it hangs forever:
tail: 200
requests: 2
senders: 1
connections: 3
----------x 0ms (request sent)
-------x +80ms receive response
-----------x +130ms receive response
-------------------!----Infinity No timeout, we wait forever
In the case above, I'd like to timeout after 200ms, mark the response as missing and start the next request.
timeout: 200
requests: 2
senders: 1
connections: 3
----------x 0ms (request sent)
-------x +80ms receive response
-----------x +130ms receive response
-------------------! Timeout, 1 missing response
x Next request triggered...
See #16
Perhaps we should have a mode that doesn't actually send any requests, it just keeps adding and removing clients - and also, simply add clients (no removing) until the breaking point
We should support custom options to be passed to each nes.Client
cc @mtharrison
It would be cool if we could specify different auth options per connection. What do you think about making the auth
option optionally take a function that takes the client index and a sender
boolean?
const instance = anger({
...
auth: (i, sender) => {
return { headers: { ... } }
},
...
})
I think if a connection error is received, it should be the test over, the error should be emitted and existing connections torn down. This code never runs though because no errors are propagated from steed.each()
. Maybe it should be steed.map()
instead?
An alternative to stopping the test is to allow the test to continue, recording the error event and letting it time out when ultimately all the expected responses aren't received. In the end reporting the number of connection errors and the number of subscription errors.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.