All Projects → grafana → har-to-k6

grafana / har-to-k6

Licence: Apache-2.0 license
JSON config representation of K6 script

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to har-to-k6

qd-templates
基于开源新版签到框架站发布的公共har模板库,整理自用 qiandao 框架可用的各种网站和App的 Har 模板,仅供学习参考。
Stars: ✭ 77 (+5.48%)
Mutual labels:  har
har-rs
A HTTP Archive format (HAR) serialization & deserialization library, written in Rust.
Stars: ✭ 25 (-65.75%)
Mutual labels:  har
qiandao
[当前版本: 20230111] Qiandao —— 一个HTTP请求定时任务自动执行框架 base on HAR Editor and Tornado Server
Stars: ✭ 2,100 (+2776.71%)
Mutual labels:  har
Httprunner
One-stop solution for HTTP(S) testing, written in Python.
Stars: ✭ 2,628 (+3500%)
Mutual labels:  har
request-capture-har
Wrapper for request module that saves all traffic as a HAR file.
Stars: ✭ 37 (-49.32%)
Mutual labels:  har
har-server
Serve responses from a HAR file.
Stars: ✭ 31 (-57.53%)
Mutual labels:  har
node-fetch-har
Generate HAR entries for requests made with node-fetch
Stars: ✭ 23 (-68.49%)
Mutual labels:  har
templates
基于开源新版签到框架站发布的公共har模板库,仅供示例
Stars: ✭ 306 (+319.18%)
Mutual labels:  har
Human Activity Recognition
A new and computationally cheap method to perform human activity recognition using PoseNet and LSTM. Where we use PoseNet for Preprocessing and LSTM for understand the sequence.
Stars: ✭ 25 (-65.75%)
Mutual labels:  har
json-caching-proxy
Node caching HTTP proxy built on top of express-http-proxy. Persists requests and responses to an in-memory HAR-like data structure based on HAR1.2 . Caches JSON content-type responses by default with the ability to cache an entire site; including content-types describing images. Useful for testing front end code, mocking api, and saving the cac…
Stars: ✭ 31 (-57.53%)
Mutual labels:  har
haralyzer
A Framework For Using HAR Files To Analyze Web Pages
Stars: ✭ 89 (+21.92%)
Mutual labels:  har
har-reader
Library for accessing HTTP Archives (HAR) with Java
Stars: ✭ 66 (-9.59%)
Mutual labels:  har
HAR
Code for WWW2019 paper "A Hierarchical Attention Retrieval Model for Healthcare Question Answering"
Stars: ✭ 22 (-69.86%)
Mutual labels:  har
jmeter-to-k6
Converts JMeter .jmx files to k6 JS code
Stars: ✭ 57 (-21.92%)
Mutual labels:  k6-converter
postman-to-k6
Converts Postman collections to k6 script code
Stars: ✭ 269 (+268.49%)
Mutual labels:  k6-converter

har-to-k6 cover image

har-to-k6

Converts LI-HAR and HAR to K6 script.

GitHub Actions Status NPM Version NPM Weekly Downloads DockerHub



Content

Installation

Local Installation (recommended)

While possible to install globally, we recommend that you, if possible, add the converter to the node_modules of your test project using:

$ npm install --save har-to-k6

Note that this will require you to run the converter with npx har-to-k6 your-har-file or, if you are using an older version of npm, ``./node_modules/.bin/har-to-k6 your-har-file`.

Global Installation

$ npm install --global har-to-k6

Docker

$ docker pull grafana/har-to-k6:latest

Usage

CLI Usage

Npx

$ npx har-to-k6 archive.har -o my-k6-script.js

From node_modules

$ ./node_modules/.bin/har-to-k6 archive.har -o my-k6-script.js

Global

$ har-to-k6 archive.tar -o my-k6-script.js

Programmatic Usage

Converting

const fs = require("fs");
const { liHARToK6Script } = require("har-to-k6");

async function run () {
  const archive = readArchive();
  const { main } = await liHARToK6Script(archive);
  fs.writeFileSync("./load-test.js", main);
}

Validating

Use validate() to run validation alone. Returns without error for a valid archive. Throws InvalidArchiveError for validation failure.

const { InvalidArchiveError, validate } = require("har-to-k6");

const archive = readArchive();
try {
  validate(archive);
} catch (error) {
  if (error instanceof InvalidArchiveError) {
    // Handle invalid archive
  } else {
    throw error;
  }
}

Browser Usage

har-to-k6 can be ran in the browser. This exposes the standard API under harToK6.

Importing as ES module

import { liHARToK6Script } from "har-to-k6";

CommonJS style

const { liHARToK6Script } = require("har-to-k6");

Using a <script> tag

Load standalone.js into your HTML page:

<html>
  <head>
    <title>HAR Converter</title>
    <script src="standalone.js"></script>
    <script src="index.js"></script>
  </head>
</html>

Example

The API is available:

async function run () {
    const archive = readArchive();
    harToK6.validate(archive);
    const { main } = await harToK6.liHARToK6Script(archive);
    displayResult(main);
}

Specifications

Credits

Thanks to bookmoons for creating this tool 🎉

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].