Load Testing & Performance Benchmarking (JMeter & k6) · Aula

Temporizadores para um Ritmo Realista

Aplique diferentes temporizadores para introduzir atrasos realistas entre as solicitações, simulando o tempo de reflexão do usuário.

Aula 3 de 411 etapas

Temporizadores para um Ritmo Realista é uma aula grátis de Load Testing & Performance Benchmarking (JMeter & k6) no CoddyKit. Esta é a aula 3 de 4. Você pode ler a aula completa abaixo gratuitamente — depois pratica ao vivo no navegador com um editor de código integrado e um tutor de IA 24/7. Faz parte do caminho de aprendizado de Load Testing & Performance Benchmarking (JMeter & k6), e seu progresso é sincronizado entre a web e o app CoddyKit. O curso de Load Testing & Performance Benchmarking (JMeter & k6) inclui 4 aulas no total.

Partes desta aula ainda não foram traduzidas e aparecem em inglês.

Simulate Real User Behavior

When testing applications, it's crucial to simulate real user behavior. Users don't click or interact with an app instantly; they read, think, and type.

Timers in performance testing tools like JMeter help introduce these natural pauses, making your load tests more realistic and representative of actual usage patterns.

What is User Think Time?

Think time refers to the delay a real user takes between consecutive actions on a website or application. It's the human element of interaction.

  • Reading content on a page
  • Filling out forms or entering data
  • Deciding which link to click next
  • Pausing to process information

Without simulating think time, your test might generate an unrealistic, 'bursty' load.

Introducing JMeter Timers

JMeter provides several built-in timers to help you introduce delays into your test plan. Each timer offers a different way to control the pacing of requests, allowing you to model various user behaviors.

We'll focus on the most common ones that simulate user think time:

  • Constant Timer
  • Uniform Random Timer
  • Gaussian Random Timer

Fixed Delays with Constant Timer

The Constant Timer is the simplest timer. It pauses each thread (virtual user) for a fixed, predetermined amount of time after it completes its request.

If you set a Constant Timer to 3000 milliseconds, every virtual user will wait exactly 3 seconds before sending the next request within its scope.

This is useful when you need a consistent, predictable delay.

Using the Constant Timer

To add a Constant Timer, right-click on a Thread Group, Controller, or Sampler, then navigate to Add > Timer > Constant Timer.

You configure it by setting the 'Delay' value in milliseconds. For example, 5000 for a 5-second pause.

The timer applies its delay before the sampler it's attached to, or all samplers within its scope (if attached to a controller or Thread Group).

Random Delays with Uniform Timer

The Uniform Random Timer introduces a random delay that is uniformly distributed between a minimum and maximum value. This means any delay within the specified range is equally likely to occur.

For example, if the range is 1 to 5 seconds, a user might wait 1.2s, another 3.7s, another 4.9s – all with equal probability.

Configuring Uniform Random Timer

The Uniform Random Timer has two key settings:

  • Random Delay Maximum (ms): This is the upper bound of the random portion of the delay.
  • Constant Delay Offset (ms): This is a base delay that is always added to the random value.

If you set Maximum to 4000 and Offset to 1000, the total delay will be between 1000ms and 5000ms (1s to 5s).

Gaussian Random Timer for Realistic Spreads

The Gaussian Random Timer provides delays that follow a normal (bell curve) distribution. This is often more realistic for simulating human behavior than a uniform distribution.

Most actions will cluster around an average delay, with fewer actions being much shorter or much longer. Think of how most people might pause for around 3 seconds, but some might be faster (1s) and some slower (5s).

Gaussian Timer Configuration

For the Gaussian Random Timer, you configure:

  • Deviation (ms): This controls how much the delays can vary from the mean (average). A higher deviation means a wider spread of delays.
  • Constant Delay Offset (ms): This is the mean (average) delay around which the random values will be centered.

The actual delay will be Offset + (random value with given deviation).

Timer Challenge

You need to simulate users pausing for an average of 4 seconds between actions. However, you want to introduce some natural variation, where most pauses are close to 4 seconds, but a few might be slightly shorter or longer.

Which JMeter timer is best suited for this scenario?

Timers Summary

Great job! You've learned how to make your JMeter tests more realistic by simulating user think time using various timers.

  • Constant Timer: Provides a fixed, predictable delay.
  • Uniform Random Timer: Generates equally likely random delays within a specified range.
  • Gaussian Random Timer: Models realistic human pauses with delays clustered around an average, following a bell curve distribution.

Using timers is crucial for generating accurate load patterns and obtaining meaningful performance insights. Next, we'll explore more advanced JMeter features!

Grátis para começar

Aprenda Load Testing & Performance Benchmarking (JMeter & k6) com um tutor de IA — grátis

Escreva e execute código real no seu navegador, obtenha ajuda instantânea de um tutor de IA 24/7 e continue de onde parou na web ou no app.

Cursos
12
Aulas
48

Perguntas Frequentes

A aula “Temporizadores para um Ritmo Realista” é grátis?

Sim — o texto completo de “Temporizadores para um Ritmo Realista” é grátis para ler aqui na web. Para praticá-la interativamente (um editor de código integrado e um tutor de IA 24/7) e desbloquear o restante do curso de Load Testing & Performance Benchmarking (JMeter & k6), atualize para CoddyKit PRO. O curso de Load Testing & Performance Benchmarking (JMeter & k6) inclui 4 aulas no total.

O que vou aprender em “Temporizadores para um Ritmo Realista”?

Aplique diferentes temporizadores para introduzir atrasos realistas entre as solicitações, simulando o tempo de reflexão do usuário. Você pratica Load Testing & Performance Benchmarking (JMeter & k6) com código prático que executa diretamente no navegador, e um tutor de IA 24/7 responde suas dúvidas enquanto trabalha na aula.

Preciso ter experiência prévia para começar Load Testing & Performance Benchmarking (JMeter & k6)?

Nenhuma experiência prévia é necessária. Load Testing & Performance Benchmarking (JMeter & k6) no CoddyKit é estruturado para alunos iniciantes até avançados, então você pode começar aqui ou desde o início e aprender no seu ritmo. Esta é a aula 3 de 4.

Quanto tempo leva a aula “Temporizadores para um Ritmo Realista”?

A maioria das aulas CoddyKit leva cerca de 5–10 minutos. Cada uma é compacta e interativa, então você faz progresso constante e retoma exatamente de onde parou entre web e app.

Posso escrever e executar código nesta aula de Load Testing & Performance Benchmarking (JMeter & k6)?

Sim. Cada aula de Load Testing & Performance Benchmarking (JMeter & k6) inclui um editor de código integrado, então você escreve e executa código real direto no navegador e recebe feedback de IA instantaneamente — nenhuma configuração local necessária.

Todas as aulas deste curso

  1. Controladores de lógica e de loop
  2. Asserções para validação de respostas
  3. Temporizadores para um Ritmo Realista
  4. Testes distribuídos com servidores remotos
← Voltar para Load Testing & Performance Benchmarking (JMeter & k6)