diff --git a/dashboard/app/entities_spanner.go b/dashboard/app/entities_spanner.go index ff154986e54a..7851c0d88200 100644 --- a/dashboard/app/entities_spanner.go +++ b/dashboard/app/entities_spanner.go @@ -44,8 +44,8 @@ func MergedCoverage(ctx context.Context, ns, periodType string) (*CoverageHistor select dateto as targetdate, duration as days, - cast(sum(instrumented) as INTEGER) as instrumented, - cast(sum(covered) as INTEGER) as covered + cast(sum(array_length(linesinstrumented, 1)) as INTEGER) as instrumented, + cast(sum(array_length(hitcounts, 1)) as INTEGER) as covered from merge_history join files on merge_history.session = files.session where namespace=$1 and duration>=$2 and duration<=$3 diff --git a/pkg/cover/heatmap.go b/pkg/cover/heatmap.go index d4d29fbd910d..a07bd4da6548 100644 --- a/pkg/cover/heatmap.go +++ b/pkg/cover/heatmap.go @@ -159,8 +159,8 @@ func filesCoverageWithDetailsStmt(ns, subsystem string, timePeriod coveragedb.Ti SQL: ` select commit, - instrumented, - covered, + array_length(linesinstrumented, 1) as instrumented, + array_length(hitcounts, 1) as covered, files.filepath, subsystems from merge_history