Order of groups in summary

I would like to display groups alphabetically in the summary. Is it possible? Thanks.
Tami (Masaaki) Takamiya

Hi @tamitakamiya,
Currently - no.

I took a quick glance and it seems that they will more or less be in the order they appear in the script. To be honest I find this to be more useful then being alphabetical.

But in the case of multiple branches in the default function the current behavior probably won’t be nearly as useful as I find it for non multiple branches …

Although again I find the groups being alphabetical probably not what I would expect, it will be more consistent then the current behavior, and maybe it is the better behavior.

cc @ned @imiric

When I executed the following code:

import { group } from "k6";
function test(i) { group(`test ${i}`, () => { subTest(i); } ); }
function subTest(i) { group(`subtest ${i}`, () => {}); }
export default function() { for (let i = 1; i <= 10; i++ ) { test(i); } }

I got the following result. Results are different at each run. So I guessed those groups are stored in unordered collection such as set.

$ k6 run groups.js 

          /\      |β€Ύβ€Ύ|  /β€Ύβ€Ύ/  /β€Ύ/   
     /\  /  \     |  |_/  /  / /    
    /  \/    \    |      |  /  β€Ύβ€Ύ\  
   /          \   |  |β€Ύ\  \ | (_) | 
  / __________ \  |__|  \__\ \___/ .io

  execution: local
     output: -
     script: groups.js

    duration: -,  iterations: 1
         vus: 1, max: 1

    done [==========================================================] 1 / 1

    β–ˆ test 7

      β–ˆ subtest 7

    β–ˆ test 8

      β–ˆ subtest 8

    β–ˆ test 10

      β–ˆ subtest 10

    β–ˆ test 1

      β–ˆ subtest 1

    β–ˆ test 4

      β–ˆ subtest 4

    β–ˆ test 5

      β–ˆ subtest 5

    β–ˆ test 9

      β–ˆ subtest 9

    β–ˆ test 2

      β–ˆ subtest 2

    β–ˆ test 3

      β–ˆ subtest 3

    β–ˆ test 6

      β–ˆ subtest 6

Tami (Masaaki) Takamiya

Ah, I was also under the impression that groups were ordered, so I consider this a bug… I’ll create an issue

1 Like