mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 00:27:31 +00:00
docs: init benchmarks (#8894)
# Which Problems Are Solved Adds initial benchmarks. # How the Problems Are Solved Added section `apis/benchmarks` # Additional Changes Update Makefile dependencies # Additional Context - Part of https://github.com/zitadel/zitadel/issues/8023 - Part of https://github.com/zitadel/zitadel/issues/8352
This commit is contained in:
45
docs/src/components/benchmark_chart.jsx
Normal file
45
docs/src/components/benchmark_chart.jsx
Normal file
@@ -0,0 +1,45 @@
|
||||
import React from "react";
|
||||
import Chart from "react-google-charts";
|
||||
|
||||
export function BenchmarkChart(testResults=[], height='500px') {
|
||||
|
||||
const options = {
|
||||
legend: { position: 'bottom' },
|
||||
focusTarget: 'category',
|
||||
hAxis: {
|
||||
title: 'timestamp',
|
||||
},
|
||||
vAxis: {
|
||||
title: 'latency (ms)',
|
||||
},
|
||||
};
|
||||
|
||||
const data = [
|
||||
[
|
||||
{type:"datetime", label: "timestamp"},
|
||||
{type:"number", label: "p50"},
|
||||
{type:"number", label: "p95"},
|
||||
{type:"number", label: "p99"},
|
||||
],
|
||||
]
|
||||
|
||||
JSON.parse(testResults.testResults).forEach((result) => {
|
||||
data.push([
|
||||
new Date(result.timestamp),
|
||||
result.p50,
|
||||
result.p95,
|
||||
result.p99,
|
||||
])
|
||||
});
|
||||
|
||||
return (
|
||||
<Chart
|
||||
chartType="LineChart"
|
||||
width="100%"
|
||||
height="500px"
|
||||
options={options}
|
||||
data={data}
|
||||
legendToggle
|
||||
/>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user