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

Metrics aren't being associated with a group #721

Open
ankur22 opened this issue Jan 19, 2023 · 3 comments
Open

Metrics aren't being associated with a group #721

ankur22 opened this issue Jan 19, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@ankur22
Copy link
Collaborator

ankur22 commented Jan 19, 2023

Brief summary

While investigating a community support question, I ran into an issue where I noticed that metrics weren't being grouped into groups.

Script:

import { chromium } from 'k6/x/browser';
import { group } from "k6";

export const options = {
  thresholds: {
    'browser_dom_content_loaded{group:::home}': ['p(95)<500'],
    'browser_dom_content_loaded{group:::coinFlip}': ['p(95)<500'],
  },
};

export default async function () {
  const browser = chromium.launch({headless: false});
  const context = browser.newContext();
  const page = context.newPage();
  const page2 = context.newPage();

  try {
    await group('home', async function () {
      await page.goto('https://test.k6.io/')
    })

    await group('coinFlip', async function () {
      await page2.goto('https://test.k6.io/flip_coin.php')
    })
  } finally {
    page.close();
    browser.close();
  }
}

Output:

     browser_dom_content_loaded.......: avg=71.42ms  min=47µs     med=51µs     max=214.18ms p(90)=171.36ms p(95)=192.77ms
     ✓ { group:::coinFlip }...........: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s
     ✓ { group:::home }...............: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s

xk6-browser version

63d5db7

OS

Mac

Chrome version

Unknown

Docker version and image (if applicable)

NA

Steps to reproduce the problem

Run the given script with the version of xk6-browser (on main).

Expected behaviour

The groups sub-metrics are non zero.

Actual behaviour

The groups sub-metrics are zero.

@ankur22 ankur22 added the bug Something isn't working label Jan 19, 2023
@mstoykov
Copy link
Contributor

grafana/k6#2863 should fix this

@aakash3771
Copy link

How to get notified when this is fixed?

@mstoykov
Copy link
Contributor

The above PR is unlikely to be merged and it is likely better to follow the underlying problems and possible solutions in grafana/k6#2728

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants