Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard returns blank graph when moving APIs definition to folder. #3686

Closed
nptri opened this issue Apr 11, 2024 · 1 comment
Closed

Dashboard returns blank graph when moving APIs definition to folder. #3686

nptri opened this issue Apr 11, 2024 · 1 comment

Comments

@nptri
Copy link

nptri commented Apr 11, 2024

Brief summary

Dashboard returns blank graph when move APIs to a different js file

k6 version

0.50.0

OS

MacOS Sonoma

Docker version and image (if applicable)

No response

Steps to reproduce the problem

I have made 2 sample APIs for demo, when it is both on same level, the issue happen:
image
Here is code on the execute script:

import {get_Data_User} from "./getDataUser.js";
import {update_NewUser} from "./updateNewUser.js"

export const options = {
    scenarios:{
        getUser_then_UpdateUser: {
          executor: 'constant-arrival-rate', // https://grafana.com/docs/k6/latest/using-k6/scenarios/executors/
          duration: 10000,
          rate: 1,
          preAllocatedVUs: 1,
          timeUnit: 1,
        }
  }
}

export default function () {
    get_Data_User();
    update_NewUser();
}

And script for API:

import http from 'k6/http';
import { check, sleep } from 'k6';
import { baseURL, endpoint_1 } from './user-file/httpconf/httpconf.js';
export function get_Data_User (){
    const url_endpoint_1 = baseURL + endpoint_1;
    const request_Call = http.get(url_endpoint_1);
    // console.log(request_Call.body)
    console.log(request_Call.status)
    check(request_Call, {
      "response code was 200": (req) => request_Call.status == 200,
      "Body contains Data of Get": (req) => request_Call.body.includes(`"per_page"`)
    }
    )
  }

When I trigger this, using command K6_WEB_DASHBOARD=true K6_WEB_DASHBOARD_EXPORT=testreport.html k6 run script.js I get this screen:
image

But the check still execute normally
image

I think this could be an issue, please have a look

Expected behaviour

The dashboard graph should return valid graph

Actual behaviour

The dashboard graph should return INvalid graph

@nptri
Copy link
Author

nptri commented Apr 12, 2024

New info: when I set to executor as

        getUser_then_UpdateUser: {
          executor: 'constant-arrival-rate', 
          duration: 30000, //changed from 10 seconds to 30 seconds
          rate: 1,
          preAllocatedVUs: 1,
          timeUnit: "1s",
        }

The log dashboard can now be viewed, as stated in doc site:
The report only includes graphs if the test duration is greater than three times the aggregation period value, set by the K6_WEB_DASHBOARD_PERIOD variable.
Default value of K6_WEB_DASHBOARD_PERIOD is 10s, so I have to put 30s.

@nptri nptri closed this as completed Apr 12, 2024
@olegbespalov olegbespalov removed their assignment Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants