Report javascript duration in CTS tooling

Always report the Javascript duration from the page instead of
the total duration from ResultDB. Reporting of the total duration
could be added back in the future, but usages of the tooling are
currently interested in the Javascript duration.

Bug: chromium:1336333
Change-Id: I74e91e7a9c29f3a4c45ed67898cc6f2de62e19a4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94762
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
Austin Eng 2022-06-28 00:15:05 +00:00 committed by Dawn LUCI CQ
parent 14e6dfbd95
commit 65d35f8e7d
1 changed files with 8 additions and 1 deletions

View File

@ -218,13 +218,20 @@ func GetResults(
status := toStatus(rpb.Status)
tags := result.NewTags()
duration := rpb.GetDuration().AsDuration()
for _, sp := range rpb.Tags {
if sp.Key == "typ_tag" {
tags.Add(sp.Value)
}
if sp.Key == "javascript_duration" {
var err error
if duration, err = time.ParseDuration(sp.Value); err != nil {
return err
}
}
}
duration := rpb.GetDuration().AsDuration()
if status == result.Pass && duration > cfg.Test.SlowThreshold {
status = result.Slow
}