mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-10-09 04:42:30 -04:00
add robots evicted metric
This commit is contained in:
2 files changed
+3
No files matched your search
@@ -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",
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user