This is an automated email from the ASF dual-hosted git repository.

kparisa pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iggy-website.git


The following commit(s) were added to refs/heads/main by this push:
     new 998beff29 fix(site): read the homepage benchmark figures from one 
place (#81)
998beff29 is described below

commit 998beff29db413bca7ae00c8e73f0fcb0128e8bc
Author: Justin Mclean <[email protected]>
AuthorDate: Thu Sep 3 16:08:13 2026 +1000

    fix(site): read the homepage benchmark figures from one place (#81)
    
    The hero advertised "~1 ms" labelled "Avg Write Latency". The latency
    table two sections below, on the same page, gives the producer average
    as 0.466 ms and the P99 as 0.976 ms, so the hero was quoting a P99 under
    an average label and understating the measured average by more than
    half.
    
    The numbers were hardcoded twice, in page.tsx and in
    benchmark-chart.tsx, which is what let them drift apart. They now come
    from src/lib/benchmark.ts: the latency table, the stat tiles and the
    hero all read the same values, and the hero renders 0.5 ms from the
    producer average rather than a literal.
    
    Update the figures in one file when a new benchmark run is published.
---
 src/app/(home)/page.tsx            |  3 ++-
 src/components/benchmark-chart.tsx | 32 ++++++++++++++++++++------------
 src/lib/benchmark.ts               | 32 ++++++++++++++++++++++++++++++++
 3 files changed, 54 insertions(+), 13 deletions(-)

diff --git a/src/app/(home)/page.tsx b/src/app/(home)/page.tsx
index 3ac9abd9c..3ea052f70 100644
--- a/src/app/(home)/page.tsx
+++ b/src/app/(home)/page.tsx
@@ -22,6 +22,7 @@ import Image from "next/image";
 import type { Metadata } from "next";
 import { LandingCodeTabs } from "@/components/code-tabs";
 import { BenchmarkSection } from "@/components/benchmark-chart";
+import { LATENCY_MS } from "@/lib/benchmark";
 
 export const metadata: Metadata = {
   title: "Apache Iggy | Hyper-Efficient Message Streaming written in Rust.",
@@ -36,7 +37,7 @@ const heroStats = [
     gradient: "from-[#f9923f] via-[#5f87fd] to-[#fa5e8a]",
   },
   {
-    value: "~1 ms",
+    value: `~${LATENCY_MS.producer.avg.toFixed(1)} ms`,
     label: "Avg Write Latency",
     gradient: "from-[#5f87fd] to-[#7d44e0]",
   },
diff --git a/src/components/benchmark-chart.tsx 
b/src/components/benchmark-chart.tsx
index 6e29b9ce1..28db7e085 100644
--- a/src/components/benchmark-chart.tsx
+++ b/src/components/benchmark-chart.tsx
@@ -3,6 +3,8 @@
 import Link from "next/link";
 import { useEffect, useMemo, useRef, useState } from "react";
 
+import { LATENCY_MS } from "@/lib/benchmark";
+
 const PRODUCER_BENCHMARK_URL =
   
"https://benchmarks.iggy.apache.org/benchmarks/4bc63b0e-f0fb-44b5-8c42-6159603a5653";;
 const CONSUMER_BENCHMARK_URL =
@@ -14,16 +16,22 @@ const Y_TICKS = [0, 0.2, 0.4, 0.6, 0.8, 1];
 const X_MAX = 800;
 const SAMPLES = 160;
 
-const PRODUCER_AVG_MS = 0.466;
-const CONSUMER_AVG_MS = 0.357;
+const PRODUCER_AVG_MS = LATENCY_MS.producer.avg;
+const CONSUMER_AVG_MS = LATENCY_MS.consumer.avg;
+
+const ms = (value: number) => value.toFixed(3);
 
 const latencyRows = [
-  { label: "Avg", producer: "0.466", consumer: "0.357" },
-  { label: "Median", producer: "0.349", consumer: "0.351" },
-  { label: "P95", producer: "0.886", consumer: "0.446" },
-  { label: "P99", producer: "0.976", consumer: "0.495" },
-  { label: "P99.9", producer: "1.114", consumer: "0.566" },
-];
+  { label: "Avg", key: "avg" },
+  { label: "Median", key: "median" },
+  { label: "P95", key: "p95" },
+  { label: "P99", key: "p99" },
+  { label: "P99.9", key: "p999" },
+].map(({ label, key }) => ({
+  label,
+  producer: ms(LATENCY_MS.producer[key as keyof typeof LATENCY_MS.producer]),
+  consumer: ms(LATENCY_MS.consumer[key as keyof typeof LATENCY_MS.consumer]),
+}));
 
 const stats = [
   {
@@ -45,16 +53,16 @@ const stats = [
     detail: "Persistent log reads",
   },
   {
-    value: "0.976",
+    value: ms(LATENCY_MS.producer.p99),
     unit: "ms",
     label: "Producer P99",
-    detail: "0.466 ms average",
+    detail: `${ms(LATENCY_MS.producer.avg)} ms average`,
   },
   {
-    value: "0.495",
+    value: ms(LATENCY_MS.consumer.p99),
     unit: "ms",
     label: "Consumer P99",
-    detail: "0.357 ms average",
+    detail: `${ms(LATENCY_MS.consumer.avg)} ms average`,
   },
 ];
 
diff --git a/src/lib/benchmark.ts b/src/lib/benchmark.ts
new file mode 100644
index 000000000..a85489f05
--- /dev/null
+++ b/src/lib/benchmark.ts
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// The published latency figures, in milliseconds. Everything on the homepage
+// that quotes a latency reads from here: the hero in (home)/page.tsx and the
+// table, chart and stat tiles in components/benchmark-chart.tsx.
+//
+// This lives outside the chart component because that component is a client
+// component, and a server component cannot read a value through the client
+// boundary - it gets a client reference rather than the data.
+//
+// Update these when a new benchmark run is published.
+export const LATENCY_MS = {
+  producer: { avg: 0.466, median: 0.349, p95: 0.886, p99: 0.976, p999: 1.114 },
+  consumer: { avg: 0.357, median: 0.351, p95: 0.446, p99: 0.495, p999: 0.566 },
+};

Reply via email to