From c4918311a26ea11bb7933de332ef322ccdd25721 Mon Sep 17 00:00:00 2001 From: Brian Collet <50160870+BrianCollet@users.noreply.github.com> Date: Fri, 13 Jun 2025 15:56:37 -0700 Subject: [PATCH 1/3] Added ValueWithDiff property which returns the current value with the difference % --- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/README.md b/README.md index 9f3d4e0..88c259a 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,47 @@ Headers: x-umami-api-key: ``` +Example output: + +``` +{ + "startAt": 1749279600000, + "endAt": 1749884399999, + "apiStats": { + "pageViews": { + "value": 16, + "prev": 24, + "diff": "-33%", + "valueWithDiff": "16(-33%)" + }, + "visitors": { + "value": 11, + "prev": 23, + "diff": "-52%", + "valueWithDiff": "11(-52%)" + }, + "visits": { + "value": 14, + "prev": 24, + "diff": "-41%", + "valueWithDiff": "14(-41%)" + }, + "bounces": { + "value": 12, + "prev": 24, + "diff": "-50%", + "valueWithDiff": "12(-50%)" + }, + "totalTime": { + "value": 62, + "prev": 0, + "diff": "0%", + "valueWithDiff": "62(0%)" + } + } +} +``` + Supported ranges include: - `today` From a84d0fae2545576613dc73bf0376f5ab43dfe40c Mon Sep 17 00:00:00 2001 From: Brian Collet <50160870+BrianCollet@users.noreply.github.com> Date: Fri, 13 Jun 2025 16:01:31 -0700 Subject: [PATCH 2/3] Increased container image version number --- Api/Api.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Api/Api.csproj b/Api/Api.csproj index 9556f5c..a0cb17f 100644 --- a/Api/Api.csproj +++ b/Api/Api.csproj @@ -4,7 +4,7 @@ net9.0 enable enable - 1.0.0 + 1.0.1 BrianCollet/umami-cloud-api-wrapper From ac56ed3934e2982ef6fa525343afaa2279fd3d46 Mon Sep 17 00:00:00 2001 From: Brian Collet <50160870+BrianCollet@users.noreply.github.com> Date: Fri, 13 Jun 2025 16:04:41 -0700 Subject: [PATCH 3/3] Added ValueWithDiff property which returns the current value with the difference % --- Api/Models/Metric.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Api/Models/Metric.cs b/Api/Models/Metric.cs index 341954b..3fc0a2a 100644 --- a/Api/Models/Metric.cs +++ b/Api/Models/Metric.cs @@ -5,6 +5,7 @@ public class Metric public int Value { get; set; } public int Prev { get; set; } public string Diff { get; set; } + public string ValueWithDiff { get; set; } public Metric(int value = 0, int prev = 0) { @@ -19,5 +20,7 @@ public Metric(int value = 0, int prev = 0) } Diff = change > 0.0 ? ($"+{(int)change}%") : ($"{(int)change}%"); + + ValueWithDiff = $"{value}({Diff})"; } } \ No newline at end of file