add robots evicted metric

This commit is contained in:
Muki Kiboigo committed 2026-09-17 23:03:19 -07:00
1 parent 7e4f1dedc1
commit 5f04c699d5
2 files changed
+3

No files matched your search

+2
View File
@@ -92,6 +92,7 @@ http_navigation_delay_ms: Histogram(&.{
}) = .{},
robots_status: CounterEnum("category", @import("network/http.zig").StatusCategory) = .{},
robots_access: CounterEnum("result", enum { allow, deny }) = .{},
robots_evictions: Counter = .{},
cors_check: CounterEnum("result", enum { same_origin, no_cors, simple, preflight }) = .{},
cors_preflight: CounterEnum("result", enum { allowed, blocked }) = .{},
cors_response: CounterEnum("result", enum { allowed, blocked }) = .{},
@@ -130,6 +131,7 @@ const help = .{
.http_navigation_delay_ms = "Time in milliseconds a throttled top-level navigation waited",
.robots_status = "robots.txt response status",
.robots_access = "robots.txt result",
.robots_evictions = "robots.txt cache entries evicted to stay within limit",
.cors_check = "CORS initial classification: same_origin/no_cors need no CORS handling, simple needs response validation only, preflight needs an OPTIONS round-trip first",
.cors_preflight = "CORS preflight (OPTIONS) results, one per request that required one",
.cors_response = "CORS actual-response validation results",
+1
View File
@@ -233,6 +233,7 @@ pub const RobotStore = struct {
if (try self.evictions.insert(gop.key_ptr.*)) |evict_key| {
if (self.map.fetchRemove(evict_key)) |kv| {
lp.metrics.robots_evictions.incr();
self.allocator.free(kv.key);
var entry = kv.value;
self.freeEntry(&entry);