From 969f66bfe670e8b3599a841e3da1fd0d2c32e8f6 Mon Sep 17 00:00:00 2001 From: Jordan Schulz Date: Sat, 20 May 2023 14:40:00 -0500 Subject: [PATCH] Add alert if site has a low cache hit ratio --- inc/pantheon-metrics.php | 79 ++++++++++++++++++++++++++++++++++++++++ pantheon.php | 31 +++++++++------- 2 files changed, 96 insertions(+), 14 deletions(-) create mode 100644 inc/pantheon-metrics.php diff --git a/inc/pantheon-metrics.php b/inc/pantheon-metrics.php new file mode 100644 index 0000000..dbfd98e --- /dev/null +++ b/inc/pantheon-metrics.php @@ -0,0 +1,79 @@ + 50 || $cache_hit_ratio === false) { + return false; + } + $screen = get_current_screen(); + if ( 'dashboard' === $screen->id || 'site-health' === $screen->id ) { + ?> +
+

+ Metrics tab in your Pantheon dashboard.', 'pantheon-systems' ), $cache_hit_ratio, 'https://dashboard.pantheon.io/sites/' . $_ENV['PANTHEON_SITE'] . '#live/metrics' ) ); + ?> +

+
+