Gatling simulation with fixed number of users for specific period of time - gatling

I have my Gatling scenario set up and now I want to configure a simulation with fixed number of users for specific period of time - number of users should initially be increased gradually to specific value and then kept there by adding new as required as users finish.
I specifically don't want to use constantUsersPerSec (which injects users at a constant rate) but something like .throttle(reachUsers(100) in rampUpTime, holdFor(10 minute)) which should inject users when required.

If it's still relevant: Gatling supports a throttle method pretty much as you outlined it. You can use the following building blocks (taken from the docs):
reachRps(target) in (duration): target a throughput with a ramp over a given duration.
jumpToRps(target): jump immediately to a given targeted throughput.
holdFor(duration): hold the current throughput for a given duration.
So a modified example for your use case could look something like this:
setUp(scn.inject(constantUsersPerSec(100) during(10 minutes))).throttle(
reachRps(100) in (1 minute),
holdFor(9 minute)
)

Related

Does Flink's windowing operation process elements at the end of window or does it do a rolling processing?

I am having some trouble understanding the way windowing is implemented internally in Flink and could not find any article which explain this in depth. In my mind, there are two ways this can be done. Consider a simple window wordcount code as below
env.socketTextStream("localhost", 9999)
.flatMap(new Splitter())
.groupBy(0)
.window(Time.of(500, TimeUnit.SECONDS)).sum(1)
Method 1: Store all events for 500 seconds and at the end of the window, process all of them by applying the sum operation on the stored events.
Method 2: We use a counter to store a rolling sum for every window. As each event in a window comes, we do not store the individual events but keep adding 1 to previously stored counter and output the result at the end of the window.
Could someone kindly help to understand which of the above methods (or maybe a different approach) is used by Flink in reality. The reason is, there are pros and cons to both approach and is important to understand in order configure the resources for the cluster correctly.
eg: The Method 1 seems very close to batch processing and might potentially have issues related to spike in processing at every 500 sec interval while sitting idle otherwise etc while Method2 would need to maintain a common counter between all task managers.
sum is a reducing function as mentioned here(https://nightlies.apache.org/flink/flink-docs-master/docs/dev/datastream/operators/windows/#reducefunction). Internally, Flink will apply reduce function to each input element, and simply save the reduced result in ReduceState.
For other windows functions, like windows.apply(WindowFunction). There is no aggregation so all input elements will be saved in the ListState.
This document(https://nightlies.apache.org/flink/flink-docs-master/docs/dev/datastream/operators/windows/#window-functions) about windows stream mentions about how the internal elements are handled in Flink.

In Gatling: How can I inject two scenarios concurrently while changing injection properties throughout the test?

My simulation runs two concurrent scenarios, one ramps up to 1000 users and iterates the scenario flow throughout the whole test duration
while the second one injects 500 users every hour for 10 minutes. I am doing this to simulate a peak every hour.
The simulation looks more or less as the following:
setUp(steadyStateScenario.inject(rampConcurrentUsers(1) to (numberOfTestUsers) during (Config.rampUpDuration minutes))
.protocols(httpconf),
peakScenario.inject(nothingFor(60 minutes), rampUsers(numberOfPeakTestUsers) during (Config.PeakRampUpDuration minutes))
.protocols(httpconf))
.maxDuration(Config.scenarioDuration hours)
.assertions(global.successfulRequests.percent.is(100))
My issue with the current simulation is that I am unable to randomise peak duration and number of peak users.
To overcome this I would like to execute peakScenario.inject every hour and change values in numberOfPeakTestUsers and Config.PeakRampUpDuration each time it
is executed. This should be done while steadyStateScenario is running at the background without interruption. Is that possible?
Cheers.

How to Total amounts looping through ServiceBus Queue in Azure logic app

I have a Azure Logic app that will pull all messages of a queue once a day. In the Loop action, I can extract the amount and convert to float to extract the value, however, I am not sure how to create a running total of all of the messages in the queue. To be clear, so if there are 10 messages in the queue, and each message has an amount of $1, the running total at the end should be $10. Does anyone know how to do this ?
I have tried using the Math function add(variables('TotalPayments'), variables('PaymentAmount'))
TotalPayments - Running Total
PaymentAmount - current Payment extracted from the current Message.
Found a solution to this, What I used was to implement a increment variable and assigned the value from the current message to this variable. There could be an easier way of doing this, however, It achieves the desired result, and I spent far too much time on it. Microsoft may have meant some other way, but isn't forthcoming in the documentation (that I could find, would be gladly told otherwise). Like I indicated above, I was using the Math function add which seemed logical to me to use but that didn't work.

How to measure the amount of time taken to do any kind of operation inside apps such as Maya, Creo Parametric, Adobe Premier, etc

I want to measure the amount of time taken to do any kind of operation inside apps such as Creo Parametric 5.0, Adobe Premiere Pro, Maya, Adobe Creative, Lightroom CC or any other design app
The idea is to measure the performance (time taken per operation) to catch performance issues.
When you create your library of action, you can create a decorator that log and time any actions so you can monitor whats going on
A method which is hacky and time consuming but generic (even for softwares not providing (good) scripting), could be to record your screen at high speed (such as 60 fps). Then you look at the frames to count the frames between giving the order (click, enter key) and the result (updated display).
The precision will be in the order of 1 / recording frequency (16 ms if recording at 60 fps). A drawback is that you are likely to measure the time of more than just the operation you are interested in, for instance if you want to bench the loading of a file, you will also measure the time it took to render it after (which may/should be negligible).
I was able to apply this method using https://github.com/SerpentAI/D3DShot (increase the framebuffer size which by default last 1 second). Note that the frame numbers when exporting to files are going backward in time.
It may be possible to make this method less hacky by using computer vision algorithms to not have to count frames manually.

Getting JMeter to work with Throughput Shaping timer and Concurrency Thread Group

I am trying to shape a JMeter test involving a Concurrency Thread Group and a Throughput Shaping Timer as documented here and here. the timer is configured to run ten ramps and stages with RPS from 1 to 333.
I want to set up the Concurrency Thread Group to use the schedule feedback function and added the formula in the Target concurrency field (I have updated the example from tst-name to the actual timer name). ramp-up time and steps I have set to 1 as I assume the properties are not that important if the throughput is managed by the timer; the Hold Target Rate time is 8000, which is longer than the steps added in the timer (6200).
When I run the test, it ends without any exceptions within 3 seconds or so. The log file shows a few rows about starting and ending threads but nothing alarming.
The only thing I find suspicious is the Log entry "VirtualUserController: Test limit reached, thread is done plus thread name.
I am not getting enough clues from the documentation linked here to figure this out myself, do you have any hints?
According to the documentation rampup time and steps should be blank:
When using this approach, leave Concurrency Thread Group Ramp Up Time and Ramp-Up Steps Count fields blank"
So your assumption that setting them to 1 is OK, seems false...

Resources