diff --git a/README.md b/README.md index 6ca8808..c4763b5 100644 --- a/README.md +++ b/README.md @@ -21,16 +21,23 @@ Free to use and extend ### Built With -- Platform - - [Docker](https://www.docker.com/) - - [Kubernetes](https://kubernetes.io/) +Platform -- Frontend - - [Svelte](https://svelte.dev) + - [Docker](https://www.docker.com/) + - [Kubernetes](https://kubernetes.io/) -- Backend - - [FastAPI](https://fastapi.tiangolo.com/) - - [Prometheus](https://prometheus.io) +Frontend + + + - [Svelte](https://svelte.dev) + +Backend + + - [FastAPI](https://fastapi.tiangolo.com/) + +Storage + + - [Prometheus](https://prometheus.io)

(back to top)

@@ -92,7 +99,7 @@ Then run backend API: ``` cd backend -docker build . local/pagetron:backend +docker build . -t local/pagetron:backend docker run --rm -ti --network host local/pagetron:backend ``` diff --git a/backend/lib/db_interface.py b/backend/lib/db_interface.py index a9f52c4..daf8a5c 100644 --- a/backend/lib/db_interface.py +++ b/backend/lib/db_interface.py @@ -70,27 +70,13 @@ def list_components(self) -> List[str]: def get_component(self, name: str, view="quarter") -> dict: VIEW_PRESETS = { - "day": ViewPreset( - depth=24, + "hours": ViewPreset( + depth=6, unit="h", - step="15m", + step="5m", metric="pagetron:availability:1m", precision="time", ), - "week": ViewPreset( - depth=7, - unit="d", - step="3h", - metric="pagetron:availability:1h", - precision="datetime", - ), - "month": ViewPreset( - depth=30, - unit="d", - step="12h", - metric="pagetron:availability:1d", - precision="datetime", - ), "quarter": ViewPreset( depth=90, unit="d", diff --git a/deploy/prometheus/prometheus.configmap.yaml b/deploy/prometheus/prometheus.configmap.yaml index 250b39b..5aa8d7a 100644 --- a/deploy/prometheus/prometheus.configmap.yaml +++ b/deploy/prometheus/prometheus.configmap.yaml @@ -69,11 +69,11 @@ data: rules: - record: pagetron:availability:1h expr: |- - min_over_time(pagetron:availability:1m[60m:1m]) + avg_over_time(pagetron:availability:1m[60m:1m]) - name: pagetron_day interval: 30m rules: - record: pagetron:availability:1d expr: |- - min_over_time(pagetron:availability:1h[24h:30m]) + avg_over_time(pagetron:availability:1h[24h:30m]) diff --git a/frontend/src/lib/Component.svelte b/frontend/src/lib/Component.svelte index 538c893..1dedb96 100644 --- a/frontend/src/lib/Component.svelte +++ b/frontend/src/lib/Component.svelte @@ -45,24 +45,16 @@ let timelineStart = ''; switch (view) { - case 'day': - timelineStart = '24 hours'; - tickCapacitySeconds = 60 * 15; - break; - case 'week': - timelineStart = '7 days'; - tickCapacitySeconds = 60 * 60 * 3; - break; - case 'month': - timelineStart = '30 days'; - tickCapacitySeconds = 60 * 60 * 12; + case 'hours': + timelineStart = '6 hours'; + tickCapacitySeconds = 60 * 5; break; case 'quarter': timelineStart = '90 days'; tickCapacitySeconds = 60 * 60 * 24; break; case 'year': - timelineStart = '1 year'; + timelineStart = 'year'; tickCapacitySeconds = 60 * 60 * 24 * 7; break; } @@ -79,13 +71,7 @@

- - {urlSplit(name)[0]}{urlSplit( - name - )[1]} + {name}

diff --git a/frontend/src/lib/Header.svelte b/frontend/src/lib/Header.svelte index b32f21e..7e072ec 100644 --- a/frontend/src/lib/Header.svelte +++ b/frontend/src/lib/Header.svelte @@ -1,4 +1,6 @@ @@ -62,6 +76,6 @@ } div.tick.has-minor-issue { - border-top: 2px solid #ffe08a; + border-top: 5px solid #ffe08a; } diff --git a/frontend/src/lib/ViewSelector.svelte b/frontend/src/lib/ViewSelector.svelte index 899e0a7..4802442 100644 --- a/frontend/src/lib/ViewSelector.svelte +++ b/frontend/src/lib/ViewSelector.svelte @@ -1,57 +1,49 @@ -
- + diff --git a/frontend/src/lib/stores.js b/frontend/src/lib/stores.js index b7321ec..2ca9a9d 100644 --- a/frontend/src/lib/stores.js +++ b/frontend/src/lib/stores.js @@ -1,3 +1,3 @@ import { writable } from 'svelte/store'; -export const viewStore = writable('day'); +export const viewStore = writable('quarter'); diff --git a/frontend/src/routes/+page.svelte b/frontend/src/routes/+page.svelte index 3c83bf7..2885256 100644 --- a/frontend/src/routes/+page.svelte +++ b/frontend/src/routes/+page.svelte @@ -3,7 +3,6 @@ import Header from '$lib/Header.svelte'; import Overview from '$lib/Overview.svelte'; - import ViewSelector from '$lib/ViewSelector.svelte'; import ComponentsList from '$lib/ComponentsList.svelte'; import Footer from '$lib/Footer.svelte'; import Dummy from '$lib/Dummy.svelte'; @@ -39,7 +38,6 @@ componentsIssues={data.overview.components_issues} datetimeHuman={data.overview.datetime_human} /> - {:catch error}