Skip to content

Modern load testing tool using JavaScript and TypeScript, inspired by k6.

License

Notifications You must be signed in to change notification settings

denoload/denoload

Repository files navigation

denoload sauropod

🦕 denoload - Accelerate web API load testing with seamless client library integration.

denoload ascii art

denoload is a versatile load testing tool engineered to simplify the load testing of web services and similar backend components. It seamlessly integrate with client libraries, empowering developers to create robust load tests in just minutes. With denoload, you can verify the performance of your web services under real-world conditions, all while enjoying a straightforward and efficient testing process.

It is strongly inspired by k6.

Why ?

k6 is a great tool but it's lacking of libraries and community due to its custom JavaScript VM and API. Worse, there are edge cases where the VM isn't standard and can not be. This can lead to a lot frustration.

denoload aims to be an alternative with:

  • great performance (comparable to k6)
  • write k6 like scripts with VUs, iterations and executors
  • standard web APIs support (e.g. fetch)
  • ESModules support
  • Modern JavaScript & TypeScript support out of the box (including async / await)

This project is based on Bun.

Example script

import { faker } from "@faker-js/faker";
import { GoTrueClient } from "@supabase/gotrue-js";
import { globalRegistry } from "@negrel/denoload-metrics";
import expect from "expect";

export const options = {
  scenarios: {
    perVuIter: {
      executor: "per-vu-iterations",
      vus: 256,
      iterations: 10,
    },
  },
};

const AuthClient = new GoTrueClient({ url: "http://gotrue.local" });
const signUpCounter = globalRegistry.Counter("signup");
const signOutCounter = globalRegistry.Counter("signout");

export default async function (): Promise<void> {
  // Sign up and sign in.
  {
    const { data, error } = await AuthClient.signUp({
      email: faker.internet.email(),
      password: faker.internet.password(),
    });
    expect(error).toBeNull();
    expect(data).not.toBeNull();
    signUpCounter.add(1);
  }

  await Bun.sleep(1000);

  // Interact with your API...

  // Sign out.
  {
    const { error } = await AuthClient.signOut();
    expect(error).toBeNull();
    signOutCounter.add(1);
  }
}

See examples/gotrue to run the script locally.

TODOs

Executors:

  • Per VU iterations
  • Shared iterations
  • Constant VUs
  • Ramping VUs
  • Constant Arrival Rate
  • Ramping Arrival Rate

Why denoload ?

The project was originally based on the Deno runtime but I switched to Bun for VU isolation using ShadowRealm.

Contributing

If you want to contribute to denoload to add a feature or improve the code contact me at negrel.dev@protonmail.com, open an issue or make a pull request.

🌠 Show your support

Please give a ⭐ if this project helped you!

buy me a coffee

📜 License

MIT © Alexandre Negrel

About

Modern load testing tool using JavaScript and TypeScript, inspired by k6.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages