From 44c7ae2d2b0cab7508af02da8c8fc23d8def8351 Mon Sep 17 00:00:00 2001
From: godog <godog@autistici.org>
Date: Sun, 20 Sep 2020 13:06:41 +0200
Subject: [PATCH] patches: remove unused r2 stats

---
 patches/0173-add-xcache-stats-reporting.patch | 72 -------------------
 1 file changed, 72 deletions(-)
 delete mode 100644 patches/0173-add-xcache-stats-reporting.patch

diff --git a/patches/0173-add-xcache-stats-reporting.patch b/patches/0173-add-xcache-stats-reporting.patch
deleted file mode 100644
index 21361a84..00000000
--- a/patches/0173-add-xcache-stats-reporting.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-From d99e454adeb9ad3b3f6d6868b2036a2ed00a8a7c Mon Sep 17 00:00:00 2001
-From: godog <godog@autistici.org>
-Date: Wed, 25 Dec 2013 14:57:40 +0000
-Subject: [PATCH 173/229] add xcache stats reporting
-
----
- xcache_stats_r2mon.php | 53 ++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 53 insertions(+)
- create mode 100644 xcache_stats_r2mon.php
-
-diff --git a/xcache_stats_r2mon.php b/xcache_stats_r2mon.php
-new file mode 100644
-index 00000000..7e250a15
---- /dev/null
-+++ b/xcache_stats_r2mon.php
-@@ -0,0 +1,53 @@
-+<?php
-+
-+$EXPORTED_STATS = array(
-+  "compiling", "disabled", "misses", "hits", "clogs",
-+  "ooms", "errors", "cached", "deleted", "size", "avail"
-+);
-+
-+if (!extension_loaded('XCache')) {
-+  trigger_error("xcache not loaded", E_USER_ERROR);
-+  header("HTTP/1.1 500 Internal Server Error");
-+}
-+
-+function xcache_type_stats($type) {
-+  global $EXPORTED_STATS;
-+
-+  $total = array();
-+  $type_stats = array();
-+
-+  for ($i = 0; $i < xcache_count($type); $i++) {
-+    $type_stats[] = xcache_info($type, $i);
-+  }
-+
-+  foreach($type_stats as $unused => $type_stat) {
-+    foreach($type_stat as $k => $v) {
-+      if(!in_array($k, $EXPORTED_STATS)) {
-+        continue;
-+      }
-+
-+      if(!isset($total[$k])) {
-+        $total[$k] = 0;
-+      }
-+      $total[$k] += $v;
-+    }
-+  }
-+  return $total;
-+}
-+
-+$code_cache_stats = xcache_type_stats(XC_TYPE_PHP);
-+$var_cache_stats = xcache_type_stats(XC_TYPE_VAR);
-+
-+/*
-+print var_dump($code_cache_stats);
-+print var_dump($var_cache_stats);
-+*/
-+
-+foreach($code_cache_stats as $k => $v) {
-+  print "xcache.stat{type=code,what=$k}: $v\n";
-+}
-+foreach($var_cache_stats as $k => $v) {
-+  print "xcache.stat{type=var,what=$k}: $v\n";
-+}
-+print "xcache.pid: " . getmypid();
-+?>
--- 
-2.17.1
-
-- 
GitLab