|
531 | 531 | {{ $pct := mul (div (float $r.rps) (float $maxRps)) 100.0 }} |
532 | 532 | {{ $meta := index site.Data.frameworks $r.framework }} |
533 | 533 | {{ $s2xx := int ($r.status_2xx | default 0) }}{{ $s3xx := int ($r.status_3xx | default 0) }}{{ $s4xx := int ($r.status_4xx | default 0) }}{{ $s5xx := int ($r.status_5xx | default 0) }}{{ $errs := add $s4xx $s5xx }} |
534 | | - <div class="lb-row{{ if $isReconn }} lb-row-reconn{{ end }}{{ if $isNoisy }} lb-row-noisy{{ end }}" data-lang="{{ $r.language | default "" }}" data-name="{{ $r.framework }}" data-rps="{{ printf "%.0f" $r.rps }}" data-bandwidth="{{ $r.bandwidth | default "" }}" data-input-bw="{{ $r.input_bw | default "" }}" data-type="{{ with $meta }}{{ .type | default "framework" }}{{ end }}" data-desc="{{ with $meta }}{{ .description }}{{ end }}" data-repo="{{ with $meta }}{{ .repo }}{{ end }}" data-s2xx="{{ $s2xx }}" data-s3xx="{{ $s3xx }}" data-s4xx="{{ $s4xx }}" data-s5xx="{{ $s5xx }}" {{ if $r.tpl_baseline }}data-tpl-baseline="{{ $r.tpl_baseline }}" data-tpl-json="{{ $r.tpl_json }}" data-tpl-db="{{ $r.tpl_db }}" data-tpl-upload="{{ $r.tpl_upload }}" data-tpl-compression="{{ $r.tpl_compression }}"{{ end }}> |
| 534 | + <div class="lb-row{{ if $isReconn }} lb-row-reconn{{ end }}{{ if $isNoisy }} lb-row-noisy{{ end }}" data-lang="{{ $r.language | default "" }}" data-name="{{ $r.framework }}" data-rps="{{ printf "%.0f" $r.rps }}" data-bandwidth="{{ $r.bandwidth | default "" }}" data-input-bw="{{ $r.input_bw | default "" }}" data-type="{{ with $meta }}{{ .type | default "framework" }}{{ end }}" data-desc="{{ with $meta }}{{ .description }}{{ end }}" data-repo="{{ with $meta }}{{ .repo }}{{ end }}" data-s2xx="{{ $s2xx }}" data-s3xx="{{ $s3xx }}" data-s4xx="{{ $s4xx }}" data-s5xx="{{ $s5xx }}" {{ if $r.tpl_baseline }}data-tpl-baseline="{{ int $r.tpl_baseline }}" data-tpl-json="{{ int ($r.tpl_json | default 0) }}" data-tpl-db="{{ int ($r.tpl_db | default 0) }}" data-tpl-upload="{{ int ($r.tpl_upload | default 0) }}" data-tpl-compression="{{ int ($r.tpl_compression | default 0) }}"{{ end }}> |
535 | 535 | {{ $ftype := "framework" }}{{ with $meta }}{{ $ftype = .type | default "framework" }}{{ end }} |
536 | 536 | <div class="lb-rank">{{ if eq $j 0 }}🥇{{ else if eq $j 1 }}🥈{{ else if eq $j 2 }}🥉{{ else }}{{ add $j 1 }}{{ end }}</div> |
537 | 537 | <div class="lb-name">{{ $r.framework }}</div> |
|
1210 | 1210 | rows.forEach(function(row) { |
1211 | 1211 | if (row.classList.contains('lb-hidden')) return; |
1212 | 1212 | var d = { |
1213 | | - baseline: parseInt(row.dataset.tplBaseline) || 0, |
1214 | | - json: parseInt(row.dataset.tplJson) || 0, |
1215 | | - db: parseInt(row.dataset.tplDb) || 0, |
1216 | | - upload: parseInt(row.dataset.tplUpload) || 0, |
1217 | | - compression: parseInt(row.dataset.tplCompression) || 0 |
| 1213 | + baseline: Number(row.dataset.tplBaseline) || 0, |
| 1214 | + json: Number(row.dataset.tplJson) || 0, |
| 1215 | + db: Number(row.dataset.tplDb) || 0, |
| 1216 | + upload: Number(row.dataset.tplUpload) || 0, |
| 1217 | + compression: Number(row.dataset.tplCompression) || 0 |
1218 | 1218 | }; |
1219 | 1219 | var weighted = 0; |
1220 | 1220 | mixedKeys.forEach(function(k) { weighted += d[k] * mixedWeights[k]; }); |
|
0 commit comments