Skip to content

Commit a6bbbd3

Browse files
committed
add plain-segment-only notes/comments
1 parent fa8c711 commit a6bbbd3

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

wasp/benchspy/TO_DO.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@ Known things to do:
66
- [ ] test with k8s app (focus: resources)
77
- [ ] add report builder (?)
88
- [ ] add wrapper function for executing some code and then creating a report
9-
- [ ] think what to do with errors... do we really need a slice?
10-
- [ ] if TestEnd is zero, default to `time.Now()`?
119
- [ ] add helper method for a profile what would create a report based on all generators?

wasp/benchspy/loki.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ type LokiQueryExecutor struct {
3535
// Performance queries results
3636
// can be anything, avg RPS, amount of errors, 95th percentile of CPU utilization, etc
3737
QueryResults map[string][]string `json:"query_results"`
38-
// In case something went wrong, but sure we need it
39-
Errors []error `json:"errors"`
4038

4139
LokiConfig *wasp.LokiConfig `json:"-"`
4240
}
@@ -192,6 +190,8 @@ func standardQuery(standardMetric StandardMetric, testName, generatorName, branc
192190
return fmt.Sprintf("quantile_over_time(0.95, {branch=~\"%s\", commit=~\"%s\", go_test_name=~\"%s\", test_data_type=~\"responses\", gen_name=~\"%s\"} | json| unwrap duration [10s]) by (go_test_name, gen_name) / 1e6", branch, commit, testName, generatorName), nil
193191
case ErrorRate:
194192
queryRange := calculateTimeRange(startTime, endTime)
193+
// this becomes problematic if we want to only consider plain segments, because each might have a different length and thus should have a different range window for accurate calculation
194+
// unless... we will are only interested in comparing the differences between reports, not the actual values, then it won't matter that error rate is skewed (calculated over ranges longer than query interval)
195195
return fmt.Sprintf("sum(max_over_time({branch=~\"%s\", commit=~\"%s\", go_test_name=~\"%s\", test_data_type=~\"stats\", gen_name=~\"%s\"} | json| unwrap failed [%s]) by (node_id, go_test_name, gen_name)) by (__stream_shard__)", branch, commit, testName, generatorName, queryRange), nil
196196
default:
197197
return "", fmt.Errorf("unsupported standard metric %s", standardMetric)

wasp/benchspy/report.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ func (b *StandardReport) FetchData(ctx context.Context) error {
4747

4848
for _, queryExecutor := range b.QueryExecutors {
4949
errGroup.Go(func() error {
50+
// feature: PLAIN SEGEMENT ONLY
51+
// go over all schedules and execute the code below only for ones with type "plain"
52+
// and then concatenate that data and return that; if parallelizing then we should first
53+
// create a slice of plain segments and then, when sending results over channel include the index,
54+
// so that we can concatenate them in the right order
5055
queryExecutor.TimeRange(b.TestStart, b.TestEnd)
5156

5257
if validateErr := queryExecutor.Validate(); validateErr != nil {

0 commit comments

Comments
 (0)