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)
@@ -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 @@