import http from 'k6/http';
import { check } from 'k6';

export const options = {
    scenarios: {
        constant_rps: {
            executor: 'constant-arrival-rate',
            rate: 1000,
            timeUnit: '1s',
            duration: '10s',
            preAllocatedVUs: 200,
            maxVUs: 1000,
        },
    },
};

export default function () {
    const res = http.get(`${__ENV.URI}/api/me`, {
        headers: {
            Authorization: `Bearer ${__ENV.JWT}`,
        },
    });

    check(res, {
        'status is 200': (r) => r.status === 200,
    });
}
