Integrating Dynamic and Static Performance Testing Models in the FunTester Framework
This article explains how to combine dynamic and static performance testing models in FunTester by adding asynchronous console commands to control thread‑pool scaling and QPS adjustments, providing step settings, incremental changes, and graceful termination through simple key inputs.
In a previous article the author introduced a dynamic performance testing model for the FunTester framework, which has proven useful in real work scenarios.
The core idea is to use an asynchronous thread to receive console input, allowing management of thread‑pool size or direct intervention in a QPS manager.
The implementation currently supports three simple functions: setting the step size, increasing or decreasing the step, and terminating the test.
While this approach works for a while, deeper testing often requires many dynamic cases, making manual input cumbersome; therefore the static model’s advantage of running without mid‑process intervention becomes attractive.
The solution is to combine the static model with the dynamic one, launching the test first and then adjusting parameters on the fly.
In practice this is done by adding command support to the asynchronous controller, offering two command formats: one with target and duration parameters, and another with increment (or decrement) and duration parameters.
Below is the modified asynchronous controller code used as a case study for a dynamic QPS model:
private class FunTester implements IFunController {
boolean inputKey = true;
/**
* Control
*/
boolean autoKey = false;
@Override
public void run() {
while (inputKey) {
String input = getInput();
switch (input) {
case "+":
add();
break;
case "-":
reduce();
break;
case "*":
over();
break;
case "/":
autoKey = true
break;
default:
if (Regex.isMatch(input, "(F|f)\\d+")) QPS_STEP = changeStringToInt(input.substring(1));
if (Regex.isMatch(input, "(T|t)\\d+(D|d)\\d+")) {
def split = (input - "T" - "t").split(/(d|D)/)
autoTarget(split[0] as int, split[1] as int)
}
if (Regex.isMatch(input, "(A|a)-{0,1}\\d+(D|d)\\d+")) {
def split = (input - "A" - "a").split(/(d|D)/)
autoAdd(split[0] as int, split[1] as int)
}
break;
}
}
}
/**
* Automatic incremental control based on target value
* @param target target QPS
* @param duration duration
*/
def autoTarget(int target, duration) {
fun {
for (i in 0..The implementation leverages the custom asynchronous functionality described in the "Java Custom Asynchronous Feature Practice" article, using the '/' character as a termination key to pause automatic increments and prevent threshold breaches.
Both the increment and decrement methods are compatible; setting a negative value performs a reduction.
FunTester original topic collection: Performance Testing Topics Java, Groovy, Go, Python Unit Testing & White‑Box FunTester Community Highlights Testing Theory Nuggets API Functional Testing Topics FunTester Video Topics Case Sharing: Solutions, Bugs, Crawlers UI Automation Topics Testing Tools Topics
Read the original article and jump to my repository address
FunTester
10k followers, 1k articles | completely useless
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.