Skip to content

Commit

Permalink
feat: improve detail
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Nov 6, 2023
1 parent 2024046 commit 84247fc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Printers/Detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ public function print(Result $result): void
$dnsRecords = dns_get_record($domain, DNS_AAAA + DNS_A);
$dnsRecords = array_map(fn (array $record): string => $record['ipv6'] ?? $record['ip'], $dnsRecords ?: []);
$dnsRecords = array_unique($dnsRecords);
if (count($dnsRecords) > 3) {
$dnsRecords = array_slice($dnsRecords, 0, 3);
$dnsRecords[] = '(…)';
}

$dnsRecords = implode(', ', $dnsRecords);

$this->twoColumnDetail('DNS Lookup Duration', <<<HTML
Expand Down Expand Up @@ -84,7 +89,7 @@ public function print(Result $result): void

$this->twoColumnDetail(<<<HTML
<span>— TTFB</span>
<span class="ml-1 text-gray">$percentage %</span>
<span class="ml-1 text-gray">$percentage % — including server processing time</span>
HTML, "<span class=\"$color\">$value</span>");

$color = $this->color($result->requests->download->duration->avg, 100.0, 300.0, 1000.0);
Expand Down

0 comments on commit 84247fc

Please sign in to comment.