Loading challenge...
Create load ramp scenarios
Gradually increase load to find breaking point
Load profile stages
Copy and run with k6
import http from 'k6/http';
import { sleep } from 'k6';
export const options = {
stages: [
{ duration: '30s', target: 10 },
{ duration: '60s', target: 50 },
{ duration: '60s', target: 100 },
{ duration: '30s', target: 0 },
],
};
export default function() {
http.get('https://api.example.com/data');
sleep(1);
}Testing hints
// Test ramp pattern selection
await page.click('text=Spike Test');
await expect(page.locator('canvas')).toBeVisible();
// Start simulation
await page.click('text=Start Simulation');
// Verify VU counter updates
await expect(page.locator('text=/\d+ VUs/'))
.not.toHaveText('0 VUs', { timeout: 5000 });
// Wait for simulation to progress
await page.waitForTimeout(2000);
// Stop simulation
await page.click('text=Stop Simulation');
// Verify k6 script is generated
const script = await page.locator('pre').textContent();
expect(script).toContain('stages:');
expect(script).toContain('target: 200');// Stress test pattern
export const options = {
stages: [
{ duration: '2m', target: 100 },
{ duration: '5m', target: 100 },
{ duration: '2m', target: 200 },
{ duration: '5m', target: 200 },
{ duration: '2m', target: 300 },
{ duration: '5m', target: 300 },
{ duration: '5m', target: 0 },
],
thresholds: {
http_req_duration: ['p(99)<1500'],
http_req_failed: ['rate<0.01'],
},
};