grafana / k6-cloud-feature-requests

The place to propose, dicuss and vote for k6 Cloud features and ideas.
9 stars 1 forks source link

RPS when there are zero requests #54

Closed burck1 closed 7 months ago

burck1 commented 2 years ago

I had originally submitted this as a support ticket but the helpful support engineer directed me to submit the request here.

We are reporting a custom RPS metric during our tests where we expect the RPS to be zero during a portion of the test. We think that the RPS is in fact zero, but the graphs within k6 cloud look like they attempt to connect the data points instead of showing zero RPS or showing an absence of data. Is there some way to get the graphs to show as zero RPS or to show a gap in the data? If not, can we submit this as a bug or feature request?

graph_a

graph_b

In the support ticket Tom indicated that "Behind-the-scenes, we use the Highcharts library, and it would appear that the library does indeed support the concept of a "null" entry that should break up the line to indicate lack of data."

Additionally, in our k6 script we have something like:

import http from 'k6/http';
import { Counter } from 'k6/metrics';

const httpReqsEast = new Counter('http_reqs/us_east_1');
const httpReqsWest = new Counter('http_reqs/us_west_1');
const httpReqsOther = new Counter('http_reqs/other');

export default function () {
  const res = http.get('https://foo.example.com/bar');
  const region = res.json().region
  if (region === 'us-east-1') {
    httpReqsEast.add(1);
  } else if (region === 'us-west-2') {
    httpReqsWest.add(1);
  } else {
    httpReqsOther.add(1);
  }
}

We are up for suggestions for other ways to do this. Or maybe there is something we can add to our script to force a zero value?

import http from 'k6/http';
import { Counter } from 'k6/metrics';

const httpReqsEast = new Counter('http_reqs/us_east_1');
const httpReqsWest = new Counter('http_reqs/us_west_1');
const httpReqsOther = new Counter('http_reqs/other');

export default function () {
  const res = http.get('https://foo.example.com/bar');
  const region = res.json().region
  if (region === 'us-east-1') {
    httpReqsEast.add(1);
    // can we even do this???
    httpReqsWest.add(0);
    httpReqsOther.add(0);
  } else if (region === 'us-west-2') {
    httpReqsEast.add(0);
    httpReqsWest.add(1);
    httpReqsOther.add(0);
  } else {
    httpReqsEast.add(0);
    httpReqsWest.add(0);
    httpReqsOther.add(1);
  }
}
markjmeier commented 7 months ago

This issue has been migrated to Grafana Feature requests (please contact support or your account team to submit additional ideas or to add to this one)