Skip to content

Commit

Permalink
Merge #72285 #72295
Browse files Browse the repository at this point in the history
72285: workload/tpcc: check the 90th percentile instead of the .9th r=nvanbenschoten a=ajwerner

The hdrhistogram API was misleading. It expected a percentile for a quantile
calculation. All-in-all it appears the author of that library had percentile
and quantile confused. At some point in the last year, somebody did add a
`ValueAtPercentile` method which has the identical behavior as
`ValueAtQuantile`.

See https://github.com/cockroachdb/vendored/blob/5b815c7d468d59337db2c742373183af5525e729/github.com/codahale/hdrhistogram/hdr.go#L241-L259

Fixes #72282.

Release note: None

72295: sqlsmith: don't use crdb_internal.reset_index_usage_stats r=yuzefovich a=yuzefovich

Fixes: #72259.

Release note: None

Co-authored-by: Andrew Werner <[email protected]>
Co-authored-by: Yahor Yuzefovich <[email protected]>
  • Loading branch information
3 people committed Nov 1, 2021
3 parents 039ed5f + 0360326 + e7320e3 commit ce622df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/internal/sqlsmith/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ var functions = func() map[tree.FunctionClass]map[oid.Oid][]function {
"crdb_internal.unsafe_",
"crdb_internal.create_join_token",
"crdb_internal.reset_multi_region_zone_configs_for_database",
"crdb_internal.reset_index_usage_stats",
} {
skip = skip || strings.Contains(def.Name, substr)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/workload/tpcc/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func (r *Result) FailureError() error {
if !exists {
return errors.Errorf("no %v data exists", query)
}
if v := time.Duration(h.ValueAtQuantile(.9)); v > max90th {
if v := time.Duration(h.ValueAtQuantile(90)); v > max90th {
err = errors.CombineErrors(err,
errors.Errorf("90th percentile latency for %v at %v exceeds passing threshold of %v",
query, v, max90th))
Expand Down

0 comments on commit ce622df

Please sign in to comment.