Giter VIP home page Giter VIP logo

xk6-plugin-egts's Introduction

xk6-plugin-egts

It k6 extention for stress testing EGTS protocol receivers.

Build

To build a k6 binary with this extension, first ensure you have the prerequisites:

Then, install xk6 and build your custom k6 binary with the EGTS extension:

  1. Install xk6:
$ go install github.com/k6io/xk6/cmd/xk6@latest
  1. Build the binary:
$ xk6 build --with github.com/kuznetsovin/xk6-plugin-egts@latest

Example

import egts from "k6/x/egts";

export let options = {
    scenarios: {
        scenario_1: {
            executor: 'shared-iterations',            
            vus: 2,
            iterations: 4,
        },
        scenario_2: {
            executor: 'per-vu-iterations',            
            vus: 2,
            iterations: 2,
        },
    }
};

// client testing tracks, where key is VU number
// point of track is array [lat, lon, sens_value, fuel_level]
// if sens_value or fuel_level equals 0 then sending simple packet whith coordinate section only 
const data = {
    0: [[55.55389399769574, 37.43236696287812, 1000, 1000], [55.55389399769574, 37.43236696287812, 1000, 1000]],
    1: [[55.55389399769574, 37.43236696287812, 1000, 1000], [55.55389399769574, 37.43236696287812, 200, 200]]
}

//for each VU open connection for emulating device
export default () => {
    let client = egts.newClient("127.0.0.1:6000", __VU);
    data[__VU%2].forEach((rec) => {
        egts.sendPacket(client, ...rec)
    })

    client.close()
};

Result output:

          /\      |‾‾| /‾‾/   /‾‾/   
     /\  /  \     |  |/  /   /  /    
    /  \/    \    |     (   /   ‾‾\  
   /          \   |  |\  \ |  (‾)  | 
  / __________ \  |__| \__\ \_____/ .io

  execution: local
     script: example/example.js
     output: -

  scenarios: (100.00%) 2 scenarios, 4 max VUs, 10m30s max duration (incl. graceful stop):
           * scenario_1: 4 iterations shared among 2 VUs (maxDuration: 10m0s, gracefulStop: 30s)
           * scenario_2: 2 iterations for each of 2 VUs (maxDuration: 10m0s, gracefulStop: 30s)


running (00m00.2s), 0/4 VUs, 8 complete and 0 interrupted iterations
scenario_1 ✓ [======================================] 2 VUs  00m00.2s/10m0s  4/4 shared iters
scenario_2 ✓ [======================================] 2 VUs  00m00.2s/10m0s  4/4 iters, 2 per VU

     data_received...............: 464 B  2.0 kB/s
     data_sent...................: 1.4 kB 6.2 kB/s
     egts_packets................: 16     69.993701/s
     egts_packets_process_time...: avg=56.47µs  min=1.65µs med=20.38µs  max=200.24µs p(90)=185.85µs p(95)=193.26µs
     iteration_duration..........: avg=113.44ms min=3.92ms med=113.77ms max=222.6ms  p(90)=222.01ms p(95)=222.31ms
     iterations..................: 8      34.99685/s

xk6-plugin-egts's People

Contributors

kuznetsovin avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.