Tests:
Benchmark your system.
Note, that the purpose of the adapter, in its current state, is mainly to benchmark different scenarios to gather
insights on changes on js-controller level.
The Benchmark Tests can take very long and can cause high loads on your system. Also note, that by default the benchmark adapter
runs in an isolated mode, which will disable all adapters and only keep the controller and itself alive. Furthermore, the adapter
always needs to be run with instance number 0
.
>=3.0.0
, please pass the requirements to
the parent constructorSome tests may have requirements. If the system does not fulfill the requirements, the test will be skipped. In the constructor you should pass the requirements to the parent class, like
public constructor(adapter: AdapterInstance) {
super(adapter, {freeMemory: 2000});
}
Currently, the following requirements are supported:
controllerVersion
- if methods are tested which were introduced with a specific controller version, the benchmark
adapter should not try to run these tests on a non-supporting controllerfreeMemory
- define the required memory of the test, this is only necessary if you e.g. add a lot of instancesExecutes iterations
times getState
.
Executes iterations
times getState
on an alias.
Executes iterations
times getState
on an alias. The alias has a simple read function.
Creates 10,000 states, then executes iterations
times getStates
on them.
Creates 10,000 alias states, then executes iterations
times getStates
on them.
Just waits iterations
ms.
Creates a secondary benchmark instance. The controller instance will then send iterations
messages to the secondary instance.
If all messages are recevied, the test is finished.
Creates iterations
objects via setObject
.
Deletes iterations
objects via delObject
.
Creates 10,000 objects while 50 % of them are relevant for the object view. Then it executes iterations
object views.
Creates 10,000 objects while 98 % of them are relevant for the object view. Then it executes iterations
object views.
Creates 10,000 objects while only 2 % of them are relevant for the object view. Then it executes iterations
object views.
Sets iterations
states via setState
Sets iterations
states via setState
, but strictObjectChecks
are disabled.
Adds 30 secondary instances, every instance will set iterations
states. On system level, the instances are setting these states in parallel, but on instance level, the previous setState
needs to be finished until the next one is set.
This test aims to benchmark multicore systems.
Requirements: 2 GB of free memory
Deletes iterations
states via delState
.
The controller instance subscribes on a specific namespace. 4 secondaries each set iterations / 4
states. As soon as the controller received all iterations
publishes, the test is finished.
The controller instance subscribes on an alias namespace. 4 secondaries each set iterations / 4
alias states. As soon as the controller received all iterations
publishes, the test is finished.
The controller instance subscribes on an alias namespace. 4 secondaries each set iterations / 4
alias states. As soon as the controller received all iterations
publishes, the test is finished.
The alias contains a simple write function.
Ten secondaries each subscribe on the same iterations
states. Instead of using one subscribe
call each perform iterations
single subscribe calls. As soon as all ìterations
are received by every secondary, the test is finished.
statesSubscriptionSingle
controllerVersion
to resultsgetStatesMulti
getStatesMultiAlias
did not remove alias objectsgetStatesMultiAlias
created wrong amount of objectsgetStatesMulti
and getStatesMultiAlias
utility
dataSource
to io-packageTestRequirements
which can define required memory, controller and node versiongetObjectView
testssetState
test for multicore performance evaluation (closes #5)addInstances
wait that instance is actually aliveactionsPerSecondStd
stategetStatesAlias
and messages
getStates
testobjectsDeletion
and getStates
cleanUpBetweenEpoch
and prepareBetweenEpoch
to save ressourcesMIT License
Copyright (c) 2022 Moritz Heusinger moritz.heusinger@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
The adapter icon has been designed using resources from Flaticon.com