resolve errors
This commit is contained in:
1 parent
fcd9e78367
commit
7771a0ce35
3 files changed
+21
-16
No files matched your search
@@ -55,9 +55,9 @@ export const HeatmapResponseTimeTooltip = ({
|
||||
<Typography>
|
||||
{formatDateWithTz(check?.createdAt, "ddd, MMMM D, YYYY, HH:mm A", uiTimezone)}
|
||||
</Typography>
|
||||
{check?.originalResponseTime && (
|
||||
{check?.responseTime && (
|
||||
<Typography>
|
||||
{t("common.labels.responseTime")}: {check.originalResponseTime.toFixed()} ms
|
||||
{t("common.labels.responseTime")}: {check.responseTime.toFixed()} ms
|
||||
</Typography>
|
||||
)}
|
||||
|
||||
|
||||
@@ -2,31 +2,23 @@ import Box from "@mui/material/Box";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
import { HeatmapResponseTime, HistogramResponseTime } from "@/Components/v2/common";
|
||||
import type { Check } from "@/Types/Check";
|
||||
import type { CheckSnapshot } from "@/Types/Check";
|
||||
|
||||
interface DummyChartProps {
|
||||
chartType: string;
|
||||
}
|
||||
|
||||
const generateDummyChecks = (): Check[] => {
|
||||
const checks: Check[] = [];
|
||||
const generateDummyChecks = (): CheckSnapshot[] => {
|
||||
const checks: CheckSnapshot[] = [];
|
||||
for (let i = 0; i < 25; i++) {
|
||||
const isUp = Math.random() > 0.1;
|
||||
checks.push({
|
||||
id: `dummy-${i}`,
|
||||
metadata: {
|
||||
monitorId: "dummy-monitor",
|
||||
teamId: "dummy-team",
|
||||
type: "http",
|
||||
},
|
||||
status: isUp,
|
||||
statusCode: isUp ? 200 : 500,
|
||||
responseTime: Math.floor(Math.random() * 80) + 20,
|
||||
message: "",
|
||||
ack: false,
|
||||
expiry: new Date(Date.now() + 86400000).toISOString(),
|
||||
createdAt: new Date(Date.now() - i * 60000).toISOString(),
|
||||
updatedAt: new Date(Date.now() - i * 60000).toISOString(),
|
||||
});
|
||||
}
|
||||
return checks;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export interface CheckMetadata {
|
||||
monitorId: string;
|
||||
teamId: string;
|
||||
type: string;
|
||||
type: "http" | "ping" | "pagespeed" | "hardware" | "docker" | "port" | "game" | "unknown";
|
||||
}
|
||||
|
||||
export interface CheckCpuInfo {
|
||||
@@ -83,6 +83,7 @@ export interface CheckTimings {
|
||||
lookup?: number;
|
||||
connect?: number;
|
||||
secureConnect?: number;
|
||||
upload?: number;
|
||||
response?: number;
|
||||
end?: number;
|
||||
abort?: number;
|
||||
@@ -103,7 +104,6 @@ export interface Check {
|
||||
id: string;
|
||||
metadata: CheckMetadata;
|
||||
status: boolean;
|
||||
originalResponseTime?: number;
|
||||
responseTime: number;
|
||||
timings?: CheckTimings;
|
||||
statusCode: number;
|
||||
@@ -123,6 +123,7 @@ export interface Check {
|
||||
seo?: number;
|
||||
performance?: number;
|
||||
audits?: CheckAudits;
|
||||
__v: number;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
@@ -145,4 +146,16 @@ export interface ChecksResponse {
|
||||
checksCount: number;
|
||||
}
|
||||
|
||||
export type CheckSnapshot = Omit<Check, "metadata" | "ack" | "ackAt" | "expiry" | "updatedAt">;
|
||||
export type CheckSnapshot = Omit<Check, "metadata" | "ack" | "ackAt" | "expiry" | "__v" | "updatedAt">;
|
||||
|
||||
export interface HasResponseTime {
|
||||
responseTime: number;
|
||||
}
|
||||
|
||||
export type NormalizedCheck<T extends HasResponseTime = Check> = T & {
|
||||
originalResponseTime: number;
|
||||
};
|
||||
|
||||
export type NormalizedUptimeCheck<T extends GroupedCheck = GroupedCheck> = T & {
|
||||
originalAvgResponseTime: number;
|
||||
};
|
||||
Reference in new issue
Block a user