summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ot_http.c1
-rw-r--r--ot_stats.c6
-rw-r--r--ot_workqueue.h1
-rw-r--r--tests/integration/test_stats.py16
4 files changed, 11 insertions, 13 deletions
diff --git a/ot_http.c b/ot_http.c
index 980e256..b243ff6 100644
--- a/ot_http.c
+++ b/ot_http.c
@@ -289,7 +289,6 @@ static ssize_t http_handle_stats(const int64_t sock, struct ot_workstruct *ws, c
289 {"top10", TASK_STATS_TOP10}, 289 {"top10", TASK_STATS_TOP10},
290 {"renew", TASK_STATS_RENEW}, 290 {"renew", TASK_STATS_RENEW},
291 {"syncs", TASK_STATS_SYNCS}, 291 {"syncs", TASK_STATS_SYNCS},
292 {"version", TASK_STATS_VERSION},
293 {"everything", TASK_STATS_EVERYTHING}, 292 {"everything", TASK_STATS_EVERYTHING},
294 {"statedump", TASK_FULLSCRAPE_TRACKERSTATE}, 293 {"statedump", TASK_FULLSCRAPE_TRACKERSTATE},
295 {"woodpeckers", TASK_STATS_WOODPECKERS}, 294 {"woodpeckers", TASK_STATS_WOODPECKERS},
diff --git a/ot_stats.c b/ot_stats.c
index 59a9f04..8771f0c 100644
--- a/ot_stats.c
+++ b/ot_stats.c
@@ -514,9 +514,6 @@ static void stats_return_everything(char **reply, const char *reply_end) {
514 fmt_append(reply, reply_end, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); 514 fmt_append(reply, reply_end, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
515 fmt_append(reply, reply_end, "<stats>\n"); 515 fmt_append(reply, reply_end, "<stats>\n");
516 fmt_append(reply, reply_end, " <tracker_id>%" PRIu32 "</tracker_id>\n", g_tracker_id); 516 fmt_append(reply, reply_end, " <tracker_id>%" PRIu32 "</tracker_id>\n", g_tracker_id);
517 fmt_append(reply, reply_end, " <version>\n");
518 stats_return_tracker_version(reply, reply_end);
519 fmt_append(reply, reply_end, " </version>\n");
520 fmt_append(reply, reply_end, " <uptime>%llu</uptime>\n", (unsigned long long)(time(NULL) - ot_start_time)); 517 fmt_append(reply, reply_end, " <uptime>%llu</uptime>\n", (unsigned long long)(time(NULL) - ot_start_time));
521 fmt_append(reply, reply_end, " <torrents>\n"); 518 fmt_append(reply, reply_end, " <torrents>\n");
522 fmt_append(reply, reply_end, " <count_mutex>%zd</count_mutex>\n", mutex_get_torrent_count()); 519 fmt_append(reply, reply_end, " <count_mutex>%zd</count_mutex>\n", mutex_get_torrent_count());
@@ -666,9 +663,6 @@ void return_stats_for_tracker(char **reply, const char *reply_end, int mode, int
666 case TASK_STATS_HTTPERRORS: 663 case TASK_STATS_HTTPERRORS:
667 stats_httperrors_txt(reply, reply_end); 664 stats_httperrors_txt(reply, reply_end);
668 break; 665 break;
669 case TASK_STATS_VERSION:
670 stats_return_tracker_version(reply, reply_end);
671 break;
672 case TASK_STATS_RENEW: 666 case TASK_STATS_RENEW:
673 stats_return_renew_bucket(reply, reply_end); 667 stats_return_renew_bucket(reply, reply_end);
674 break; 668 break;
diff --git a/ot_workqueue.h b/ot_workqueue.h
index 8fa80d0..4acd6fd 100644
--- a/ot_workqueue.h
+++ b/ot_workqueue.h
@@ -23,7 +23,6 @@ typedef enum {
23 TASK_STATS_FULLSCRAPE = 0x0005, 23 TASK_STATS_FULLSCRAPE = 0x0005,
24 TASK_STATS_TPB = 0x0006, 24 TASK_STATS_TPB = 0x0006,
25 TASK_STATS_HTTPERRORS = 0x0007, 25 TASK_STATS_HTTPERRORS = 0x0007,
26 TASK_STATS_VERSION = 0x0008,
27 TASK_STATS_RENEW = 0x000a, 26 TASK_STATS_RENEW = 0x000a,
28 TASK_STATS_SYNCS = 0x000b, 27 TASK_STATS_SYNCS = 0x000b,
29 TASK_STATS_COMPLETED = 0x000c, 28 TASK_STATS_COMPLETED = 0x000c,
diff --git a/tests/integration/test_stats.py b/tests/integration/test_stats.py
index 7b778d3..74f6d47 100644
--- a/tests/integration/test_stats.py
+++ b/tests/integration/test_stats.py
@@ -18,7 +18,7 @@ from harness import TrackerTestCase
18# and belong to test_fullscrape; "woodpeckers" sits behind a 18# and belong to test_fullscrape; "woodpeckers" sits behind a
19# feature flag this build does not set. 19# feature flag this build does not set.
20MRTG_MODES = ["peer", "conn", "scrp", "udp4", "tcp4", "torr", "fscr", "completed", "syncs"] 20MRTG_MODES = ["peer", "conn", "scrp", "udp4", "tcp4", "torr", "fscr", "completed", "syncs"]
21TEXT_MODES = ["herr", "s24s", "top10", "top100", "renew", "version"] 21TEXT_MODES = ["herr", "s24s", "top10", "top100", "renew"]
22 22
23 23
24class StatsShape(TrackerTestCase): 24class StatsShape(TrackerTestCase):
@@ -55,10 +55,16 @@ class StatsShape(TrackerTestCase):
55 self.assertIsNotNone(root.find("torrents/count_mutex")) 55 self.assertIsNotNone(root.find("torrents/count_mutex"))
56 self.assertIsNotNone(root.find("connections/tcp/announce")) 56 self.assertIsNotNone(root.find("connections/tcp/announce"))
57 57
58 def test_version_names_the_release(self): 58 def test_the_version_mode_is_gone(self):
59 # A build from a checkout appends what git describe said, a build from 59 """Which build a tracker is and what went into it is of use to whoever
60 # a tarball has nothing to append, so the commit is optional here. 60 attacks it and to nobody else on the far end of a socket. It is
61 self.assertRegex(self.tracker.stats("version"), rb"^opentracker \d+\.\d+\.\d+( \(\S+\))?\n$") 61 reported by -v, to whoever already has the binary."""
62 with self.assertRaises(urllib.error.HTTPError) as caught:
63 self.tracker.stats("version")
64 self.assertEqual(caught.exception.code, 400, "an unknown mode, like any other")
65
66 def test_everything_does_not_name_the_build(self):
67 self.assertNotIn(b"opentracker 1", self.tracker.stats("everything"))
62 68
63 69
64class StatsCount(TrackerTestCase): 70class StatsCount(TrackerTestCase):