From fcea542a92010430a12f141532c7249b1f6b4b80 Mon Sep 17 00:00:00 2001 From: Robert Beekman Date: Fri, 16 Aug 2024 10:28:08 +0200 Subject: [PATCH] Fix `NaN` uptime percentage This commit fixes an issue if there's no data for a region, it results in a `NaN` uptime percentage * Return `0` when no regions with timeseries are present. --- components/Outages/Outages.js | 6 + components/UptimeMonitor/UptimeMonitor.js | 8 + .../UptimeMonitor/UptimeMonitor.test.js | 11 +- mocks/handlers.js | 2 + mocks/monitors/only-one-metric.json | 1022 +++++++++++++++++ mocks/status_pages/appsignal.json | 8 + 6 files changed, 1056 insertions(+), 1 deletion(-) create mode 100644 mocks/monitors/only-one-metric.json diff --git a/components/Outages/Outages.js b/components/Outages/Outages.js index 7114f49..6d679eb 100644 --- a/components/Outages/Outages.js +++ b/components/Outages/Outages.js @@ -1,3 +1,4 @@ +import PropTypes from "prop-types"; import OutagesByDay from "../OutagesByDay"; import { timeseriesByDay } from "../../utils"; @@ -23,4 +24,9 @@ const Outages = ({ timeseries, regions }) => { } }; +Outages.propTypes = { + timeseries: PropTypes.array.isRequired, + regions: PropTypes.array.isRequired, +}; + export default Outages; diff --git a/components/UptimeMonitor/UptimeMonitor.js b/components/UptimeMonitor/UptimeMonitor.js index fa0a78e..41e68d2 100644 --- a/components/UptimeMonitor/UptimeMonitor.js +++ b/components/UptimeMonitor/UptimeMonitor.js @@ -41,6 +41,10 @@ export const calculateUptime = (timeseries, regions) => { const downtimePerRegion = []; regions.map((region) => { + if (timeSeriesLast30Days.length == 0) { + return 0; + } + const downtimeInMinutes = timeSeriesLast30Days.reduce((acc, item) => { return acc + item.values[region]; }, 0); @@ -63,6 +67,10 @@ export const calculateUptime = (timeseries, regions) => { }; export const averageDowntimeOverRegions = (downtimePerRegion) => { + if (Object.keys(downtimePerRegion).length == 0) { + return 0; + } + const average = Object.values(downtimePerRegion).reduce((acc, item) => { return (acc += item.percentage); diff --git a/components/UptimeMonitor/UptimeMonitor.test.js b/components/UptimeMonitor/UptimeMonitor.test.js index 124e1fd..45686aa 100644 --- a/components/UptimeMonitor/UptimeMonitor.test.js +++ b/components/UptimeMonitor/UptimeMonitor.test.js @@ -1,6 +1,9 @@ import { render, screen, waitFor } from "@testing-library/react"; -import UptimeMonitor, { UptimeMonitorLoading } from "./UptimeMonitor"; +import UptimeMonitor, { + UptimeMonitorLoading, + averageDowntimeOverRegions, +} from "./UptimeMonitor"; import statusPageMock from "../../mocks/status_pages/appsignal.json"; const build = (props = {}) => { @@ -67,4 +70,10 @@ describe("UptimeMonitorLoading", () => { const loadingDots = screen.getAllByTestId("loadingDot"); expect(loadingDots.length).toEqual(30); }); + + describe("averageDowntimeOverRegions", () => { + test("returns 0 if no regions are present", () => { + expect(averageDowntimeOverRegions([])).toEqual(0); + }); + }); }); diff --git a/mocks/handlers.js b/mocks/handlers.js index cf94fa0..c2f0731 100644 --- a/mocks/handlers.js +++ b/mocks/handlers.js @@ -3,11 +3,13 @@ import { rest } from "msw"; const alwaysDown = require("./monitors/always-down.json"); const blog = require("./monitors/blog.json"); const homepage = require("./monitors/homepage.json"); +const onlyOneMetric = require("./monitors/only-one-metric.json"); const monitorMapping = { "always-down": alwaysDown, blog, homepage, + "only-one-metric": onlyOneMetric, }; export const handlers = [ diff --git a/mocks/monitors/only-one-metric.json b/mocks/monitors/only-one-metric.json new file mode 100644 index 0000000..6b40874 --- /dev/null +++ b/mocks/monitors/only-one-metric.json @@ -0,0 +1,1022 @@ +{ + "id": "only-one-metric", + "title": "only one metrics", + "url": "https://appsignal.com", + "description": "", + "timeseries": [ + { + "timestamp": "2024-08-07T07:00:00.000Z" + }, + { + "timestamp": "2024-08-09T08:00:00.000Z" + }, + { + "timestamp": "2024-08-03T17:00:00.000Z" + }, + { + "timestamp": "2024-08-03T15:00:00.000Z" + }, + { + "timestamp": "2024-08-06T06:00:00.000Z" + }, + { + "timestamp": "2024-08-06T20:00:00.000Z" + }, + { + "timestamp": "2024-08-06T07:00:00.000Z" + }, + { + "timestamp": "2024-08-09T00:00:00.000Z" + }, + { + "timestamp": "2024-08-12T23:00:00.000Z" + }, + { + "timestamp": "2024-08-10T19:00:00.000Z" + }, + { + "timestamp": "2024-08-13T05:00:00.000Z" + }, + { + "timestamp": "2024-08-06T13:00:00.000Z" + }, + { + "timestamp": "2024-08-14T03:00:00.000Z" + }, + { + "timestamp": "2024-08-16T07:00:00.000Z", + "values": { + "asia-pacific": 0 + } + }, + { + "timestamp": "2024-08-13T20:00:00.000Z" + }, + { + "timestamp": "2024-08-11T01:00:00.000Z" + }, + { + "timestamp": "2024-08-08T15:00:00.000Z" + }, + { + "timestamp": "2024-08-10T16:00:00.000Z" + }, + { + "timestamp": "2024-08-04T00:00:00.000Z" + }, + { + "timestamp": "2024-08-14T12:00:00.000Z" + }, + { + "timestamp": "2024-08-15T18:00:00.000Z" + }, + { + "timestamp": "2024-08-05T06:00:00.000Z" + }, + { + "timestamp": "2024-08-15T02:00:00.000Z" + }, + { + "timestamp": "2024-08-04T03:00:00.000Z" + }, + { + "timestamp": "2024-08-03T02:00:00.000Z" + }, + { + "timestamp": "2024-08-05T16:00:00.000Z" + }, + { + "timestamp": "2024-08-06T00:00:00.000Z" + }, + { + "timestamp": "2024-08-08T21:00:00.000Z" + }, + { + "timestamp": "2024-08-13T10:00:00.000Z" + }, + { + "timestamp": "2024-08-12T21:00:00.000Z" + }, + { + "timestamp": "2024-08-07T09:00:00.000Z" + }, + { + "timestamp": "2024-08-12T10:00:00.000Z" + }, + { + "timestamp": "2024-08-14T06:00:00.000Z" + }, + { + "timestamp": "2024-08-15T10:00:00.000Z" + }, + { + "timestamp": "2024-08-02T10:00:00.000Z" + }, + { + "timestamp": "2024-08-07T16:00:00.000Z" + }, + { + "timestamp": "2024-08-15T22:00:00.000Z" + }, + { + "timestamp": "2024-08-12T07:00:00.000Z" + }, + { + "timestamp": "2024-08-03T06:00:00.000Z" + }, + { + "timestamp": "2024-08-08T20:00:00.000Z" + }, + { + "timestamp": "2024-08-13T16:00:00.000Z" + }, + { + "timestamp": "2024-08-05T11:00:00.000Z" + }, + { + "timestamp": "2024-08-07T18:00:00.000Z" + }, + { + "timestamp": "2024-08-08T06:00:00.000Z" + }, + { + "timestamp": "2024-08-04T16:00:00.000Z" + }, + { + "timestamp": "2024-08-02T12:00:00.000Z" + }, + { + "timestamp": "2024-08-03T23:00:00.000Z" + }, + { + "timestamp": "2024-08-09T22:00:00.000Z" + }, + { + "timestamp": "2024-08-10T12:00:00.000Z" + }, + { + "timestamp": "2024-08-11T11:00:00.000Z" + }, + { + "timestamp": "2024-08-07T01:00:00.000Z" + }, + { + "timestamp": "2024-08-04T10:00:00.000Z" + }, + { + "timestamp": "2024-08-07T22:00:00.000Z" + }, + { + "timestamp": "2024-08-12T18:00:00.000Z" + }, + { + "timestamp": "2024-08-08T01:00:00.000Z" + }, + { + "timestamp": "2024-08-05T04:00:00.000Z" + }, + { + "timestamp": "2024-08-13T03:00:00.000Z" + }, + { + "timestamp": "2024-08-13T18:00:00.000Z" + }, + { + "timestamp": "2024-08-13T21:00:00.000Z" + }, + { + "timestamp": "2024-08-02T09:00:00.000Z" + }, + { + "timestamp": "2024-08-10T08:00:00.000Z" + }, + { + "timestamp": "2024-08-14T07:00:00.000Z" + }, + { + "timestamp": "2024-08-10T17:00:00.000Z" + }, + { + "timestamp": "2024-08-09T18:00:00.000Z" + }, + { + "timestamp": "2024-08-11T16:00:00.000Z" + }, + { + "timestamp": "2024-08-14T18:00:00.000Z" + }, + { + "timestamp": "2024-08-15T03:00:00.000Z" + }, + { + "timestamp": "2024-08-15T01:00:00.000Z" + }, + { + "timestamp": "2024-08-04T06:00:00.000Z" + }, + { + "timestamp": "2024-08-02T14:00:00.000Z" + }, + { + "timestamp": "2024-08-08T02:00:00.000Z" + }, + { + "timestamp": "2024-08-06T16:00:00.000Z" + }, + { + "timestamp": "2024-08-15T05:00:00.000Z" + }, + { + "timestamp": "2024-08-07T04:00:00.000Z" + }, + { + "timestamp": "2024-08-05T09:00:00.000Z" + }, + { + "timestamp": "2024-08-10T23:00:00.000Z" + }, + { + "timestamp": "2024-08-07T20:00:00.000Z" + }, + { + "timestamp": "2024-08-07T13:00:00.000Z" + }, + { + "timestamp": "2024-08-09T01:00:00.000Z" + }, + { + "timestamp": "2024-08-10T03:00:00.000Z" + }, + { + "timestamp": "2024-08-12T04:00:00.000Z" + }, + { + "timestamp": "2024-08-08T14:00:00.000Z" + }, + { + "timestamp": "2024-08-07T17:00:00.000Z" + }, + { + "timestamp": "2024-08-10T21:00:00.000Z" + }, + { + "timestamp": "2024-08-14T17:00:00.000Z" + }, + { + "timestamp": "2024-08-08T18:00:00.000Z" + }, + { + "timestamp": "2024-08-12T20:00:00.000Z" + }, + { + "timestamp": "2024-08-12T16:00:00.000Z" + }, + { + "timestamp": "2024-08-13T09:00:00.000Z" + }, + { + "timestamp": "2024-08-10T02:00:00.000Z" + }, + { + "timestamp": "2024-08-02T16:00:00.000Z" + }, + { + "timestamp": "2024-08-02T22:00:00.000Z" + }, + { + "timestamp": "2024-08-03T18:00:00.000Z" + }, + { + "timestamp": "2024-08-05T20:00:00.000Z" + }, + { + "timestamp": "2024-08-12T00:00:00.000Z" + }, + { + "timestamp": "2024-08-05T21:00:00.000Z" + }, + { + "timestamp": "2024-08-06T04:00:00.000Z" + }, + { + "timestamp": "2024-08-10T09:00:00.000Z" + }, + { + "timestamp": "2024-08-13T22:00:00.000Z" + }, + { + "timestamp": "2024-08-03T14:00:00.000Z" + }, + { + "timestamp": "2024-08-12T22:00:00.000Z" + }, + { + "timestamp": "2024-08-08T08:00:00.000Z" + }, + { + "timestamp": "2024-08-05T08:00:00.000Z" + }, + { + "timestamp": "2024-08-15T00:00:00.000Z" + }, + { + "timestamp": "2024-08-06T10:00:00.000Z" + }, + { + "timestamp": "2024-08-09T23:00:00.000Z" + }, + { + "timestamp": "2024-08-12T09:00:00.000Z" + }, + { + "timestamp": "2024-08-16T02:00:00.000Z" + }, + { + "timestamp": "2024-08-11T07:00:00.000Z" + }, + { + "timestamp": "2024-08-05T03:00:00.000Z" + }, + { + "timestamp": "2024-08-10T10:00:00.000Z" + }, + { + "timestamp": "2024-08-10T18:00:00.000Z" + }, + { + "timestamp": "2024-08-06T18:00:00.000Z" + }, + { + "timestamp": "2024-08-09T02:00:00.000Z" + }, + { + "timestamp": "2024-08-13T04:00:00.000Z" + }, + { + "timestamp": "2024-08-04T13:00:00.000Z" + }, + { + "timestamp": "2024-08-08T22:00:00.000Z" + }, + { + "timestamp": "2024-08-02T18:00:00.000Z" + }, + { + "timestamp": "2024-08-09T04:00:00.000Z" + }, + { + "timestamp": "2024-08-03T09:00:00.000Z" + }, + { + "timestamp": "2024-08-10T14:00:00.000Z" + }, + { + "timestamp": "2024-08-14T09:00:00.000Z" + }, + { + "timestamp": "2024-08-16T05:00:00.000Z", + "values": { + "asia-pacific": 0 + } + }, + { + "timestamp": "2024-08-16T06:00:00.000Z", + "values": { + "asia-pacific": 0 + } + }, + { + "timestamp": "2024-08-04T20:00:00.000Z" + }, + { + "timestamp": "2024-08-03T08:00:00.000Z" + }, + { + "timestamp": "2024-08-05T00:00:00.000Z" + }, + { + "timestamp": "2024-08-10T07:00:00.000Z" + }, + { + "timestamp": "2024-08-05T23:00:00.000Z" + }, + { + "timestamp": "2024-08-11T08:00:00.000Z" + }, + { + "timestamp": "2024-08-14T15:00:00.000Z" + }, + { + "timestamp": "2024-08-11T13:00:00.000Z" + }, + { + "timestamp": "2024-08-12T14:00:00.000Z" + }, + { + "timestamp": "2024-08-02T15:00:00.000Z" + }, + { + "timestamp": "2024-08-07T10:00:00.000Z" + }, + { + "timestamp": "2024-08-07T00:00:00.000Z" + }, + { + "timestamp": "2024-08-09T19:00:00.000Z" + }, + { + "timestamp": "2024-08-14T00:00:00.000Z" + }, + { + "timestamp": "2024-08-05T10:00:00.000Z" + }, + { + "timestamp": "2024-08-08T16:00:00.000Z" + }, + { + "timestamp": "2024-08-03T12:00:00.000Z" + }, + { + "timestamp": "2024-08-06T21:00:00.000Z" + }, + { + "timestamp": "2024-08-16T01:00:00.000Z" + }, + { + "timestamp": "2024-08-04T23:00:00.000Z" + }, + { + "timestamp": "2024-08-09T06:00:00.000Z" + }, + { + "timestamp": "2024-08-07T19:00:00.000Z" + }, + { + "timestamp": "2024-08-10T22:00:00.000Z" + }, + { + "timestamp": "2024-08-15T08:00:00.000Z" + }, + { + "timestamp": "2024-08-15T09:00:00.000Z" + }, + { + "timestamp": "2024-08-13T13:00:00.000Z" + }, + { + "timestamp": "2024-08-15T23:00:00.000Z" + }, + { + "timestamp": "2024-08-02T19:00:00.000Z" + }, + { + "timestamp": "2024-08-15T13:00:00.000Z" + }, + { + "timestamp": "2024-08-11T22:00:00.000Z" + }, + { + "timestamp": "2024-08-09T10:00:00.000Z" + }, + { + "timestamp": "2024-08-13T23:00:00.000Z" + }, + { + "timestamp": "2024-08-06T02:00:00.000Z" + }, + { + "timestamp": "2024-08-14T05:00:00.000Z" + }, + { + "timestamp": "2024-08-14T13:00:00.000Z" + }, + { + "timestamp": "2024-08-15T17:00:00.000Z" + }, + { + "timestamp": "2024-08-05T18:00:00.000Z" + }, + { + "timestamp": "2024-08-03T07:00:00.000Z" + }, + { + "timestamp": "2024-08-11T17:00:00.000Z" + }, + { + "timestamp": "2024-08-15T04:00:00.000Z" + }, + { + "timestamp": "2024-08-15T15:00:00.000Z" + }, + { + "timestamp": "2024-08-06T09:00:00.000Z" + }, + { + "timestamp": "2024-08-09T03:00:00.000Z" + }, + { + "timestamp": "2024-08-10T04:00:00.000Z" + }, + { + "timestamp": "2024-08-11T19:00:00.000Z" + }, + { + "timestamp": "2024-08-03T11:00:00.000Z" + }, + { + "timestamp": "2024-08-11T18:00:00.000Z" + }, + { + "timestamp": "2024-08-13T17:00:00.000Z" + }, + { + "timestamp": "2024-08-03T13:00:00.000Z" + }, + { + "timestamp": "2024-08-05T07:00:00.000Z" + }, + { + "timestamp": "2024-08-12T19:00:00.000Z" + }, + { + "timestamp": "2024-08-11T06:00:00.000Z" + }, + { + "timestamp": "2024-08-14T14:00:00.000Z" + }, + { + "timestamp": "2024-08-09T12:00:00.000Z" + }, + { + "timestamp": "2024-08-05T05:00:00.000Z" + }, + { + "timestamp": "2024-08-07T15:00:00.000Z" + }, + { + "timestamp": "2024-08-04T07:00:00.000Z" + }, + { + "timestamp": "2024-08-06T22:00:00.000Z" + }, + { + "timestamp": "2024-08-11T20:00:00.000Z" + }, + { + "timestamp": "2024-08-14T04:00:00.000Z" + }, + { + "timestamp": "2024-08-13T19:00:00.000Z" + }, + { + "timestamp": "2024-08-14T01:00:00.000Z" + }, + { + "timestamp": "2024-08-07T03:00:00.000Z" + }, + { + "timestamp": "2024-08-12T02:00:00.000Z" + }, + { + "timestamp": "2024-08-06T03:00:00.000Z" + }, + { + "timestamp": "2024-08-07T12:00:00.000Z" + }, + { + "timestamp": "2024-08-14T08:00:00.000Z" + }, + { + "timestamp": "2024-08-08T12:00:00.000Z" + }, + { + "timestamp": "2024-08-08T17:00:00.000Z" + }, + { + "timestamp": "2024-08-06T05:00:00.000Z" + }, + { + "timestamp": "2024-08-02T17:00:00.000Z" + }, + { + "timestamp": "2024-08-15T06:00:00.000Z" + }, + { + "timestamp": "2024-08-02T13:00:00.000Z" + }, + { + "timestamp": "2024-08-03T10:00:00.000Z" + }, + { + "timestamp": "2024-08-04T05:00:00.000Z" + }, + { + "timestamp": "2024-08-04T17:00:00.000Z" + }, + { + "timestamp": "2024-08-09T07:00:00.000Z" + }, + { + "timestamp": "2024-08-05T19:00:00.000Z" + }, + { + "timestamp": "2024-08-15T19:00:00.000Z" + }, + { + "timestamp": "2024-08-03T05:00:00.000Z" + }, + { + "timestamp": "2024-08-15T11:00:00.000Z" + }, + { + "timestamp": "2024-08-09T05:00:00.000Z" + }, + { + "timestamp": "2024-08-08T23:00:00.000Z" + }, + { + "timestamp": "2024-08-09T13:00:00.000Z" + }, + { + "timestamp": "2024-08-04T02:00:00.000Z" + }, + { + "timestamp": "2024-08-12T17:00:00.000Z" + }, + { + "timestamp": "2024-08-09T20:00:00.000Z" + }, + { + "timestamp": "2024-08-13T12:00:00.000Z" + }, + { + "timestamp": "2024-08-04T01:00:00.000Z" + }, + { + "timestamp": "2024-08-03T04:00:00.000Z" + }, + { + "timestamp": "2024-08-09T09:00:00.000Z" + }, + { + "timestamp": "2024-08-04T04:00:00.000Z" + }, + { + "timestamp": "2024-08-05T17:00:00.000Z" + }, + { + "timestamp": "2024-08-04T15:00:00.000Z" + }, + { + "timestamp": "2024-08-11T00:00:00.000Z" + }, + { + "timestamp": "2024-08-04T14:00:00.000Z" + }, + { + "timestamp": "2024-08-08T07:00:00.000Z" + }, + { + "timestamp": "2024-08-05T02:00:00.000Z" + }, + { + "timestamp": "2024-08-14T16:00:00.000Z" + }, + { + "timestamp": "2024-08-05T12:00:00.000Z" + }, + { + "timestamp": "2024-08-03T21:00:00.000Z" + }, + { + "timestamp": "2024-08-11T12:00:00.000Z" + }, + { + "timestamp": "2024-08-16T04:00:00.000Z" + }, + { + "timestamp": "2024-08-04T21:00:00.000Z" + }, + { + "timestamp": "2024-08-10T05:00:00.000Z" + }, + { + "timestamp": "2024-08-16T00:00:00.000Z" + }, + { + "timestamp": "2024-08-08T19:00:00.000Z" + }, + { + "timestamp": "2024-08-04T22:00:00.000Z" + }, + { + "timestamp": "2024-08-04T11:00:00.000Z" + }, + { + "timestamp": "2024-08-14T22:00:00.000Z" + }, + { + "timestamp": "2024-08-05T14:00:00.000Z" + }, + { + "timestamp": "2024-08-14T10:00:00.000Z" + }, + { + "timestamp": "2024-08-10T06:00:00.000Z" + }, + { + "timestamp": "2024-08-15T20:00:00.000Z" + }, + { + "timestamp": "2024-08-16T03:00:00.000Z" + }, + { + "timestamp": "2024-08-06T08:00:00.000Z" + }, + { + "timestamp": "2024-08-15T14:00:00.000Z" + }, + { + "timestamp": "2024-08-07T05:00:00.000Z" + }, + { + "timestamp": "2024-08-03T16:00:00.000Z" + }, + { + "timestamp": "2024-08-08T04:00:00.000Z" + }, + { + "timestamp": "2024-08-02T21:00:00.000Z" + }, + { + "timestamp": "2024-08-10T01:00:00.000Z" + }, + { + "timestamp": "2024-08-10T11:00:00.000Z" + }, + { + "timestamp": "2024-08-12T15:00:00.000Z" + }, + { + "timestamp": "2024-08-08T11:00:00.000Z" + }, + { + "timestamp": "2024-08-07T02:00:00.000Z" + }, + { + "timestamp": "2024-08-09T16:00:00.000Z" + }, + { + "timestamp": "2024-08-06T23:00:00.000Z" + }, + { + "timestamp": "2024-08-10T00:00:00.000Z" + }, + { + "timestamp": "2024-08-12T01:00:00.000Z" + }, + { + "timestamp": "2024-08-06T01:00:00.000Z" + }, + { + "timestamp": "2024-08-06T15:00:00.000Z" + }, + { + "timestamp": "2024-08-05T22:00:00.000Z" + }, + { + "timestamp": "2024-08-08T00:00:00.000Z" + }, + { + "timestamp": "2024-08-11T23:00:00.000Z" + }, + { + "timestamp": "2024-08-03T19:00:00.000Z" + }, + { + "timestamp": "2024-08-07T06:00:00.000Z" + }, + { + "timestamp": "2024-08-03T03:00:00.000Z" + }, + { + "timestamp": "2024-08-13T00:00:00.000Z" + }, + { + "timestamp": "2024-08-13T06:00:00.000Z" + }, + { + "timestamp": "2024-08-13T08:00:00.000Z" + }, + { + "timestamp": "2024-08-09T21:00:00.000Z" + }, + { + "timestamp": "2024-08-11T09:00:00.000Z" + }, + { + "timestamp": "2024-08-14T21:00:00.000Z" + }, + { + "timestamp": "2024-08-11T14:00:00.000Z" + }, + { + "timestamp": "2024-08-03T01:00:00.000Z" + }, + { + "timestamp": "2024-08-12T11:00:00.000Z" + }, + { + "timestamp": "2024-08-08T05:00:00.000Z" + }, + { + "timestamp": "2024-08-07T08:00:00.000Z" + }, + { + "timestamp": "2024-08-09T17:00:00.000Z" + }, + { + "timestamp": "2024-08-02T20:00:00.000Z" + }, + { + "timestamp": "2024-08-14T11:00:00.000Z" + }, + { + "timestamp": "2024-08-02T11:00:00.000Z" + }, + { + "timestamp": "2024-08-11T03:00:00.000Z" + }, + { + "timestamp": "2024-08-02T23:00:00.000Z" + }, + { + "timestamp": "2024-08-07T11:00:00.000Z" + }, + { + "timestamp": "2024-08-15T07:00:00.000Z" + }, + { + "timestamp": "2024-08-05T13:00:00.000Z" + }, + { + "timestamp": "2024-08-04T19:00:00.000Z" + }, + { + "timestamp": "2024-08-12T08:00:00.000Z" + }, + { + "timestamp": "2024-08-06T19:00:00.000Z" + }, + { + "timestamp": "2024-08-09T11:00:00.000Z" + }, + { + "timestamp": "2024-08-06T11:00:00.000Z" + }, + { + "timestamp": "2024-08-03T22:00:00.000Z" + }, + { + "timestamp": "2024-08-04T18:00:00.000Z" + }, + { + "timestamp": "2024-08-05T01:00:00.000Z" + }, + { + "timestamp": "2024-08-13T02:00:00.000Z" + }, + { + "timestamp": "2024-08-14T20:00:00.000Z" + }, + { + "timestamp": "2024-08-15T21:00:00.000Z" + }, + { + "timestamp": "2024-08-13T07:00:00.000Z" + }, + { + "timestamp": "2024-08-04T08:00:00.000Z" + }, + { + "timestamp": "2024-08-05T15:00:00.000Z" + }, + { + "timestamp": "2024-08-09T15:00:00.000Z" + }, + { + "timestamp": "2024-08-06T12:00:00.000Z" + }, + { + "timestamp": "2024-08-07T21:00:00.000Z" + }, + { + "timestamp": "2024-08-08T13:00:00.000Z" + }, + { + "timestamp": "2024-08-08T03:00:00.000Z" + }, + { + "timestamp": "2024-08-04T12:00:00.000Z" + }, + { + "timestamp": "2024-08-12T13:00:00.000Z" + }, + { + "timestamp": "2024-08-03T00:00:00.000Z" + }, + { + "timestamp": "2024-08-10T15:00:00.000Z" + }, + { + "timestamp": "2024-08-11T02:00:00.000Z" + }, + { + "timestamp": "2024-08-11T05:00:00.000Z" + }, + { + "timestamp": "2024-08-08T10:00:00.000Z" + }, + { + "timestamp": "2024-08-12T03:00:00.000Z" + }, + { + "timestamp": "2024-08-13T11:00:00.000Z" + }, + { + "timestamp": "2024-08-15T16:00:00.000Z" + }, + { + "timestamp": "2024-08-10T13:00:00.000Z" + }, + { + "timestamp": "2024-08-04T09:00:00.000Z" + }, + { + "timestamp": "2024-08-12T05:00:00.000Z" + }, + { + "timestamp": "2024-08-13T01:00:00.000Z" + }, + { + "timestamp": "2024-08-11T10:00:00.000Z" + }, + { + "timestamp": "2024-08-13T14:00:00.000Z" + }, + { + "timestamp": "2024-08-14T02:00:00.000Z" + }, + { + "timestamp": "2024-08-15T12:00:00.000Z" + }, + { + "timestamp": "2024-08-07T14:00:00.000Z" + }, + { + "timestamp": "2024-08-08T09:00:00.000Z" + }, + { + "timestamp": "2024-08-10T20:00:00.000Z" + }, + { + "timestamp": "2024-08-12T06:00:00.000Z" + }, + { + "timestamp": "2024-08-06T14:00:00.000Z" + }, + { + "timestamp": "2024-08-07T23:00:00.000Z" + }, + { + "timestamp": "2024-08-13T15:00:00.000Z" + }, + { + "timestamp": "2024-08-14T23:00:00.000Z" + }, + { + "timestamp": "2024-08-03T20:00:00.000Z" + }, + { + "timestamp": "2024-08-11T04:00:00.000Z" + }, + { + "timestamp": "2024-08-06T17:00:00.000Z" + }, + { + "timestamp": "2024-08-09T14:00:00.000Z" + }, + { + "timestamp": "2024-08-11T21:00:00.000Z" + }, + { + "timestamp": "2024-08-14T19:00:00.000Z" + }, + { + "timestamp": "2024-08-12T12:00:00.000Z" + }, + { + "timestamp": "2024-08-11T15:00:00.000Z" + } + ] +} diff --git a/mocks/status_pages/appsignal.json b/mocks/status_pages/appsignal.json index 0c85ef6..12feea9 100644 --- a/mocks/status_pages/appsignal.json +++ b/mocks/status_pages/appsignal.json @@ -45,6 +45,14 @@ "description": "This endpoint will always be down!", "regions": ["europe", "south-america", "north-america", "asia-pacific"], "endpoint": "https://api.appsignal-status.online/status_pages/1/monitors/always-down.json" + }, + { + "id": "only-one-metric", + "title": "only one metric", + "url": "https://appsignal.com", + "description": "Only one metric", + "regions": ["asia-pacific"], + "endpoint": "https://api.appsignal-status.online/status_pages/1/monitors/only-one-metric.json" } ] }