Parametrize autoscaling instance load length
We need the duration for which the instance for autoscaling testing is under load parametrized. Currently with a static duration of 2 minutes the scenario might fail in situations with a high ceilometer polling interval. In these situations the load might already be finished before ceilometer polls for the CPU metric, which results in a seemingly low CPU utilization, because of which the stack doesn't ever scale up and the scenario fails. With this patch, the load lasts 2x (the ceilometer polling interval + prometheus scrape interval), which guarantees that at least on polling period will be with 100% load, which will result in a high CPU utilization registered by ceilometer. As a sideeffect this might slightly speedup the scenario in situations with a low ceilometer polling interval. Change-Id: Ib673e67800d2d16d552e734fea89772a0e937105
This commit is contained in:
parent
a32f05c0ba
commit
4ec1f85148
@ -23,7 +23,7 @@
|
||||
"#!/bin/sh\n",
|
||||
"echo 'Loading CPU'\n",
|
||||
"set -v\n",
|
||||
"cat /dev/urandom > /dev/null & sleep 120 ; kill $! \n"
|
||||
"cat /dev/urandom > /dev/null & sleep $ENVIRON['LOAD_LENGTH'] ; kill $! \n"
|
||||
]]}
|
||||
}
|
||||
}
|
||||
|
@ -135,6 +135,7 @@ class PrometheusGabbiTest(manager.ScenarioTest):
|
||||
"STACK_NAME": self.stack_name,
|
||||
"RESOURCE_PREFIX": resource_prefix,
|
||||
"PROMETHEUS_RATE_DURATION": str(prometheus_rate_duration),
|
||||
"LOAD_LENGTH": str(prometheus_rate_duration * 2),
|
||||
})
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user