@@ -3,8 +3,10 @@ const m = @import("metrics");
3
3
var metrics = m .initializeNoop (Metrics );
4
4
5
5
const Metrics = struct {
6
- searches : m .Counter (u32 ),
7
- updates : m .Counter (u32 ),
6
+ searches : m .Counter (u64 ),
7
+ updates : m .Counter (u64 ),
8
+ memory_segment_merges : m .Counter (u64 ),
9
+ file_segment_merges : m .Counter (u64 ),
8
10
};
9
11
10
12
pub fn search () void {
@@ -15,10 +17,20 @@ pub fn update(count: usize) void {
15
17
metrics .updates .incrBy (@intCast (count ));
16
18
}
17
19
20
+ pub fn memorySegmentMerge () void {
21
+ metrics .memory_segment_merges .incr ();
22
+ }
23
+
24
+ pub fn fileSegmentMerge () void {
25
+ metrics .file_segment_merges .incr ();
26
+ }
27
+
18
28
pub fn initializeMetrics (comptime opts : m.RegistryOpts ) ! void {
19
29
metrics = .{
20
- .searches = m .Counter (u32 ).init ("searches_total" , .{}, opts ),
21
- .updates = m .Counter (u32 ).init ("updates_total" , .{}, opts ),
30
+ .searches = m .Counter (u64 ).init ("searches_total" , .{}, opts ),
31
+ .updates = m .Counter (u64 ).init ("updates_total" , .{}, opts ),
32
+ .memory_segment_merges = m .Counter (u64 ).init ("memory_segment_merges_total" , .{}, opts ),
33
+ .file_segment_merges = m .Counter (u64 ).init ("file_segment_merges_total" , .{}, opts ),
22
34
};
23
35
}
24
36
0 commit comments