func (d *Devops) GroupByTimeAndPrimaryTag(qq query.Query, numMetrics int) {
	metrics := mustGetCPUMetricsSlice(numMetrics)
	selectClause := getSelectClause(metrics, nil)
	qi := &queryInfo{
		query:    fmt.Sprintf("avg(avg_over_time(%s[1h])) by (__name__, hostname)", selectClause),
		label:    devops.GetDoubleGroupByLabel("VictoriaMetrics", numMetrics),
		interval: d.Interval.MustRandWindow(devops.DoubleGroupByDuration),
		step:     "3600",
	}
	d.fillInQuery(qq, qi)
}
GroupByTimeAndPrimaryTag selects the AVG of numMetrics metrics under 'cpu' per device per hour for a day,
e.g. in pseudo-PromQL:

avg(
avg_over_time(
{__name__=~"metric1|metric2...|metricN"}[1h]
)
) by (__name__, hostname)

Resultsets:
double-groupby-1
double-groupby-5
double-groupby-all
package victoriametrics
import (
	"fmt"
	"strings"
	"time"
	"github.com/timescale/tsbs/cmd/tsbs_generate_queries/uses/devops"
	"github.com/timescale/tsbs/pkg/query"
)
type Devops struct {
	*BaseGenerator
	*devops.Core
}
func (d *Devops) mustGetRandomHosts(nHosts int) []string {
	hosts, err := d.GetRandomHosts(nHosts)
	if err != nil {
		panic(err.Error())
	}
	return hosts
}
func (d *Devops) GroupByOrderByLimit(qi query.Query) {
	panic("GroupByOrderByLimit not supported in PromQL")
}
func (d *Devops) LastPointPerHost(qq query.Query) {
	panic("LastPointPerHost not supported in PromQL")
}
func (d *Devops) HighCPUForHosts(qi query.Query, nHosts int) {
	panic("HighCPUForHosts not supported in PromQL")
}
func (d *Devops) GroupByTime(qq query.Query, nHosts, numMetrics int, timeRange time.Duration) {
	metrics := mustGetCPUMetricsSlice(numMetrics)
	hosts := d.mustGetRandomHosts(nHosts)
	selectClause := getSelectClause(metrics, hosts)
	qi := &queryInfo{
		query:    fmt.Sprintf("max(max_over_time(%s[1m])) by (__name__)", selectClause),
		label:    fmt.Sprintf("VictoriaMetrics %d cpu metric(s), random %4d hosts, random %s by 1m", numMetrics, nHosts, timeRange),
		interval: d.Interval.MustRandWindow(timeRange),
		step:     "60",
	}
	d.fillInQuery(qq, qi)
}