Socket
Book a DemoInstallSign in
Socket

opengov-k6-core

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

opengov-k6-core

Enhanced k6 core library for efficient load testing

latest
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

Description

A robust k6 core library designed to enhance load testing capabilities. It offers extended functionalities for various protocols, custom metrics, aiming to simplify and empower performance testing for developers and QA engineers.

Technologies and tools used:

  • TS
  • yarn
  • k6
  • Grafana
  • Prometheus

Setup

Install Node 18.16.0+ or set Node 18.16.0+ as the version to use with this project

nvm use 18.16.0

Contributing

Thank you for considering to contribute to this project! Please review the Contribution Guidelines to begin.

Testing Changes

To test changes to the library, follow these steps:

  • Build the Project
    Run the following command to build the project:
    yarn build
    
  • Package the Library
    Create a packed .tgz file of your library using:
    yarn pack
    
  • Copy the Packaged File
    Copy the resulting .tgz file to the dependent project's directory.
  • Update the Dependency
    Update the package.json in the dependent project to the path of the new .tgz file. For example:
    "dependencies": {
       "opengov-k6-core": "file:path/to/your-library.tgz"
    }```
    
  • Install the Updated Package
    Install the updated package with:
    yarn install
    
  • Run any Tests
    Execute the tests using any appropriate script from the package.json to ensure everything works as expected:

ThresholdMerger Class

The ThresholdMerger class is designed to manage and merge performance monitoring thresholds. It allows users to easily integrate custom thresholds while default thresholds are maintained as a fallback.

Features:

Complete Replacement:

Custom thresholds provided for a metric completely replace the existing defaults for that metric, rather than merging or appending. This ensures that custom settings are prioritized and simplifies configuration management.

Ease of Use:

Simple and intuitive method interfaces make it straightforward to merge custom thresholds with defaults.

Usage:

To use the ThresholdMerger class within the getLoadProfile function, pass the custom thresholds as the fourth argument. This argument should be an object where the keys are the metric names and the values are arrays of threshold conditions you wish to apply. Ensure that the ThresholdMerger class is properly integrated to handle these thresholds according to the specific requirements of your project.

import customThresholds from '../../../../../../load_rates/samples/rates/thresholds/customThresholds.json';
export const options: Options = getLoadProfile(
  Number(__ENV.DURATION),
  Number(__ENV.VUS),
  scenariosConfig,
  customThresholds,
);
Example of threshold file:
{
  "http_req_duration": ["p(90)<200", "p(95)<300", "avg<250"],
  "http_req_failed": ["rate<0.01"],
  "http_req_connecting": ["p(95)<50"],
  "http_req_sending": ["avg<50"],
  "http_req_receiving": ["avg<3000"]
}

FAQ

  • In case of error Error: error:0308010C:digital envelope routines::unsupported execute following command export NODE_OPTIONS=--openssl-legacy-provider

Support

  • K6 Support Channel
    • #k6-framework
  • General QCE Support
    • #team-qce-support

FAQs

Package last updated on 13 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts