master
go 5,656 lines 168 KB
Raw
1 // Code generated by metricgen; DO NOT EDIT.
2 // source: contexts.yaml
3
4 package contexts
5
6 import (
7 module "github.com/netdata/netdata/go/plugins/plugin/framework/collectorapi"
8 "github.com/netdata/netdata/go/plugins/plugin/ibm.d/framework"
9 "strings"
10 )
11
12 // cleanLabelValue cleans a label value for use in instance/dimension IDs
13 func cleanLabelValue(value string) string {
14 // Replace problematic characters
15 r := strings.NewReplacer(
16 " ", "_",
17 ".", "_",
18 "-", "_",
19 "/", "_",
20 ":", "_",
21 "=", "_",
22 ",", "_",
23 "(", "_",
24 ")", "_",
25 )
26 return strings.ToLower(r.Replace(value))
27 }
28
29 // EmptyLabels is used for contexts without labels
30 type EmptyLabels struct{}
31
32 // InstanceID for empty labels just returns the context name
33 func (EmptyLabels) InstanceID(contextName string) string {
34 return contextName
35 }
36
37 // --- Bufferpool ---
38
39 // BufferpoolHitRatioValues defines the type-safe values for Bufferpool.HitRatio context
40 type BufferpoolHitRatioValues struct {
41 Overall int64
42 }
43
44 // BufferpoolHitRatioContext provides type-safe operations for Bufferpool.HitRatio context
45 type BufferpoolHitRatioContext struct {
46 framework.Context[BufferpoolLabels]
47 }
48
49 // Set provides type-safe dimension setting for Bufferpool.HitRatio context
50 func (c BufferpoolHitRatioContext) Set(state *framework.CollectorState, labels BufferpoolLabels, values BufferpoolHitRatioValues) {
51 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
52 "overall": values.Overall,
53 })
54 }
55
56 // SetUpdateEvery sets the update interval for this instance
57 func (c BufferpoolHitRatioContext) SetUpdateEvery(state *framework.CollectorState, labels BufferpoolLabels, updateEvery int) {
58 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
59 }
60
61 // BufferpoolDetailedHitRatioValues defines the type-safe values for Bufferpool.DetailedHitRatio context
62 type BufferpoolDetailedHitRatioValues struct {
63 Data int64
64 Index int64
65 Xda int64
66 Column int64
67 }
68
69 // BufferpoolDetailedHitRatioContext provides type-safe operations for Bufferpool.DetailedHitRatio context
70 type BufferpoolDetailedHitRatioContext struct {
71 framework.Context[BufferpoolLabels]
72 }
73
74 // Set provides type-safe dimension setting for Bufferpool.DetailedHitRatio context
75 func (c BufferpoolDetailedHitRatioContext) Set(state *framework.CollectorState, labels BufferpoolLabels, values BufferpoolDetailedHitRatioValues) {
76 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
77 "data": values.Data,
78 "index": values.Index,
79 "xda": values.Xda,
80 "column": values.Column,
81 })
82 }
83
84 // SetUpdateEvery sets the update interval for this instance
85 func (c BufferpoolDetailedHitRatioContext) SetUpdateEvery(state *framework.CollectorState, labels BufferpoolLabels, updateEvery int) {
86 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
87 }
88
89 // BufferpoolReadsValues defines the type-safe values for Bufferpool.Reads context
90 type BufferpoolReadsValues struct {
91 Logical int64
92 Physical int64
93 }
94
95 // BufferpoolReadsContext provides type-safe operations for Bufferpool.Reads context
96 type BufferpoolReadsContext struct {
97 framework.Context[BufferpoolLabels]
98 }
99
100 // Set provides type-safe dimension setting for Bufferpool.Reads context
101 func (c BufferpoolReadsContext) Set(state *framework.CollectorState, labels BufferpoolLabels, values BufferpoolReadsValues) {
102 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
103 "logical": values.Logical,
104 "physical": values.Physical,
105 })
106 }
107
108 // SetUpdateEvery sets the update interval for this instance
109 func (c BufferpoolReadsContext) SetUpdateEvery(state *framework.CollectorState, labels BufferpoolLabels, updateEvery int) {
110 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
111 }
112
113 // BufferpoolDataReadsValues defines the type-safe values for Bufferpool.DataReads context
114 type BufferpoolDataReadsValues struct {
115 Logical int64
116 Physical int64
117 }
118
119 // BufferpoolDataReadsContext provides type-safe operations for Bufferpool.DataReads context
120 type BufferpoolDataReadsContext struct {
121 framework.Context[BufferpoolLabels]
122 }
123
124 // Set provides type-safe dimension setting for Bufferpool.DataReads context
125 func (c BufferpoolDataReadsContext) Set(state *framework.CollectorState, labels BufferpoolLabels, values BufferpoolDataReadsValues) {
126 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
127 "logical": values.Logical,
128 "physical": values.Physical,
129 })
130 }
131
132 // SetUpdateEvery sets the update interval for this instance
133 func (c BufferpoolDataReadsContext) SetUpdateEvery(state *framework.CollectorState, labels BufferpoolLabels, updateEvery int) {
134 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
135 }
136
137 // BufferpoolIndexReadsValues defines the type-safe values for Bufferpool.IndexReads context
138 type BufferpoolIndexReadsValues struct {
139 Logical int64
140 Physical int64
141 }
142
143 // BufferpoolIndexReadsContext provides type-safe operations for Bufferpool.IndexReads context
144 type BufferpoolIndexReadsContext struct {
145 framework.Context[BufferpoolLabels]
146 }
147
148 // Set provides type-safe dimension setting for Bufferpool.IndexReads context
149 func (c BufferpoolIndexReadsContext) Set(state *framework.CollectorState, labels BufferpoolLabels, values BufferpoolIndexReadsValues) {
150 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
151 "logical": values.Logical,
152 "physical": values.Physical,
153 })
154 }
155
156 // SetUpdateEvery sets the update interval for this instance
157 func (c BufferpoolIndexReadsContext) SetUpdateEvery(state *framework.CollectorState, labels BufferpoolLabels, updateEvery int) {
158 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
159 }
160
161 // BufferpoolPagesValues defines the type-safe values for Bufferpool.Pages context
162 type BufferpoolPagesValues struct {
163 Used int64
164 Total int64
165 }
166
167 // BufferpoolPagesContext provides type-safe operations for Bufferpool.Pages context
168 type BufferpoolPagesContext struct {
169 framework.Context[BufferpoolLabels]
170 }
171
172 // Set provides type-safe dimension setting for Bufferpool.Pages context
173 func (c BufferpoolPagesContext) Set(state *framework.CollectorState, labels BufferpoolLabels, values BufferpoolPagesValues) {
174 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
175 "used": values.Used,
176 "total": values.Total,
177 })
178 }
179
180 // SetUpdateEvery sets the update interval for this instance
181 func (c BufferpoolPagesContext) SetUpdateEvery(state *framework.CollectorState, labels BufferpoolLabels, updateEvery int) {
182 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
183 }
184
185 // BufferpoolWritesValues defines the type-safe values for Bufferpool.Writes context
186 type BufferpoolWritesValues struct {
187 Writes int64
188 }
189
190 // BufferpoolWritesContext provides type-safe operations for Bufferpool.Writes context
191 type BufferpoolWritesContext struct {
192 framework.Context[BufferpoolLabels]
193 }
194
195 // Set provides type-safe dimension setting for Bufferpool.Writes context
196 func (c BufferpoolWritesContext) Set(state *framework.CollectorState, labels BufferpoolLabels, values BufferpoolWritesValues) {
197 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
198 "writes": values.Writes,
199 })
200 }
201
202 // SetUpdateEvery sets the update interval for this instance
203 func (c BufferpoolWritesContext) SetUpdateEvery(state *framework.CollectorState, labels BufferpoolLabels, updateEvery int) {
204 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
205 }
206
207 // BufferpoolLabels defines the required labels for Bufferpool contexts
208 type BufferpoolLabels struct {
209 Bufferpool string
210 Page_size string
211 }
212
213 // InstanceID generates a unique instance ID using the hardcoded label order from YAML
214 func (l BufferpoolLabels) InstanceID(contextName string) string {
215 // Label order from YAML: bufferpool, page_size
216 return contextName + "." + cleanLabelValue(l.Bufferpool) + "_" + cleanLabelValue(l.Page_size)
217 }
218
219 // Bufferpool contains all metric contexts for Bufferpool
220 var Bufferpool = struct {
221 HitRatio BufferpoolHitRatioContext
222 DetailedHitRatio BufferpoolDetailedHitRatioContext
223 Reads BufferpoolReadsContext
224 DataReads BufferpoolDataReadsContext
225 IndexReads BufferpoolIndexReadsContext
226 Pages BufferpoolPagesContext
227 Writes BufferpoolWritesContext
228 }{
229 HitRatio: BufferpoolHitRatioContext{
230 Context: framework.Context[BufferpoolLabels]{
231 Name: "db2.bufferpool_instance_hit_ratio",
232 Family: "bufferpools/instances",
233 Title: "Buffer Pool Hit Ratio",
234 Units: "percentage",
235 Type: module.Line,
236 Priority: 1110,
237 UpdateEvery: 1,
238 Dimensions: []framework.Dimension{
239 {
240 Name: "overall",
241 Algorithm: module.Absolute,
242 Mul: 1,
243 Div: 1000,
244 Precision: 1000,
245 },
246 },
247 LabelKeys: []string{
248 "bufferpool",
249 "page_size",
250 },
251 },
252 },
253 DetailedHitRatio: BufferpoolDetailedHitRatioContext{
254 Context: framework.Context[BufferpoolLabels]{
255 Name: "db2.bufferpool_instance_detailed_hit_ratio",
256 Family: "bufferpools/instances",
257 Title: "Buffer Pool Detailed Hit Ratios",
258 Units: "percentage",
259 Type: module.Line,
260 Priority: 1111,
261 UpdateEvery: 1,
262 Dimensions: []framework.Dimension{
263 {
264 Name: "data",
265 Algorithm: module.Absolute,
266 Mul: 1,
267 Div: 1000,
268 Precision: 1000,
269 },
270 {
271 Name: "index",
272 Algorithm: module.Absolute,
273 Mul: 1,
274 Div: 1000,
275 Precision: 1000,
276 },
277 {
278 Name: "xda",
279 Algorithm: module.Absolute,
280 Mul: 1,
281 Div: 1000,
282 Precision: 1000,
283 },
284 {
285 Name: "column",
286 Algorithm: module.Absolute,
287 Mul: 1,
288 Div: 1000,
289 Precision: 1000,
290 },
291 },
292 LabelKeys: []string{
293 "bufferpool",
294 "page_size",
295 },
296 },
297 },
298 Reads: BufferpoolReadsContext{
299 Context: framework.Context[BufferpoolLabels]{
300 Name: "db2.bufferpool_instance_reads",
301 Family: "bufferpools/instances",
302 Title: "Buffer Pool Reads",
303 Units: "reads/s",
304 Type: module.Stacked,
305 Priority: 1112,
306 UpdateEvery: 1,
307 Dimensions: []framework.Dimension{
308 {
309 Name: "logical",
310 Algorithm: module.Incremental,
311 Mul: 1,
312 Div: 1,
313 Precision: 1,
314 },
315 {
316 Name: "physical",
317 Algorithm: module.Incremental,
318 Mul: 1,
319 Div: 1,
320 Precision: 1,
321 },
322 },
323 LabelKeys: []string{
324 "bufferpool",
325 "page_size",
326 },
327 },
328 },
329 DataReads: BufferpoolDataReadsContext{
330 Context: framework.Context[BufferpoolLabels]{
331 Name: "db2.bufferpool_instance_data_reads",
332 Family: "bufferpools/instances",
333 Title: "Buffer Pool Data Page Reads",
334 Units: "reads/s",
335 Type: module.Stacked,
336 Priority: 1113,
337 UpdateEvery: 1,
338 Dimensions: []framework.Dimension{
339 {
340 Name: "logical",
341 Algorithm: module.Incremental,
342 Mul: 1,
343 Div: 1,
344 Precision: 1,
345 },
346 {
347 Name: "physical",
348 Algorithm: module.Incremental,
349 Mul: 1,
350 Div: 1,
351 Precision: 1,
352 },
353 },
354 LabelKeys: []string{
355 "bufferpool",
356 "page_size",
357 },
358 },
359 },
360 IndexReads: BufferpoolIndexReadsContext{
361 Context: framework.Context[BufferpoolLabels]{
362 Name: "db2.bufferpool_instance_index_reads",
363 Family: "bufferpools/instances",
364 Title: "Buffer Pool Index Page Reads",
365 Units: "reads/s",
366 Type: module.Stacked,
367 Priority: 1114,
368 UpdateEvery: 1,
369 Dimensions: []framework.Dimension{
370 {
371 Name: "logical",
372 Algorithm: module.Incremental,
373 Mul: 1,
374 Div: 1,
375 Precision: 1,
376 },
377 {
378 Name: "physical",
379 Algorithm: module.Incremental,
380 Mul: 1,
381 Div: 1,
382 Precision: 1,
383 },
384 },
385 LabelKeys: []string{
386 "bufferpool",
387 "page_size",
388 },
389 },
390 },
391 Pages: BufferpoolPagesContext{
392 Context: framework.Context[BufferpoolLabels]{
393 Name: "db2.bufferpool_instance_pages",
394 Family: "bufferpools/instances",
395 Title: "Buffer Pool Pages",
396 Units: "pages",
397 Type: module.Stacked,
398 Priority: 1115,
399 UpdateEvery: 1,
400 Dimensions: []framework.Dimension{
401 {
402 Name: "used",
403 Algorithm: module.Absolute,
404 Mul: 1,
405 Div: 1,
406 Precision: 1,
407 },
408 {
409 Name: "total",
410 Algorithm: module.Absolute,
411 Mul: 1,
412 Div: 1,
413 Precision: 1,
414 },
415 },
416 LabelKeys: []string{
417 "bufferpool",
418 "page_size",
419 },
420 },
421 },
422 Writes: BufferpoolWritesContext{
423 Context: framework.Context[BufferpoolLabels]{
424 Name: "db2.bufferpool_instance_writes",
425 Family: "bufferpools/instances",
426 Title: "Buffer Pool Writes",
427 Units: "writes/s",
428 Type: module.Line,
429 Priority: 1116,
430 UpdateEvery: 1,
431 Dimensions: []framework.Dimension{
432 {
433 Name: "writes",
434 Algorithm: module.Incremental,
435 Mul: 1,
436 Div: 1,
437 Precision: 1,
438 },
439 },
440 LabelKeys: []string{
441 "bufferpool",
442 "page_size",
443 },
444 },
445 },
446 }
447
448 // --- BufferpoolGroup ---
449
450 // BufferpoolGroupHitRatioValues defines the type-safe values for BufferpoolGroup.HitRatio context
451 type BufferpoolGroupHitRatioValues struct {
452 Overall int64
453 }
454
455 // BufferpoolGroupHitRatioContext provides type-safe operations for BufferpoolGroup.HitRatio context
456 type BufferpoolGroupHitRatioContext struct {
457 framework.Context[BufferpoolGroupLabels]
458 }
459
460 // Set provides type-safe dimension setting for BufferpoolGroup.HitRatio context
461 func (c BufferpoolGroupHitRatioContext) Set(state *framework.CollectorState, labels BufferpoolGroupLabels, values BufferpoolGroupHitRatioValues) {
462 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
463 "overall": values.Overall,
464 })
465 }
466
467 // SetUpdateEvery sets the update interval for this instance
468 func (c BufferpoolGroupHitRatioContext) SetUpdateEvery(state *framework.CollectorState, labels BufferpoolGroupLabels, updateEvery int) {
469 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
470 }
471
472 // BufferpoolGroupDetailedHitRatioValues defines the type-safe values for BufferpoolGroup.DetailedHitRatio context
473 type BufferpoolGroupDetailedHitRatioValues struct {
474 Data int64
475 Index int64
476 Xda int64
477 Column int64
478 }
479
480 // BufferpoolGroupDetailedHitRatioContext provides type-safe operations for BufferpoolGroup.DetailedHitRatio context
481 type BufferpoolGroupDetailedHitRatioContext struct {
482 framework.Context[BufferpoolGroupLabels]
483 }
484
485 // Set provides type-safe dimension setting for BufferpoolGroup.DetailedHitRatio context
486 func (c BufferpoolGroupDetailedHitRatioContext) Set(state *framework.CollectorState, labels BufferpoolGroupLabels, values BufferpoolGroupDetailedHitRatioValues) {
487 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
488 "data": values.Data,
489 "index": values.Index,
490 "xda": values.Xda,
491 "column": values.Column,
492 })
493 }
494
495 // SetUpdateEvery sets the update interval for this instance
496 func (c BufferpoolGroupDetailedHitRatioContext) SetUpdateEvery(state *framework.CollectorState, labels BufferpoolGroupLabels, updateEvery int) {
497 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
498 }
499
500 // BufferpoolGroupReadsValues defines the type-safe values for BufferpoolGroup.Reads context
501 type BufferpoolGroupReadsValues struct {
502 Logical int64
503 Physical int64
504 }
505
506 // BufferpoolGroupReadsContext provides type-safe operations for BufferpoolGroup.Reads context
507 type BufferpoolGroupReadsContext struct {
508 framework.Context[BufferpoolGroupLabels]
509 }
510
511 // Set provides type-safe dimension setting for BufferpoolGroup.Reads context
512 func (c BufferpoolGroupReadsContext) Set(state *framework.CollectorState, labels BufferpoolGroupLabels, values BufferpoolGroupReadsValues) {
513 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
514 "logical": values.Logical,
515 "physical": values.Physical,
516 })
517 }
518
519 // SetUpdateEvery sets the update interval for this instance
520 func (c BufferpoolGroupReadsContext) SetUpdateEvery(state *framework.CollectorState, labels BufferpoolGroupLabels, updateEvery int) {
521 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
522 }
523
524 // BufferpoolGroupDataReadsValues defines the type-safe values for BufferpoolGroup.DataReads context
525 type BufferpoolGroupDataReadsValues struct {
526 Logical int64
527 Physical int64
528 }
529
530 // BufferpoolGroupDataReadsContext provides type-safe operations for BufferpoolGroup.DataReads context
531 type BufferpoolGroupDataReadsContext struct {
532 framework.Context[BufferpoolGroupLabels]
533 }
534
535 // Set provides type-safe dimension setting for BufferpoolGroup.DataReads context
536 func (c BufferpoolGroupDataReadsContext) Set(state *framework.CollectorState, labels BufferpoolGroupLabels, values BufferpoolGroupDataReadsValues) {
537 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
538 "logical": values.Logical,
539 "physical": values.Physical,
540 })
541 }
542
543 // SetUpdateEvery sets the update interval for this instance
544 func (c BufferpoolGroupDataReadsContext) SetUpdateEvery(state *framework.CollectorState, labels BufferpoolGroupLabels, updateEvery int) {
545 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
546 }
547
548 // BufferpoolGroupIndexReadsValues defines the type-safe values for BufferpoolGroup.IndexReads context
549 type BufferpoolGroupIndexReadsValues struct {
550 Logical int64
551 Physical int64
552 }
553
554 // BufferpoolGroupIndexReadsContext provides type-safe operations for BufferpoolGroup.IndexReads context
555 type BufferpoolGroupIndexReadsContext struct {
556 framework.Context[BufferpoolGroupLabels]
557 }
558
559 // Set provides type-safe dimension setting for BufferpoolGroup.IndexReads context
560 func (c BufferpoolGroupIndexReadsContext) Set(state *framework.CollectorState, labels BufferpoolGroupLabels, values BufferpoolGroupIndexReadsValues) {
561 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
562 "logical": values.Logical,
563 "physical": values.Physical,
564 })
565 }
566
567 // SetUpdateEvery sets the update interval for this instance
568 func (c BufferpoolGroupIndexReadsContext) SetUpdateEvery(state *framework.CollectorState, labels BufferpoolGroupLabels, updateEvery int) {
569 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
570 }
571
572 // BufferpoolGroupPagesValues defines the type-safe values for BufferpoolGroup.Pages context
573 type BufferpoolGroupPagesValues struct {
574 Used int64
575 Total int64
576 }
577
578 // BufferpoolGroupPagesContext provides type-safe operations for BufferpoolGroup.Pages context
579 type BufferpoolGroupPagesContext struct {
580 framework.Context[BufferpoolGroupLabels]
581 }
582
583 // Set provides type-safe dimension setting for BufferpoolGroup.Pages context
584 func (c BufferpoolGroupPagesContext) Set(state *framework.CollectorState, labels BufferpoolGroupLabels, values BufferpoolGroupPagesValues) {
585 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
586 "used": values.Used,
587 "total": values.Total,
588 })
589 }
590
591 // SetUpdateEvery sets the update interval for this instance
592 func (c BufferpoolGroupPagesContext) SetUpdateEvery(state *framework.CollectorState, labels BufferpoolGroupLabels, updateEvery int) {
593 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
594 }
595
596 // BufferpoolGroupWritesValues defines the type-safe values for BufferpoolGroup.Writes context
597 type BufferpoolGroupWritesValues struct {
598 Writes int64
599 }
600
601 // BufferpoolGroupWritesContext provides type-safe operations for BufferpoolGroup.Writes context
602 type BufferpoolGroupWritesContext struct {
603 framework.Context[BufferpoolGroupLabels]
604 }
605
606 // Set provides type-safe dimension setting for BufferpoolGroup.Writes context
607 func (c BufferpoolGroupWritesContext) Set(state *framework.CollectorState, labels BufferpoolGroupLabels, values BufferpoolGroupWritesValues) {
608 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
609 "writes": values.Writes,
610 })
611 }
612
613 // SetUpdateEvery sets the update interval for this instance
614 func (c BufferpoolGroupWritesContext) SetUpdateEvery(state *framework.CollectorState, labels BufferpoolGroupLabels, updateEvery int) {
615 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
616 }
617
618 // BufferpoolGroupLabels defines the required labels for BufferpoolGroup contexts
619 type BufferpoolGroupLabels struct {
620 Group string
621 }
622
623 // InstanceID generates a unique instance ID using the hardcoded label order from YAML
624 func (l BufferpoolGroupLabels) InstanceID(contextName string) string {
625 // Label order from YAML: group
626 return contextName + "." + cleanLabelValue(l.Group)
627 }
628
629 // BufferpoolGroup contains all metric contexts for BufferpoolGroup
630 var BufferpoolGroup = struct {
631 HitRatio BufferpoolGroupHitRatioContext
632 DetailedHitRatio BufferpoolGroupDetailedHitRatioContext
633 Reads BufferpoolGroupReadsContext
634 DataReads BufferpoolGroupDataReadsContext
635 IndexReads BufferpoolGroupIndexReadsContext
636 Pages BufferpoolGroupPagesContext
637 Writes BufferpoolGroupWritesContext
638 }{
639 HitRatio: BufferpoolGroupHitRatioContext{
640 Context: framework.Context[BufferpoolGroupLabels]{
641 Name: "db2.bufferpool_group_hit_ratio",
642 Family: "bufferpools/groups",
643 Title: "Buffer Pool Group Hit Ratio",
644 Units: "percentage",
645 Type: module.Line,
646 Priority: 1117,
647 UpdateEvery: 1,
648 Dimensions: []framework.Dimension{
649 {
650 Name: "overall",
651 Algorithm: module.Absolute,
652 Mul: 1,
653 Div: 1000,
654 Precision: 1000,
655 },
656 },
657 LabelKeys: []string{
658 "group",
659 },
660 },
661 },
662 DetailedHitRatio: BufferpoolGroupDetailedHitRatioContext{
663 Context: framework.Context[BufferpoolGroupLabels]{
664 Name: "db2.bufferpool_group_detailed_hit_ratio",
665 Family: "bufferpools/groups",
666 Title: "Buffer Pool Group Detailed Hit Ratios",
667 Units: "percentage",
668 Type: module.Line,
669 Priority: 1118,
670 UpdateEvery: 1,
671 Dimensions: []framework.Dimension{
672 {
673 Name: "data",
674 Algorithm: module.Absolute,
675 Mul: 1,
676 Div: 1000,
677 Precision: 1000,
678 },
679 {
680 Name: "index",
681 Algorithm: module.Absolute,
682 Mul: 1,
683 Div: 1000,
684 Precision: 1000,
685 },
686 {
687 Name: "xda",
688 Algorithm: module.Absolute,
689 Mul: 1,
690 Div: 1000,
691 Precision: 1000,
692 },
693 {
694 Name: "column",
695 Algorithm: module.Absolute,
696 Mul: 1,
697 Div: 1000,
698 Precision: 1000,
699 },
700 },
701 LabelKeys: []string{
702 "group",
703 },
704 },
705 },
706 Reads: BufferpoolGroupReadsContext{
707 Context: framework.Context[BufferpoolGroupLabels]{
708 Name: "db2.bufferpool_group_reads",
709 Family: "bufferpools/groups",
710 Title: "Buffer Pool Group Reads",
711 Units: "reads/s",
712 Type: module.Stacked,
713 Priority: 1119,
714 UpdateEvery: 1,
715 Dimensions: []framework.Dimension{
716 {
717 Name: "logical",
718 Algorithm: module.Incremental,
719 Mul: 1,
720 Div: 1,
721 Precision: 1,
722 },
723 {
724 Name: "physical",
725 Algorithm: module.Incremental,
726 Mul: 1,
727 Div: 1,
728 Precision: 1,
729 },
730 },
731 LabelKeys: []string{
732 "group",
733 },
734 },
735 },
736 DataReads: BufferpoolGroupDataReadsContext{
737 Context: framework.Context[BufferpoolGroupLabels]{
738 Name: "db2.bufferpool_group_data_reads",
739 Family: "bufferpools/groups",
740 Title: "Buffer Pool Group Data Reads",
741 Units: "reads/s",
742 Type: module.Stacked,
743 Priority: 1120,
744 UpdateEvery: 1,
745 Dimensions: []framework.Dimension{
746 {
747 Name: "logical",
748 Algorithm: module.Incremental,
749 Mul: 1,
750 Div: 1,
751 Precision: 1,
752 },
753 {
754 Name: "physical",
755 Algorithm: module.Incremental,
756 Mul: 1,
757 Div: 1,
758 Precision: 1,
759 },
760 },
761 LabelKeys: []string{
762 "group",
763 },
764 },
765 },
766 IndexReads: BufferpoolGroupIndexReadsContext{
767 Context: framework.Context[BufferpoolGroupLabels]{
768 Name: "db2.bufferpool_group_index_reads",
769 Family: "bufferpools/groups",
770 Title: "Buffer Pool Group Index Reads",
771 Units: "reads/s",
772 Type: module.Stacked,
773 Priority: 1121,
774 UpdateEvery: 1,
775 Dimensions: []framework.Dimension{
776 {
777 Name: "logical",
778 Algorithm: module.Incremental,
779 Mul: 1,
780 Div: 1,
781 Precision: 1,
782 },
783 {
784 Name: "physical",
785 Algorithm: module.Incremental,
786 Mul: 1,
787 Div: 1,
788 Precision: 1,
789 },
790 },
791 LabelKeys: []string{
792 "group",
793 },
794 },
795 },
796 Pages: BufferpoolGroupPagesContext{
797 Context: framework.Context[BufferpoolGroupLabels]{
798 Name: "db2.bufferpool_group_pages",
799 Family: "bufferpools/groups",
800 Title: "Buffer Pool Group Pages",
801 Units: "pages",
802 Type: module.Stacked,
803 Priority: 1122,
804 UpdateEvery: 1,
805 Dimensions: []framework.Dimension{
806 {
807 Name: "used",
808 Algorithm: module.Absolute,
809 Mul: 1,
810 Div: 1,
811 Precision: 1,
812 },
813 {
814 Name: "total",
815 Algorithm: module.Absolute,
816 Mul: 1,
817 Div: 1,
818 Precision: 1,
819 },
820 },
821 LabelKeys: []string{
822 "group",
823 },
824 },
825 },
826 Writes: BufferpoolGroupWritesContext{
827 Context: framework.Context[BufferpoolGroupLabels]{
828 Name: "db2.bufferpool_group_writes",
829 Family: "bufferpools/groups",
830 Title: "Buffer Pool Group Writes",
831 Units: "writes/s",
832 Type: module.Line,
833 Priority: 1123,
834 UpdateEvery: 1,
835 Dimensions: []framework.Dimension{
836 {
837 Name: "writes",
838 Algorithm: module.Incremental,
839 Mul: 1,
840 Div: 1,
841 Precision: 1,
842 },
843 },
844 LabelKeys: []string{
845 "group",
846 },
847 },
848 },
849 }
850
851 // --- Connection ---
852
853 // ConnectionStateValues defines the type-safe values for Connection.State context
854 type ConnectionStateValues struct {
855 State int64
856 }
857
858 // ConnectionStateContext provides type-safe operations for Connection.State context
859 type ConnectionStateContext struct {
860 framework.Context[ConnectionLabels]
861 }
862
863 // Set provides type-safe dimension setting for Connection.State context
864 func (c ConnectionStateContext) Set(state *framework.CollectorState, labels ConnectionLabels, values ConnectionStateValues) {
865 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
866 "state": values.State,
867 })
868 }
869
870 // SetUpdateEvery sets the update interval for this instance
871 func (c ConnectionStateContext) SetUpdateEvery(state *framework.CollectorState, labels ConnectionLabels, updateEvery int) {
872 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
873 }
874
875 // ConnectionActivityValues defines the type-safe values for Connection.Activity context
876 type ConnectionActivityValues struct {
877 Read int64
878 Written int64
879 }
880
881 // ConnectionActivityContext provides type-safe operations for Connection.Activity context
882 type ConnectionActivityContext struct {
883 framework.Context[ConnectionLabels]
884 }
885
886 // Set provides type-safe dimension setting for Connection.Activity context
887 func (c ConnectionActivityContext) Set(state *framework.CollectorState, labels ConnectionLabels, values ConnectionActivityValues) {
888 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
889 "read": values.Read,
890 "written": values.Written,
891 })
892 }
893
894 // SetUpdateEvery sets the update interval for this instance
895 func (c ConnectionActivityContext) SetUpdateEvery(state *framework.CollectorState, labels ConnectionLabels, updateEvery int) {
896 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
897 }
898
899 // ConnectionWaitTimeValues defines the type-safe values for Connection.WaitTime context
900 type ConnectionWaitTimeValues struct {
901 Lock int64
902 Log_disk int64
903 Log_buffer int64
904 Pool_read int64
905 Pool_write int64
906 Direct_read int64
907 Direct_write int64
908 Fcm_recv int64
909 Fcm_send int64
910 }
911
912 // ConnectionWaitTimeContext provides type-safe operations for Connection.WaitTime context
913 type ConnectionWaitTimeContext struct {
914 framework.Context[ConnectionLabels]
915 }
916
917 // Set provides type-safe dimension setting for Connection.WaitTime context
918 func (c ConnectionWaitTimeContext) Set(state *framework.CollectorState, labels ConnectionLabels, values ConnectionWaitTimeValues) {
919 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
920 "lock": values.Lock,
921 "log_disk": values.Log_disk,
922 "log_buffer": values.Log_buffer,
923 "pool_read": values.Pool_read,
924 "pool_write": values.Pool_write,
925 "direct_read": values.Direct_read,
926 "direct_write": values.Direct_write,
927 "fcm_recv": values.Fcm_recv,
928 "fcm_send": values.Fcm_send,
929 })
930 }
931
932 // SetUpdateEvery sets the update interval for this instance
933 func (c ConnectionWaitTimeContext) SetUpdateEvery(state *framework.CollectorState, labels ConnectionLabels, updateEvery int) {
934 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
935 }
936
937 // ConnectionProcessingTimeValues defines the type-safe values for Connection.ProcessingTime context
938 type ConnectionProcessingTimeValues struct {
939 Routine int64
940 Compile int64
941 Section int64
942 Commit int64
943 Rollback int64
944 }
945
946 // ConnectionProcessingTimeContext provides type-safe operations for Connection.ProcessingTime context
947 type ConnectionProcessingTimeContext struct {
948 framework.Context[ConnectionLabels]
949 }
950
951 // Set provides type-safe dimension setting for Connection.ProcessingTime context
952 func (c ConnectionProcessingTimeContext) Set(state *framework.CollectorState, labels ConnectionLabels, values ConnectionProcessingTimeValues) {
953 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
954 "routine": values.Routine,
955 "compile": values.Compile,
956 "section": values.Section,
957 "commit": values.Commit,
958 "rollback": values.Rollback,
959 })
960 }
961
962 // SetUpdateEvery sets the update interval for this instance
963 func (c ConnectionProcessingTimeContext) SetUpdateEvery(state *framework.CollectorState, labels ConnectionLabels, updateEvery int) {
964 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
965 }
966
967 // ConnectionLabels defines the required labels for Connection contexts
968 type ConnectionLabels struct {
969 Application_id string
970 Application_name string
971 Client_hostname string
972 Client_ip string
973 Client_user string
974 State string
975 }
976
977 // InstanceID generates a unique instance ID using the hardcoded label order from YAML
978 func (l ConnectionLabels) InstanceID(contextName string) string {
979 // Label order from YAML: application_id, application_name, client_hostname, client_ip, client_user, state
980 return contextName + "." + cleanLabelValue(l.Application_id) + "_" + cleanLabelValue(l.Application_name) + "_" + cleanLabelValue(l.Client_hostname) + "_" + cleanLabelValue(l.Client_ip) + "_" + cleanLabelValue(l.Client_user) + "_" + cleanLabelValue(l.State)
981 }
982
983 // Connection contains all metric contexts for Connection
984 var Connection = struct {
985 State ConnectionStateContext
986 Activity ConnectionActivityContext
987 WaitTime ConnectionWaitTimeContext
988 ProcessingTime ConnectionProcessingTimeContext
989 }{
990 State: ConnectionStateContext{
991 Context: framework.Context[ConnectionLabels]{
992 Name: "db2.connection_state",
993 Family: "connections/instances",
994 Title: "Connection State",
995 Units: "state",
996 Type: module.Line,
997 Priority: 1130,
998 UpdateEvery: 1,
999 Dimensions: []framework.Dimension{
1000 {
1001 Name: "state",
1002 Algorithm: module.Absolute,
1003 Mul: 1,
1004 Div: 1,
1005 Precision: 1,
1006 },
1007 },
1008 LabelKeys: []string{
1009 "application_id",
1010 "application_name",
1011 "client_hostname",
1012 "client_ip",
1013 "client_user",
1014 "state",
1015 },
1016 },
1017 },
1018 Activity: ConnectionActivityContext{
1019 Context: framework.Context[ConnectionLabels]{
1020 Name: "db2.connection_activity",
1021 Family: "connections/instances",
1022 Title: "Connection Row Activity",
1023 Units: "rows/s",
1024 Type: module.Area,
1025 Priority: 1131,
1026 UpdateEvery: 1,
1027 Dimensions: []framework.Dimension{
1028 {
1029 Name: "read",
1030 Algorithm: module.Incremental,
1031 Mul: 1,
1032 Div: 1,
1033 Precision: 1,
1034 },
1035 {
1036 Name: "written",
1037 Algorithm: module.Incremental,
1038 Mul: 1,
1039 Div: 1,
1040 Precision: 1,
1041 },
1042 },
1043 LabelKeys: []string{
1044 "application_id",
1045 "application_name",
1046 "client_hostname",
1047 "client_ip",
1048 "client_user",
1049 "state",
1050 },
1051 },
1052 },
1053 WaitTime: ConnectionWaitTimeContext{
1054 Context: framework.Context[ConnectionLabels]{
1055 Name: "db2.connection_wait_time",
1056 Family: "connections/instances",
1057 Title: "Connection Wait Time",
1058 Units: "milliseconds",
1059 Type: module.Stacked,
1060 Priority: 1132,
1061 UpdateEvery: 1,
1062 Dimensions: []framework.Dimension{
1063 {
1064 Name: "lock",
1065 Algorithm: module.Incremental,
1066 Mul: 1,
1067 Div: 1,
1068 Precision: 1,
1069 },
1070 {
1071 Name: "log_disk",
1072 Algorithm: module.Incremental,
1073 Mul: 1,
1074 Div: 1,
1075 Precision: 1,
1076 },
1077 {
1078 Name: "log_buffer",
1079 Algorithm: module.Incremental,
1080 Mul: 1,
1081 Div: 1,
1082 Precision: 1,
1083 },
1084 {
1085 Name: "pool_read",
1086 Algorithm: module.Incremental,
1087 Mul: 1,
1088 Div: 1,
1089 Precision: 1,
1090 },
1091 {
1092 Name: "pool_write",
1093 Algorithm: module.Incremental,
1094 Mul: 1,
1095 Div: 1,
1096 Precision: 1,
1097 },
1098 {
1099 Name: "direct_read",
1100 Algorithm: module.Incremental,
1101 Mul: 1,
1102 Div: 1,
1103 Precision: 1,
1104 },
1105 {
1106 Name: "direct_write",
1107 Algorithm: module.Incremental,
1108 Mul: 1,
1109 Div: 1,
1110 Precision: 1,
1111 },
1112 {
1113 Name: "fcm_recv",
1114 Algorithm: module.Incremental,
1115 Mul: 1,
1116 Div: 1,
1117 Precision: 1,
1118 },
1119 {
1120 Name: "fcm_send",
1121 Algorithm: module.Incremental,
1122 Mul: 1,
1123 Div: 1,
1124 Precision: 1,
1125 },
1126 },
1127 LabelKeys: []string{
1128 "application_id",
1129 "application_name",
1130 "client_hostname",
1131 "client_ip",
1132 "client_user",
1133 "state",
1134 },
1135 },
1136 },
1137 ProcessingTime: ConnectionProcessingTimeContext{
1138 Context: framework.Context[ConnectionLabels]{
1139 Name: "db2.connection_processing_time",
1140 Family: "connections/instances",
1141 Title: "Connection Processing Time",
1142 Units: "milliseconds",
1143 Type: module.Stacked,
1144 Priority: 1133,
1145 UpdateEvery: 1,
1146 Dimensions: []framework.Dimension{
1147 {
1148 Name: "routine",
1149 Algorithm: module.Incremental,
1150 Mul: 1,
1151 Div: 1,
1152 Precision: 1,
1153 },
1154 {
1155 Name: "compile",
1156 Algorithm: module.Incremental,
1157 Mul: 1,
1158 Div: 1,
1159 Precision: 1,
1160 },
1161 {
1162 Name: "section",
1163 Algorithm: module.Incremental,
1164 Mul: 1,
1165 Div: 1,
1166 Precision: 1,
1167 },
1168 {
1169 Name: "commit",
1170 Algorithm: module.Incremental,
1171 Mul: 1,
1172 Div: 1,
1173 Precision: 1,
1174 },
1175 {
1176 Name: "rollback",
1177 Algorithm: module.Incremental,
1178 Mul: 1,
1179 Div: 1,
1180 Precision: 1,
1181 },
1182 },
1183 LabelKeys: []string{
1184 "application_id",
1185 "application_name",
1186 "client_hostname",
1187 "client_ip",
1188 "client_user",
1189 "state",
1190 },
1191 },
1192 },
1193 }
1194
1195 // --- ConnectionGroup ---
1196
1197 // ConnectionGroupCountValues defines the type-safe values for ConnectionGroup.Count context
1198 type ConnectionGroupCountValues struct {
1199 Count int64
1200 }
1201
1202 // ConnectionGroupCountContext provides type-safe operations for ConnectionGroup.Count context
1203 type ConnectionGroupCountContext struct {
1204 framework.Context[ConnectionGroupLabels]
1205 }
1206
1207 // Set provides type-safe dimension setting for ConnectionGroup.Count context
1208 func (c ConnectionGroupCountContext) Set(state *framework.CollectorState, labels ConnectionGroupLabels, values ConnectionGroupCountValues) {
1209 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
1210 "count": values.Count,
1211 })
1212 }
1213
1214 // SetUpdateEvery sets the update interval for this instance
1215 func (c ConnectionGroupCountContext) SetUpdateEvery(state *framework.CollectorState, labels ConnectionGroupLabels, updateEvery int) {
1216 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
1217 }
1218
1219 // ConnectionGroupStateValues defines the type-safe values for ConnectionGroup.State context
1220 type ConnectionGroupStateValues struct {
1221 State int64
1222 }
1223
1224 // ConnectionGroupStateContext provides type-safe operations for ConnectionGroup.State context
1225 type ConnectionGroupStateContext struct {
1226 framework.Context[ConnectionGroupLabels]
1227 }
1228
1229 // Set provides type-safe dimension setting for ConnectionGroup.State context
1230 func (c ConnectionGroupStateContext) Set(state *framework.CollectorState, labels ConnectionGroupLabels, values ConnectionGroupStateValues) {
1231 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
1232 "state": values.State,
1233 })
1234 }
1235
1236 // SetUpdateEvery sets the update interval for this instance
1237 func (c ConnectionGroupStateContext) SetUpdateEvery(state *framework.CollectorState, labels ConnectionGroupLabels, updateEvery int) {
1238 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
1239 }
1240
1241 // ConnectionGroupActivityValues defines the type-safe values for ConnectionGroup.Activity context
1242 type ConnectionGroupActivityValues struct {
1243 Read int64
1244 Written int64
1245 }
1246
1247 // ConnectionGroupActivityContext provides type-safe operations for ConnectionGroup.Activity context
1248 type ConnectionGroupActivityContext struct {
1249 framework.Context[ConnectionGroupLabels]
1250 }
1251
1252 // Set provides type-safe dimension setting for ConnectionGroup.Activity context
1253 func (c ConnectionGroupActivityContext) Set(state *framework.CollectorState, labels ConnectionGroupLabels, values ConnectionGroupActivityValues) {
1254 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
1255 "read": values.Read,
1256 "written": values.Written,
1257 })
1258 }
1259
1260 // SetUpdateEvery sets the update interval for this instance
1261 func (c ConnectionGroupActivityContext) SetUpdateEvery(state *framework.CollectorState, labels ConnectionGroupLabels, updateEvery int) {
1262 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
1263 }
1264
1265 // ConnectionGroupWaitTimeValues defines the type-safe values for ConnectionGroup.WaitTime context
1266 type ConnectionGroupWaitTimeValues struct {
1267 Lock int64
1268 Log_disk int64
1269 Log_buffer int64
1270 Pool_read int64
1271 Pool_write int64
1272 Direct_read int64
1273 Direct_write int64
1274 Fcm_recv int64
1275 Fcm_send int64
1276 }
1277
1278 // ConnectionGroupWaitTimeContext provides type-safe operations for ConnectionGroup.WaitTime context
1279 type ConnectionGroupWaitTimeContext struct {
1280 framework.Context[ConnectionGroupLabels]
1281 }
1282
1283 // Set provides type-safe dimension setting for ConnectionGroup.WaitTime context
1284 func (c ConnectionGroupWaitTimeContext) Set(state *framework.CollectorState, labels ConnectionGroupLabels, values ConnectionGroupWaitTimeValues) {
1285 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
1286 "lock": values.Lock,
1287 "log_disk": values.Log_disk,
1288 "log_buffer": values.Log_buffer,
1289 "pool_read": values.Pool_read,
1290 "pool_write": values.Pool_write,
1291 "direct_read": values.Direct_read,
1292 "direct_write": values.Direct_write,
1293 "fcm_recv": values.Fcm_recv,
1294 "fcm_send": values.Fcm_send,
1295 })
1296 }
1297
1298 // SetUpdateEvery sets the update interval for this instance
1299 func (c ConnectionGroupWaitTimeContext) SetUpdateEvery(state *framework.CollectorState, labels ConnectionGroupLabels, updateEvery int) {
1300 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
1301 }
1302
1303 // ConnectionGroupProcessingTimeValues defines the type-safe values for ConnectionGroup.ProcessingTime context
1304 type ConnectionGroupProcessingTimeValues struct {
1305 Routine int64
1306 Compile int64
1307 Section int64
1308 Commit int64
1309 Rollback int64
1310 }
1311
1312 // ConnectionGroupProcessingTimeContext provides type-safe operations for ConnectionGroup.ProcessingTime context
1313 type ConnectionGroupProcessingTimeContext struct {
1314 framework.Context[ConnectionGroupLabels]
1315 }
1316
1317 // Set provides type-safe dimension setting for ConnectionGroup.ProcessingTime context
1318 func (c ConnectionGroupProcessingTimeContext) Set(state *framework.CollectorState, labels ConnectionGroupLabels, values ConnectionGroupProcessingTimeValues) {
1319 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
1320 "routine": values.Routine,
1321 "compile": values.Compile,
1322 "section": values.Section,
1323 "commit": values.Commit,
1324 "rollback": values.Rollback,
1325 })
1326 }
1327
1328 // SetUpdateEvery sets the update interval for this instance
1329 func (c ConnectionGroupProcessingTimeContext) SetUpdateEvery(state *framework.CollectorState, labels ConnectionGroupLabels, updateEvery int) {
1330 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
1331 }
1332
1333 // ConnectionGroupLabels defines the required labels for ConnectionGroup contexts
1334 type ConnectionGroupLabels struct {
1335 Group string
1336 }
1337
1338 // InstanceID generates a unique instance ID using the hardcoded label order from YAML
1339 func (l ConnectionGroupLabels) InstanceID(contextName string) string {
1340 // Label order from YAML: group
1341 return contextName + "." + cleanLabelValue(l.Group)
1342 }
1343
1344 // ConnectionGroup contains all metric contexts for ConnectionGroup
1345 var ConnectionGroup = struct {
1346 Count ConnectionGroupCountContext
1347 State ConnectionGroupStateContext
1348 Activity ConnectionGroupActivityContext
1349 WaitTime ConnectionGroupWaitTimeContext
1350 ProcessingTime ConnectionGroupProcessingTimeContext
1351 }{
1352 Count: ConnectionGroupCountContext{
1353 Context: framework.Context[ConnectionGroupLabels]{
1354 Name: "db2.connection_group.count",
1355 Family: "connections/groups",
1356 Title: "Connection Group Count",
1357 Units: "connections",
1358 Type: module.Line,
1359 Priority: 1134,
1360 UpdateEvery: 1,
1361 Dimensions: []framework.Dimension{
1362 {
1363 Name: "count",
1364 Algorithm: module.Absolute,
1365 Mul: 1,
1366 Div: 1,
1367 Precision: 1,
1368 },
1369 },
1370 LabelKeys: []string{
1371 "group",
1372 },
1373 },
1374 },
1375 State: ConnectionGroupStateContext{
1376 Context: framework.Context[ConnectionGroupLabels]{
1377 Name: "db2.connection_group.state",
1378 Family: "connections/groups",
1379 Title: "Connection Group State Sum",
1380 Units: "state",
1381 Type: module.Line,
1382 Priority: 1135,
1383 UpdateEvery: 1,
1384 Dimensions: []framework.Dimension{
1385 {
1386 Name: "state",
1387 Algorithm: module.Absolute,
1388 Mul: 1,
1389 Div: 1,
1390 Precision: 1,
1391 },
1392 },
1393 LabelKeys: []string{
1394 "group",
1395 },
1396 },
1397 },
1398 Activity: ConnectionGroupActivityContext{
1399 Context: framework.Context[ConnectionGroupLabels]{
1400 Name: "db2.connection_group.activity",
1401 Family: "connections/groups",
1402 Title: "Connection Group Row Activity",
1403 Units: "rows/s",
1404 Type: module.Area,
1405 Priority: 1136,
1406 UpdateEvery: 1,
1407 Dimensions: []framework.Dimension{
1408 {
1409 Name: "read",
1410 Algorithm: module.Incremental,
1411 Mul: 1,
1412 Div: 1,
1413 Precision: 1,
1414 },
1415 {
1416 Name: "written",
1417 Algorithm: module.Incremental,
1418 Mul: 1,
1419 Div: 1,
1420 Precision: 1,
1421 },
1422 },
1423 LabelKeys: []string{
1424 "group",
1425 },
1426 },
1427 },
1428 WaitTime: ConnectionGroupWaitTimeContext{
1429 Context: framework.Context[ConnectionGroupLabels]{
1430 Name: "db2.connection_group.wait_time",
1431 Family: "connections/groups",
1432 Title: "Connection Group Wait Time",
1433 Units: "milliseconds",
1434 Type: module.Stacked,
1435 Priority: 1137,
1436 UpdateEvery: 1,
1437 Dimensions: []framework.Dimension{
1438 {
1439 Name: "lock",
1440 Algorithm: module.Incremental,
1441 Mul: 1,
1442 Div: 1,
1443 Precision: 1,
1444 },
1445 {
1446 Name: "log_disk",
1447 Algorithm: module.Incremental,
1448 Mul: 1,
1449 Div: 1,
1450 Precision: 1,
1451 },
1452 {
1453 Name: "log_buffer",
1454 Algorithm: module.Incremental,
1455 Mul: 1,
1456 Div: 1,
1457 Precision: 1,
1458 },
1459 {
1460 Name: "pool_read",
1461 Algorithm: module.Incremental,
1462 Mul: 1,
1463 Div: 1,
1464 Precision: 1,
1465 },
1466 {
1467 Name: "pool_write",
1468 Algorithm: module.Incremental,
1469 Mul: 1,
1470 Div: 1,
1471 Precision: 1,
1472 },
1473 {
1474 Name: "direct_read",
1475 Algorithm: module.Incremental,
1476 Mul: 1,
1477 Div: 1,
1478 Precision: 1,
1479 },
1480 {
1481 Name: "direct_write",
1482 Algorithm: module.Incremental,
1483 Mul: 1,
1484 Div: 1,
1485 Precision: 1,
1486 },
1487 {
1488 Name: "fcm_recv",
1489 Algorithm: module.Incremental,
1490 Mul: 1,
1491 Div: 1,
1492 Precision: 1,
1493 },
1494 {
1495 Name: "fcm_send",
1496 Algorithm: module.Incremental,
1497 Mul: 1,
1498 Div: 1,
1499 Precision: 1,
1500 },
1501 },
1502 LabelKeys: []string{
1503 "group",
1504 },
1505 },
1506 },
1507 ProcessingTime: ConnectionGroupProcessingTimeContext{
1508 Context: framework.Context[ConnectionGroupLabels]{
1509 Name: "db2.connection_group.processing_time",
1510 Family: "connections/groups",
1511 Title: "Connection Group Processing Time",
1512 Units: "milliseconds",
1513 Type: module.Stacked,
1514 Priority: 1138,
1515 UpdateEvery: 1,
1516 Dimensions: []framework.Dimension{
1517 {
1518 Name: "routine",
1519 Algorithm: module.Incremental,
1520 Mul: 1,
1521 Div: 1,
1522 Precision: 1,
1523 },
1524 {
1525 Name: "compile",
1526 Algorithm: module.Incremental,
1527 Mul: 1,
1528 Div: 1,
1529 Precision: 1,
1530 },
1531 {
1532 Name: "section",
1533 Algorithm: module.Incremental,
1534 Mul: 1,
1535 Div: 1,
1536 Precision: 1,
1537 },
1538 {
1539 Name: "commit",
1540 Algorithm: module.Incremental,
1541 Mul: 1,
1542 Div: 1,
1543 Precision: 1,
1544 },
1545 {
1546 Name: "rollback",
1547 Algorithm: module.Incremental,
1548 Mul: 1,
1549 Div: 1,
1550 Precision: 1,
1551 },
1552 },
1553 LabelKeys: []string{
1554 "group",
1555 },
1556 },
1557 },
1558 }
1559
1560 // --- Database ---
1561
1562 // DatabaseStatusValues defines the type-safe values for Database.Status context
1563 type DatabaseStatusValues struct {
1564 Status int64
1565 }
1566
1567 // DatabaseStatusContext provides type-safe operations for Database.Status context
1568 type DatabaseStatusContext struct {
1569 framework.Context[DatabaseLabels]
1570 }
1571
1572 // Set provides type-safe dimension setting for Database.Status context
1573 func (c DatabaseStatusContext) Set(state *framework.CollectorState, labels DatabaseLabels, values DatabaseStatusValues) {
1574 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
1575 "status": values.Status,
1576 })
1577 }
1578
1579 // SetUpdateEvery sets the update interval for this instance
1580 func (c DatabaseStatusContext) SetUpdateEvery(state *framework.CollectorState, labels DatabaseLabels, updateEvery int) {
1581 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
1582 }
1583
1584 // DatabaseApplicationsValues defines the type-safe values for Database.Applications context
1585 type DatabaseApplicationsValues struct {
1586 Applications int64
1587 }
1588
1589 // DatabaseApplicationsContext provides type-safe operations for Database.Applications context
1590 type DatabaseApplicationsContext struct {
1591 framework.Context[DatabaseLabels]
1592 }
1593
1594 // Set provides type-safe dimension setting for Database.Applications context
1595 func (c DatabaseApplicationsContext) Set(state *framework.CollectorState, labels DatabaseLabels, values DatabaseApplicationsValues) {
1596 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
1597 "applications": values.Applications,
1598 })
1599 }
1600
1601 // SetUpdateEvery sets the update interval for this instance
1602 func (c DatabaseApplicationsContext) SetUpdateEvery(state *framework.CollectorState, labels DatabaseLabels, updateEvery int) {
1603 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
1604 }
1605
1606 // DatabaseLabels defines the required labels for Database contexts
1607 type DatabaseLabels struct {
1608 Database string
1609 Status string
1610 }
1611
1612 // InstanceID generates a unique instance ID using the hardcoded label order from YAML
1613 func (l DatabaseLabels) InstanceID(contextName string) string {
1614 // Label order from YAML: database, status
1615 return contextName + "." + cleanLabelValue(l.Database) + "_" + cleanLabelValue(l.Status)
1616 }
1617
1618 // Database contains all metric contexts for Database
1619 var Database = struct {
1620 Status DatabaseStatusContext
1621 Applications DatabaseApplicationsContext
1622 }{
1623 Status: DatabaseStatusContext{
1624 Context: framework.Context[DatabaseLabels]{
1625 Name: "db2.database_instance_status",
1626 Family: "databases",
1627 Title: "Database Status",
1628 Units: "status",
1629 Type: module.Line,
1630 Priority: 1100,
1631 UpdateEvery: 1,
1632 Dimensions: []framework.Dimension{
1633 {
1634 Name: "status",
1635 Algorithm: module.Absolute,
1636 Mul: 1,
1637 Div: 1,
1638 Precision: 1,
1639 },
1640 },
1641 LabelKeys: []string{
1642 "database",
1643 "status",
1644 },
1645 },
1646 },
1647 Applications: DatabaseApplicationsContext{
1648 Context: framework.Context[DatabaseLabels]{
1649 Name: "db2.database_applications",
1650 Family: "databases",
1651 Title: "Database Applications",
1652 Units: "applications",
1653 Type: module.Line,
1654 Priority: 1101,
1655 UpdateEvery: 1,
1656 Dimensions: []framework.Dimension{
1657 {
1658 Name: "applications",
1659 Algorithm: module.Absolute,
1660 Mul: 1,
1661 Div: 1,
1662 Precision: 1,
1663 },
1664 },
1665 LabelKeys: []string{
1666 "database",
1667 "status",
1668 },
1669 },
1670 },
1671 }
1672
1673 // --- Index ---
1674
1675 // IndexUsageValues defines the type-safe values for Index.Usage context
1676 type IndexUsageValues struct {
1677 Index int64
1678 Full int64
1679 }
1680
1681 // IndexUsageContext provides type-safe operations for Index.Usage context
1682 type IndexUsageContext struct {
1683 framework.Context[IndexLabels]
1684 }
1685
1686 // Set provides type-safe dimension setting for Index.Usage context
1687 func (c IndexUsageContext) Set(state *framework.CollectorState, labels IndexLabels, values IndexUsageValues) {
1688 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
1689 "index": values.Index,
1690 "full": values.Full,
1691 })
1692 }
1693
1694 // SetUpdateEvery sets the update interval for this instance
1695 func (c IndexUsageContext) SetUpdateEvery(state *framework.CollectorState, labels IndexLabels, updateEvery int) {
1696 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
1697 }
1698
1699 // IndexLabels defines the required labels for Index contexts
1700 type IndexLabels struct {
1701 Index string
1702 }
1703
1704 // InstanceID generates a unique instance ID using the hardcoded label order from YAML
1705 func (l IndexLabels) InstanceID(contextName string) string {
1706 // Label order from YAML: index
1707 return contextName + "." + cleanLabelValue(l.Index)
1708 }
1709
1710 // Index contains all metric contexts for Index
1711 var Index = struct {
1712 Usage IndexUsageContext
1713 }{
1714 Usage: IndexUsageContext{
1715 Context: framework.Context[IndexLabels]{
1716 Name: "db2.index_usage",
1717 Family: "indexes",
1718 Title: "Index Usage",
1719 Units: "scans/s",
1720 Type: module.Area,
1721 Priority: 1150,
1722 UpdateEvery: 1,
1723 Dimensions: []framework.Dimension{
1724 {
1725 Name: "index",
1726 Algorithm: module.Incremental,
1727 Mul: 1,
1728 Div: 1,
1729 Precision: 1,
1730 },
1731 {
1732 Name: "full",
1733 Algorithm: module.Incremental,
1734 Mul: 1,
1735 Div: 1,
1736 Precision: 1,
1737 },
1738 },
1739 LabelKeys: []string{
1740 "index",
1741 },
1742 },
1743 },
1744 }
1745
1746 // --- IndexGroup ---
1747
1748 // IndexGroupUsageValues defines the type-safe values for IndexGroup.Usage context
1749 type IndexGroupUsageValues struct {
1750 Index int64
1751 Full int64
1752 }
1753
1754 // IndexGroupUsageContext provides type-safe operations for IndexGroup.Usage context
1755 type IndexGroupUsageContext struct {
1756 framework.Context[IndexGroupLabels]
1757 }
1758
1759 // Set provides type-safe dimension setting for IndexGroup.Usage context
1760 func (c IndexGroupUsageContext) Set(state *framework.CollectorState, labels IndexGroupLabels, values IndexGroupUsageValues) {
1761 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
1762 "index": values.Index,
1763 "full": values.Full,
1764 })
1765 }
1766
1767 // SetUpdateEvery sets the update interval for this instance
1768 func (c IndexGroupUsageContext) SetUpdateEvery(state *framework.CollectorState, labels IndexGroupLabels, updateEvery int) {
1769 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
1770 }
1771
1772 // IndexGroupLabels defines the required labels for IndexGroup contexts
1773 type IndexGroupLabels struct {
1774 Group string
1775 }
1776
1777 // InstanceID generates a unique instance ID using the hardcoded label order from YAML
1778 func (l IndexGroupLabels) InstanceID(contextName string) string {
1779 // Label order from YAML: group
1780 return contextName + "." + cleanLabelValue(l.Group)
1781 }
1782
1783 // IndexGroup contains all metric contexts for IndexGroup
1784 var IndexGroup = struct {
1785 Usage IndexGroupUsageContext
1786 }{
1787 Usage: IndexGroupUsageContext{
1788 Context: framework.Context[IndexGroupLabels]{
1789 Name: "db2.index_group_usage",
1790 Family: "indexes/groups",
1791 Title: "Index Group Usage",
1792 Units: "scans/s",
1793 Type: module.Area,
1794 Priority: 1151,
1795 UpdateEvery: 1,
1796 Dimensions: []framework.Dimension{
1797 {
1798 Name: "index",
1799 Algorithm: module.Incremental,
1800 Mul: 1,
1801 Div: 1,
1802 Precision: 1,
1803 },
1804 {
1805 Name: "full",
1806 Algorithm: module.Incremental,
1807 Mul: 1,
1808 Div: 1,
1809 Precision: 1,
1810 },
1811 },
1812 LabelKeys: []string{
1813 "group",
1814 },
1815 },
1816 },
1817 }
1818
1819 // --- MemoryPool ---
1820
1821 // MemoryPoolUsageValues defines the type-safe values for MemoryPool.Usage context
1822 type MemoryPoolUsageValues struct {
1823 Used int64
1824 }
1825
1826 // MemoryPoolUsageContext provides type-safe operations for MemoryPool.Usage context
1827 type MemoryPoolUsageContext struct {
1828 framework.Context[MemoryPoolLabels]
1829 }
1830
1831 // Set provides type-safe dimension setting for MemoryPool.Usage context
1832 func (c MemoryPoolUsageContext) Set(state *framework.CollectorState, labels MemoryPoolLabels, values MemoryPoolUsageValues) {
1833 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
1834 "used": values.Used,
1835 })
1836 }
1837
1838 // SetUpdateEvery sets the update interval for this instance
1839 func (c MemoryPoolUsageContext) SetUpdateEvery(state *framework.CollectorState, labels MemoryPoolLabels, updateEvery int) {
1840 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
1841 }
1842
1843 // MemoryPoolHighWaterMarkValues defines the type-safe values for MemoryPool.HighWaterMark context
1844 type MemoryPoolHighWaterMarkValues struct {
1845 Hwm int64
1846 }
1847
1848 // MemoryPoolHighWaterMarkContext provides type-safe operations for MemoryPool.HighWaterMark context
1849 type MemoryPoolHighWaterMarkContext struct {
1850 framework.Context[MemoryPoolLabels]
1851 }
1852
1853 // Set provides type-safe dimension setting for MemoryPool.HighWaterMark context
1854 func (c MemoryPoolHighWaterMarkContext) Set(state *framework.CollectorState, labels MemoryPoolLabels, values MemoryPoolHighWaterMarkValues) {
1855 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
1856 "hwm": values.Hwm,
1857 })
1858 }
1859
1860 // SetUpdateEvery sets the update interval for this instance
1861 func (c MemoryPoolHighWaterMarkContext) SetUpdateEvery(state *framework.CollectorState, labels MemoryPoolLabels, updateEvery int) {
1862 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
1863 }
1864
1865 // MemoryPoolLabels defines the required labels for MemoryPool contexts
1866 type MemoryPoolLabels struct {
1867 Pool_type string
1868 }
1869
1870 // InstanceID generates a unique instance ID using the hardcoded label order from YAML
1871 func (l MemoryPoolLabels) InstanceID(contextName string) string {
1872 // Label order from YAML: pool_type
1873 return contextName + "." + cleanLabelValue(l.Pool_type)
1874 }
1875
1876 // MemoryPool contains all metric contexts for MemoryPool
1877 var MemoryPool = struct {
1878 Usage MemoryPoolUsageContext
1879 HighWaterMark MemoryPoolHighWaterMarkContext
1880 }{
1881 Usage: MemoryPoolUsageContext{
1882 Context: framework.Context[MemoryPoolLabels]{
1883 Name: "db2.memory_pool_usage",
1884 Family: "memory",
1885 Title: "Memory Pool Usage",
1886 Units: "bytes",
1887 Type: module.Line,
1888 Priority: 1160,
1889 UpdateEvery: 1,
1890 Dimensions: []framework.Dimension{
1891 {
1892 Name: "used",
1893 Algorithm: module.Absolute,
1894 Mul: 1,
1895 Div: 1,
1896 Precision: 1,
1897 },
1898 },
1899 LabelKeys: []string{
1900 "pool_type",
1901 },
1902 },
1903 },
1904 HighWaterMark: MemoryPoolHighWaterMarkContext{
1905 Context: framework.Context[MemoryPoolLabels]{
1906 Name: "db2.memory_pool_hwm",
1907 Family: "memory",
1908 Title: "Memory Pool High Water Mark",
1909 Units: "bytes",
1910 Type: module.Line,
1911 Priority: 1161,
1912 UpdateEvery: 1,
1913 Dimensions: []framework.Dimension{
1914 {
1915 Name: "hwm",
1916 Algorithm: module.Absolute,
1917 Mul: 1,
1918 Div: 1,
1919 Precision: 1,
1920 },
1921 },
1922 LabelKeys: []string{
1923 "pool_type",
1924 },
1925 },
1926 },
1927 }
1928
1929 // --- MemorySet ---
1930
1931 // MemorySetUsageValues defines the type-safe values for MemorySet.Usage context
1932 type MemorySetUsageValues struct {
1933 Used int64
1934 }
1935
1936 // MemorySetUsageContext provides type-safe operations for MemorySet.Usage context
1937 type MemorySetUsageContext struct {
1938 framework.Context[MemorySetLabels]
1939 }
1940
1941 // Set provides type-safe dimension setting for MemorySet.Usage context
1942 func (c MemorySetUsageContext) Set(state *framework.CollectorState, labels MemorySetLabels, values MemorySetUsageValues) {
1943 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
1944 "used": values.Used,
1945 })
1946 }
1947
1948 // SetUpdateEvery sets the update interval for this instance
1949 func (c MemorySetUsageContext) SetUpdateEvery(state *framework.CollectorState, labels MemorySetLabels, updateEvery int) {
1950 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
1951 }
1952
1953 // MemorySetCommittedValues defines the type-safe values for MemorySet.Committed context
1954 type MemorySetCommittedValues struct {
1955 Committed int64
1956 }
1957
1958 // MemorySetCommittedContext provides type-safe operations for MemorySet.Committed context
1959 type MemorySetCommittedContext struct {
1960 framework.Context[MemorySetLabels]
1961 }
1962
1963 // Set provides type-safe dimension setting for MemorySet.Committed context
1964 func (c MemorySetCommittedContext) Set(state *framework.CollectorState, labels MemorySetLabels, values MemorySetCommittedValues) {
1965 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
1966 "committed": values.Committed,
1967 })
1968 }
1969
1970 // SetUpdateEvery sets the update interval for this instance
1971 func (c MemorySetCommittedContext) SetUpdateEvery(state *framework.CollectorState, labels MemorySetLabels, updateEvery int) {
1972 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
1973 }
1974
1975 // MemorySetHighWaterMarkValues defines the type-safe values for MemorySet.HighWaterMark context
1976 type MemorySetHighWaterMarkValues struct {
1977 Hwm int64
1978 }
1979
1980 // MemorySetHighWaterMarkContext provides type-safe operations for MemorySet.HighWaterMark context
1981 type MemorySetHighWaterMarkContext struct {
1982 framework.Context[MemorySetLabels]
1983 }
1984
1985 // Set provides type-safe dimension setting for MemorySet.HighWaterMark context
1986 func (c MemorySetHighWaterMarkContext) Set(state *framework.CollectorState, labels MemorySetLabels, values MemorySetHighWaterMarkValues) {
1987 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
1988 "hwm": values.Hwm,
1989 })
1990 }
1991
1992 // SetUpdateEvery sets the update interval for this instance
1993 func (c MemorySetHighWaterMarkContext) SetUpdateEvery(state *framework.CollectorState, labels MemorySetLabels, updateEvery int) {
1994 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
1995 }
1996
1997 // MemorySetAdditionalCommittedValues defines the type-safe values for MemorySet.AdditionalCommitted context
1998 type MemorySetAdditionalCommittedValues struct {
1999 Additional int64
2000 }
2001
2002 // MemorySetAdditionalCommittedContext provides type-safe operations for MemorySet.AdditionalCommitted context
2003 type MemorySetAdditionalCommittedContext struct {
2004 framework.Context[MemorySetLabels]
2005 }
2006
2007 // Set provides type-safe dimension setting for MemorySet.AdditionalCommitted context
2008 func (c MemorySetAdditionalCommittedContext) Set(state *framework.CollectorState, labels MemorySetLabels, values MemorySetAdditionalCommittedValues) {
2009 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
2010 "additional": values.Additional,
2011 })
2012 }
2013
2014 // SetUpdateEvery sets the update interval for this instance
2015 func (c MemorySetAdditionalCommittedContext) SetUpdateEvery(state *framework.CollectorState, labels MemorySetLabels, updateEvery int) {
2016 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
2017 }
2018
2019 // MemorySetPercentUsedHWMValues defines the type-safe values for MemorySet.PercentUsedHWM context
2020 type MemorySetPercentUsedHWMValues struct {
2021 Used_hwm int64
2022 }
2023
2024 // MemorySetPercentUsedHWMContext provides type-safe operations for MemorySet.PercentUsedHWM context
2025 type MemorySetPercentUsedHWMContext struct {
2026 framework.Context[MemorySetLabels]
2027 }
2028
2029 // Set provides type-safe dimension setting for MemorySet.PercentUsedHWM context
2030 func (c MemorySetPercentUsedHWMContext) Set(state *framework.CollectorState, labels MemorySetLabels, values MemorySetPercentUsedHWMValues) {
2031 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
2032 "used_hwm": values.Used_hwm,
2033 })
2034 }
2035
2036 // SetUpdateEvery sets the update interval for this instance
2037 func (c MemorySetPercentUsedHWMContext) SetUpdateEvery(state *framework.CollectorState, labels MemorySetLabels, updateEvery int) {
2038 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
2039 }
2040
2041 // MemorySetLabels defines the required labels for MemorySet contexts
2042 type MemorySetLabels struct {
2043 Host string
2044 Database string
2045 Set_type string
2046 Member string
2047 }
2048
2049 // InstanceID generates a unique instance ID using the hardcoded label order from YAML
2050 func (l MemorySetLabels) InstanceID(contextName string) string {
2051 // Label order from YAML: host, database, set_type, member
2052 return contextName + "." + cleanLabelValue(l.Host) + "_" + cleanLabelValue(l.Database) + "_" + cleanLabelValue(l.Set_type) + "_" + cleanLabelValue(l.Member)
2053 }
2054
2055 // MemorySet contains all metric contexts for MemorySet
2056 var MemorySet = struct {
2057 Usage MemorySetUsageContext
2058 Committed MemorySetCommittedContext
2059 HighWaterMark MemorySetHighWaterMarkContext
2060 AdditionalCommitted MemorySetAdditionalCommittedContext
2061 PercentUsedHWM MemorySetPercentUsedHWMContext
2062 }{
2063 Usage: MemorySetUsageContext{
2064 Context: framework.Context[MemorySetLabels]{
2065 Name: "db2.memory_set_usage",
2066 Family: "memory_sets",
2067 Title: "Memory Set Usage",
2068 Units: "bytes",
2069 Type: module.Line,
2070 Priority: 1180,
2071 UpdateEvery: 1,
2072 Dimensions: []framework.Dimension{
2073 {
2074 Name: "used",
2075 Algorithm: module.Absolute,
2076 Mul: 1,
2077 Div: 1,
2078 Precision: 1,
2079 },
2080 },
2081 LabelKeys: []string{
2082 "host",
2083 "database",
2084 "set_type",
2085 "member",
2086 },
2087 },
2088 },
2089 Committed: MemorySetCommittedContext{
2090 Context: framework.Context[MemorySetLabels]{
2091 Name: "db2.memory_set_committed",
2092 Family: "memory_sets",
2093 Title: "Memory Set Committed",
2094 Units: "bytes",
2095 Type: module.Line,
2096 Priority: 1181,
2097 UpdateEvery: 1,
2098 Dimensions: []framework.Dimension{
2099 {
2100 Name: "committed",
2101 Algorithm: module.Absolute,
2102 Mul: 1,
2103 Div: 1,
2104 Precision: 1,
2105 },
2106 },
2107 LabelKeys: []string{
2108 "host",
2109 "database",
2110 "set_type",
2111 "member",
2112 },
2113 },
2114 },
2115 HighWaterMark: MemorySetHighWaterMarkContext{
2116 Context: framework.Context[MemorySetLabels]{
2117 Name: "db2.memory_set_high_water_mark",
2118 Family: "memory_sets",
2119 Title: "Memory Set High Water Mark",
2120 Units: "bytes",
2121 Type: module.Line,
2122 Priority: 1182,
2123 UpdateEvery: 1,
2124 Dimensions: []framework.Dimension{
2125 {
2126 Name: "hwm",
2127 Algorithm: module.Absolute,
2128 Mul: 1,
2129 Div: 1,
2130 Precision: 1,
2131 },
2132 },
2133 LabelKeys: []string{
2134 "host",
2135 "database",
2136 "set_type",
2137 "member",
2138 },
2139 },
2140 },
2141 AdditionalCommitted: MemorySetAdditionalCommittedContext{
2142 Context: framework.Context[MemorySetLabels]{
2143 Name: "db2.memory_set_additional_committed",
2144 Family: "memory_sets",
2145 Title: "Memory Set Additional Committed",
2146 Units: "bytes",
2147 Type: module.Line,
2148 Priority: 1183,
2149 UpdateEvery: 1,
2150 Dimensions: []framework.Dimension{
2151 {
2152 Name: "additional",
2153 Algorithm: module.Absolute,
2154 Mul: 1,
2155 Div: 1,
2156 Precision: 1,
2157 },
2158 },
2159 LabelKeys: []string{
2160 "host",
2161 "database",
2162 "set_type",
2163 "member",
2164 },
2165 },
2166 },
2167 PercentUsedHWM: MemorySetPercentUsedHWMContext{
2168 Context: framework.Context[MemorySetLabels]{
2169 Name: "db2.memory_set_percent_used_hwm",
2170 Family: "memory_sets",
2171 Title: "Memory Set Percent Used vs HWM",
2172 Units: "percentage",
2173 Type: module.Line,
2174 Priority: 1184,
2175 UpdateEvery: 1,
2176 Dimensions: []framework.Dimension{
2177 {
2178 Name: "used_hwm",
2179 Algorithm: module.Absolute,
2180 Mul: 1,
2181 Div: 1000,
2182 Precision: 1000,
2183 },
2184 },
2185 LabelKeys: []string{
2186 "host",
2187 "database",
2188 "set_type",
2189 "member",
2190 },
2191 },
2192 },
2193 }
2194
2195 // --- Prefetcher ---
2196
2197 // PrefetcherPrefetchRatioValues defines the type-safe values for Prefetcher.PrefetchRatio context
2198 type PrefetcherPrefetchRatioValues struct {
2199 Ratio int64
2200 }
2201
2202 // PrefetcherPrefetchRatioContext provides type-safe operations for Prefetcher.PrefetchRatio context
2203 type PrefetcherPrefetchRatioContext struct {
2204 framework.Context[PrefetcherLabels]
2205 }
2206
2207 // Set provides type-safe dimension setting for Prefetcher.PrefetchRatio context
2208 func (c PrefetcherPrefetchRatioContext) Set(state *framework.CollectorState, labels PrefetcherLabels, values PrefetcherPrefetchRatioValues) {
2209 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
2210 "ratio": values.Ratio,
2211 })
2212 }
2213
2214 // SetUpdateEvery sets the update interval for this instance
2215 func (c PrefetcherPrefetchRatioContext) SetUpdateEvery(state *framework.CollectorState, labels PrefetcherLabels, updateEvery int) {
2216 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
2217 }
2218
2219 // PrefetcherCleanerRatioValues defines the type-safe values for Prefetcher.CleanerRatio context
2220 type PrefetcherCleanerRatioValues struct {
2221 Ratio int64
2222 }
2223
2224 // PrefetcherCleanerRatioContext provides type-safe operations for Prefetcher.CleanerRatio context
2225 type PrefetcherCleanerRatioContext struct {
2226 framework.Context[PrefetcherLabels]
2227 }
2228
2229 // Set provides type-safe dimension setting for Prefetcher.CleanerRatio context
2230 func (c PrefetcherCleanerRatioContext) Set(state *framework.CollectorState, labels PrefetcherLabels, values PrefetcherCleanerRatioValues) {
2231 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
2232 "ratio": values.Ratio,
2233 })
2234 }
2235
2236 // SetUpdateEvery sets the update interval for this instance
2237 func (c PrefetcherCleanerRatioContext) SetUpdateEvery(state *framework.CollectorState, labels PrefetcherLabels, updateEvery int) {
2238 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
2239 }
2240
2241 // PrefetcherPhysicalReadsValues defines the type-safe values for Prefetcher.PhysicalReads context
2242 type PrefetcherPhysicalReadsValues struct {
2243 Reads int64
2244 }
2245
2246 // PrefetcherPhysicalReadsContext provides type-safe operations for Prefetcher.PhysicalReads context
2247 type PrefetcherPhysicalReadsContext struct {
2248 framework.Context[PrefetcherLabels]
2249 }
2250
2251 // Set provides type-safe dimension setting for Prefetcher.PhysicalReads context
2252 func (c PrefetcherPhysicalReadsContext) Set(state *framework.CollectorState, labels PrefetcherLabels, values PrefetcherPhysicalReadsValues) {
2253 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
2254 "reads": values.Reads,
2255 })
2256 }
2257
2258 // SetUpdateEvery sets the update interval for this instance
2259 func (c PrefetcherPhysicalReadsContext) SetUpdateEvery(state *framework.CollectorState, labels PrefetcherLabels, updateEvery int) {
2260 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
2261 }
2262
2263 // PrefetcherAsyncReadsValues defines the type-safe values for Prefetcher.AsyncReads context
2264 type PrefetcherAsyncReadsValues struct {
2265 Reads int64
2266 }
2267
2268 // PrefetcherAsyncReadsContext provides type-safe operations for Prefetcher.AsyncReads context
2269 type PrefetcherAsyncReadsContext struct {
2270 framework.Context[PrefetcherLabels]
2271 }
2272
2273 // Set provides type-safe dimension setting for Prefetcher.AsyncReads context
2274 func (c PrefetcherAsyncReadsContext) Set(state *framework.CollectorState, labels PrefetcherLabels, values PrefetcherAsyncReadsValues) {
2275 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
2276 "reads": values.Reads,
2277 })
2278 }
2279
2280 // SetUpdateEvery sets the update interval for this instance
2281 func (c PrefetcherAsyncReadsContext) SetUpdateEvery(state *framework.CollectorState, labels PrefetcherLabels, updateEvery int) {
2282 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
2283 }
2284
2285 // PrefetcherWaitTimeValues defines the type-safe values for Prefetcher.WaitTime context
2286 type PrefetcherWaitTimeValues struct {
2287 Wait_time int64
2288 }
2289
2290 // PrefetcherWaitTimeContext provides type-safe operations for Prefetcher.WaitTime context
2291 type PrefetcherWaitTimeContext struct {
2292 framework.Context[PrefetcherLabels]
2293 }
2294
2295 // Set provides type-safe dimension setting for Prefetcher.WaitTime context
2296 func (c PrefetcherWaitTimeContext) Set(state *framework.CollectorState, labels PrefetcherLabels, values PrefetcherWaitTimeValues) {
2297 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
2298 "wait_time": values.Wait_time,
2299 })
2300 }
2301
2302 // SetUpdateEvery sets the update interval for this instance
2303 func (c PrefetcherWaitTimeContext) SetUpdateEvery(state *framework.CollectorState, labels PrefetcherLabels, updateEvery int) {
2304 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
2305 }
2306
2307 // PrefetcherUnreadPagesValues defines the type-safe values for Prefetcher.UnreadPages context
2308 type PrefetcherUnreadPagesValues struct {
2309 Unread int64
2310 }
2311
2312 // PrefetcherUnreadPagesContext provides type-safe operations for Prefetcher.UnreadPages context
2313 type PrefetcherUnreadPagesContext struct {
2314 framework.Context[PrefetcherLabels]
2315 }
2316
2317 // Set provides type-safe dimension setting for Prefetcher.UnreadPages context
2318 func (c PrefetcherUnreadPagesContext) Set(state *framework.CollectorState, labels PrefetcherLabels, values PrefetcherUnreadPagesValues) {
2319 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
2320 "unread": values.Unread,
2321 })
2322 }
2323
2324 // SetUpdateEvery sets the update interval for this instance
2325 func (c PrefetcherUnreadPagesContext) SetUpdateEvery(state *framework.CollectorState, labels PrefetcherLabels, updateEvery int) {
2326 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
2327 }
2328
2329 // PrefetcherLabels defines the required labels for Prefetcher contexts
2330 type PrefetcherLabels struct {
2331 Bufferpool string
2332 }
2333
2334 // InstanceID generates a unique instance ID using the hardcoded label order from YAML
2335 func (l PrefetcherLabels) InstanceID(contextName string) string {
2336 // Label order from YAML: bufferpool
2337 return contextName + "." + cleanLabelValue(l.Bufferpool)
2338 }
2339
2340 // Prefetcher contains all metric contexts for Prefetcher
2341 var Prefetcher = struct {
2342 PrefetchRatio PrefetcherPrefetchRatioContext
2343 CleanerRatio PrefetcherCleanerRatioContext
2344 PhysicalReads PrefetcherPhysicalReadsContext
2345 AsyncReads PrefetcherAsyncReadsContext
2346 WaitTime PrefetcherWaitTimeContext
2347 UnreadPages PrefetcherUnreadPagesContext
2348 }{
2349 PrefetchRatio: PrefetcherPrefetchRatioContext{
2350 Context: framework.Context[PrefetcherLabels]{
2351 Name: "db2.prefetcher_prefetch_ratio",
2352 Family: "prefetchers",
2353 Title: "Prefetcher Prefetch Ratio",
2354 Units: "percentage",
2355 Type: module.Line,
2356 Priority: 1190,
2357 UpdateEvery: 1,
2358 Dimensions: []framework.Dimension{
2359 {
2360 Name: "ratio",
2361 Algorithm: module.Absolute,
2362 Mul: 1,
2363 Div: 1000,
2364 Precision: 1000,
2365 },
2366 },
2367 LabelKeys: []string{
2368 "bufferpool",
2369 },
2370 },
2371 },
2372 CleanerRatio: PrefetcherCleanerRatioContext{
2373 Context: framework.Context[PrefetcherLabels]{
2374 Name: "db2.prefetcher_cleaner_ratio",
2375 Family: "prefetchers",
2376 Title: "Prefetcher Cleaner Ratio",
2377 Units: "percentage",
2378 Type: module.Line,
2379 Priority: 1191,
2380 UpdateEvery: 1,
2381 Dimensions: []framework.Dimension{
2382 {
2383 Name: "ratio",
2384 Algorithm: module.Absolute,
2385 Mul: 1,
2386 Div: 1000,
2387 Precision: 1000,
2388 },
2389 },
2390 LabelKeys: []string{
2391 "bufferpool",
2392 },
2393 },
2394 },
2395 PhysicalReads: PrefetcherPhysicalReadsContext{
2396 Context: framework.Context[PrefetcherLabels]{
2397 Name: "db2.prefetcher_physical_reads",
2398 Family: "prefetchers",
2399 Title: "Prefetcher Physical Reads",
2400 Units: "reads/s",
2401 Type: module.Line,
2402 Priority: 1192,
2403 UpdateEvery: 1,
2404 Dimensions: []framework.Dimension{
2405 {
2406 Name: "reads",
2407 Algorithm: module.Incremental,
2408 Mul: 1,
2409 Div: 1,
2410 Precision: 1,
2411 },
2412 },
2413 LabelKeys: []string{
2414 "bufferpool",
2415 },
2416 },
2417 },
2418 AsyncReads: PrefetcherAsyncReadsContext{
2419 Context: framework.Context[PrefetcherLabels]{
2420 Name: "db2.prefetcher_async_reads",
2421 Family: "prefetchers",
2422 Title: "Prefetcher Asynchronous Reads",
2423 Units: "reads/s",
2424 Type: module.Line,
2425 Priority: 1193,
2426 UpdateEvery: 1,
2427 Dimensions: []framework.Dimension{
2428 {
2429 Name: "reads",
2430 Algorithm: module.Incremental,
2431 Mul: 1,
2432 Div: 1,
2433 Precision: 1,
2434 },
2435 },
2436 LabelKeys: []string{
2437 "bufferpool",
2438 },
2439 },
2440 },
2441 WaitTime: PrefetcherWaitTimeContext{
2442 Context: framework.Context[PrefetcherLabels]{
2443 Name: "db2.prefetcher_wait_time",
2444 Family: "prefetchers",
2445 Title: "Prefetcher Wait Time",
2446 Units: "milliseconds",
2447 Type: module.Line,
2448 Priority: 1194,
2449 UpdateEvery: 1,
2450 Dimensions: []framework.Dimension{
2451 {
2452 Name: "wait_time",
2453 Algorithm: module.Absolute,
2454 Mul: 1,
2455 Div: 1,
2456 Precision: 1,
2457 },
2458 },
2459 LabelKeys: []string{
2460 "bufferpool",
2461 },
2462 },
2463 },
2464 UnreadPages: PrefetcherUnreadPagesContext{
2465 Context: framework.Context[PrefetcherLabels]{
2466 Name: "db2.prefetcher_unread_pages",
2467 Family: "prefetchers",
2468 Title: "Prefetcher Unread Pages",
2469 Units: "pages/s",
2470 Type: module.Line,
2471 Priority: 1195,
2472 UpdateEvery: 1,
2473 Dimensions: []framework.Dimension{
2474 {
2475 Name: "unread",
2476 Algorithm: module.Incremental,
2477 Mul: 1,
2478 Div: 1,
2479 Precision: 1,
2480 },
2481 },
2482 LabelKeys: []string{
2483 "bufferpool",
2484 },
2485 },
2486 },
2487 }
2488
2489 // --- System ---
2490
2491 // SystemServiceHealthValues defines the type-safe values for System.ServiceHealth context
2492 type SystemServiceHealthValues struct {
2493 Connection int64
2494 Database int64
2495 }
2496
2497 // SystemServiceHealthContext provides type-safe operations for System.ServiceHealth context
2498 type SystemServiceHealthContext struct {
2499 framework.Context[EmptyLabels]
2500 }
2501
2502 // Set provides type-safe dimension setting for System.ServiceHealth context
2503 func (c SystemServiceHealthContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemServiceHealthValues) {
2504 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
2505 "connection": values.Connection,
2506 "database": values.Database,
2507 })
2508 }
2509
2510 // SetUpdateEvery sets the update interval for this instance
2511 func (c SystemServiceHealthContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
2512 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
2513 }
2514
2515 // SystemConnectionsValues defines the type-safe values for System.Connections context
2516 type SystemConnectionsValues struct {
2517 Total int64
2518 Active int64
2519 Executing int64
2520 Idle int64
2521 Max_allowed int64
2522 }
2523
2524 // SystemConnectionsContext provides type-safe operations for System.Connections context
2525 type SystemConnectionsContext struct {
2526 framework.Context[EmptyLabels]
2527 }
2528
2529 // Set provides type-safe dimension setting for System.Connections context
2530 func (c SystemConnectionsContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemConnectionsValues) {
2531 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
2532 "total": values.Total,
2533 "active": values.Active,
2534 "executing": values.Executing,
2535 "idle": values.Idle,
2536 "max_allowed": values.Max_allowed,
2537 })
2538 }
2539
2540 // SetUpdateEvery sets the update interval for this instance
2541 func (c SystemConnectionsContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
2542 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
2543 }
2544
2545 // SystemLockingValues defines the type-safe values for System.Locking context
2546 type SystemLockingValues struct {
2547 Waits int64
2548 Timeouts int64
2549 Escalations int64
2550 }
2551
2552 // SystemLockingContext provides type-safe operations for System.Locking context
2553 type SystemLockingContext struct {
2554 framework.Context[EmptyLabels]
2555 }
2556
2557 // Set provides type-safe dimension setting for System.Locking context
2558 func (c SystemLockingContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemLockingValues) {
2559 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
2560 "waits": values.Waits,
2561 "timeouts": values.Timeouts,
2562 "escalations": values.Escalations,
2563 })
2564 }
2565
2566 // SetUpdateEvery sets the update interval for this instance
2567 func (c SystemLockingContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
2568 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
2569 }
2570
2571 // SystemDeadlocksValues defines the type-safe values for System.Deadlocks context
2572 type SystemDeadlocksValues struct {
2573 Deadlocks int64
2574 }
2575
2576 // SystemDeadlocksContext provides type-safe operations for System.Deadlocks context
2577 type SystemDeadlocksContext struct {
2578 framework.Context[EmptyLabels]
2579 }
2580
2581 // Set provides type-safe dimension setting for System.Deadlocks context
2582 func (c SystemDeadlocksContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemDeadlocksValues) {
2583 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
2584 "deadlocks": values.Deadlocks,
2585 })
2586 }
2587
2588 // SetUpdateEvery sets the update interval for this instance
2589 func (c SystemDeadlocksContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
2590 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
2591 }
2592
2593 // SystemLockDetailsValues defines the type-safe values for System.LockDetails context
2594 type SystemLockDetailsValues struct {
2595 Active int64
2596 Waiting_agents int64
2597 Memory_pages int64
2598 }
2599
2600 // SystemLockDetailsContext provides type-safe operations for System.LockDetails context
2601 type SystemLockDetailsContext struct {
2602 framework.Context[EmptyLabels]
2603 }
2604
2605 // Set provides type-safe dimension setting for System.LockDetails context
2606 func (c SystemLockDetailsContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemLockDetailsValues) {
2607 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
2608 "active": values.Active,
2609 "waiting_agents": values.Waiting_agents,
2610 "memory_pages": values.Memory_pages,
2611 })
2612 }
2613
2614 // SetUpdateEvery sets the update interval for this instance
2615 func (c SystemLockDetailsContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
2616 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
2617 }
2618
2619 // SystemLockWaitTimeValues defines the type-safe values for System.LockWaitTime context
2620 type SystemLockWaitTimeValues struct {
2621 Wait_time int64
2622 }
2623
2624 // SystemLockWaitTimeContext provides type-safe operations for System.LockWaitTime context
2625 type SystemLockWaitTimeContext struct {
2626 framework.Context[EmptyLabels]
2627 }
2628
2629 // Set provides type-safe dimension setting for System.LockWaitTime context
2630 func (c SystemLockWaitTimeContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemLockWaitTimeValues) {
2631 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
2632 "wait_time": values.Wait_time,
2633 })
2634 }
2635
2636 // SetUpdateEvery sets the update interval for this instance
2637 func (c SystemLockWaitTimeContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
2638 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
2639 }
2640
2641 // SystemSortingValues defines the type-safe values for System.Sorting context
2642 type SystemSortingValues struct {
2643 Sorts int64
2644 Overflows int64
2645 }
2646
2647 // SystemSortingContext provides type-safe operations for System.Sorting context
2648 type SystemSortingContext struct {
2649 framework.Context[EmptyLabels]
2650 }
2651
2652 // Set provides type-safe dimension setting for System.Sorting context
2653 func (c SystemSortingContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemSortingValues) {
2654 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
2655 "sorts": values.Sorts,
2656 "overflows": values.Overflows,
2657 })
2658 }
2659
2660 // SetUpdateEvery sets the update interval for this instance
2661 func (c SystemSortingContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
2662 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
2663 }
2664
2665 // SystemRowActivityValues defines the type-safe values for System.RowActivity context
2666 type SystemRowActivityValues struct {
2667 Read int64
2668 Returned int64
2669 Modified int64
2670 }
2671
2672 // SystemRowActivityContext provides type-safe operations for System.RowActivity context
2673 type SystemRowActivityContext struct {
2674 framework.Context[EmptyLabels]
2675 }
2676
2677 // Set provides type-safe dimension setting for System.RowActivity context
2678 func (c SystemRowActivityContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemRowActivityValues) {
2679 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
2680 "read": values.Read,
2681 "returned": values.Returned,
2682 "modified": values.Modified,
2683 })
2684 }
2685
2686 // SetUpdateEvery sets the update interval for this instance
2687 func (c SystemRowActivityContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
2688 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
2689 }
2690
2691 // SystemBufferpoolHitRatioValues defines the type-safe values for System.BufferpoolHitRatio context
2692 type SystemBufferpoolHitRatioValues struct {
2693 Hits int64
2694 Misses int64
2695 }
2696
2697 // SystemBufferpoolHitRatioContext provides type-safe operations for System.BufferpoolHitRatio context
2698 type SystemBufferpoolHitRatioContext struct {
2699 framework.Context[EmptyLabels]
2700 }
2701
2702 // Set provides type-safe dimension setting for System.BufferpoolHitRatio context
2703 func (c SystemBufferpoolHitRatioContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemBufferpoolHitRatioValues) {
2704 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
2705 "hits": values.Hits,
2706 "misses": values.Misses,
2707 })
2708 }
2709
2710 // SetUpdateEvery sets the update interval for this instance
2711 func (c SystemBufferpoolHitRatioContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
2712 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
2713 }
2714
2715 // SystemBufferpoolDataHitRatioValues defines the type-safe values for System.BufferpoolDataHitRatio context
2716 type SystemBufferpoolDataHitRatioValues struct {
2717 Hits int64
2718 Misses int64
2719 }
2720
2721 // SystemBufferpoolDataHitRatioContext provides type-safe operations for System.BufferpoolDataHitRatio context
2722 type SystemBufferpoolDataHitRatioContext struct {
2723 framework.Context[EmptyLabels]
2724 }
2725
2726 // Set provides type-safe dimension setting for System.BufferpoolDataHitRatio context
2727 func (c SystemBufferpoolDataHitRatioContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemBufferpoolDataHitRatioValues) {
2728 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
2729 "hits": values.Hits,
2730 "misses": values.Misses,
2731 })
2732 }
2733
2734 // SetUpdateEvery sets the update interval for this instance
2735 func (c SystemBufferpoolDataHitRatioContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
2736 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
2737 }
2738
2739 // SystemBufferpoolIndexHitRatioValues defines the type-safe values for System.BufferpoolIndexHitRatio context
2740 type SystemBufferpoolIndexHitRatioValues struct {
2741 Hits int64
2742 Misses int64
2743 }
2744
2745 // SystemBufferpoolIndexHitRatioContext provides type-safe operations for System.BufferpoolIndexHitRatio context
2746 type SystemBufferpoolIndexHitRatioContext struct {
2747 framework.Context[EmptyLabels]
2748 }
2749
2750 // Set provides type-safe dimension setting for System.BufferpoolIndexHitRatio context
2751 func (c SystemBufferpoolIndexHitRatioContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemBufferpoolIndexHitRatioValues) {
2752 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
2753 "hits": values.Hits,
2754 "misses": values.Misses,
2755 })
2756 }
2757
2758 // SetUpdateEvery sets the update interval for this instance
2759 func (c SystemBufferpoolIndexHitRatioContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
2760 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
2761 }
2762
2763 // SystemBufferpoolXDAHitRatioValues defines the type-safe values for System.BufferpoolXDAHitRatio context
2764 type SystemBufferpoolXDAHitRatioValues struct {
2765 Hits int64
2766 Misses int64
2767 }
2768
2769 // SystemBufferpoolXDAHitRatioContext provides type-safe operations for System.BufferpoolXDAHitRatio context
2770 type SystemBufferpoolXDAHitRatioContext struct {
2771 framework.Context[EmptyLabels]
2772 }
2773
2774 // Set provides type-safe dimension setting for System.BufferpoolXDAHitRatio context
2775 func (c SystemBufferpoolXDAHitRatioContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemBufferpoolXDAHitRatioValues) {
2776 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
2777 "hits": values.Hits,
2778 "misses": values.Misses,
2779 })
2780 }
2781
2782 // SetUpdateEvery sets the update interval for this instance
2783 func (c SystemBufferpoolXDAHitRatioContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
2784 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
2785 }
2786
2787 // SystemBufferpoolColumnHitRatioValues defines the type-safe values for System.BufferpoolColumnHitRatio context
2788 type SystemBufferpoolColumnHitRatioValues struct {
2789 Hits int64
2790 Misses int64
2791 }
2792
2793 // SystemBufferpoolColumnHitRatioContext provides type-safe operations for System.BufferpoolColumnHitRatio context
2794 type SystemBufferpoolColumnHitRatioContext struct {
2795 framework.Context[EmptyLabels]
2796 }
2797
2798 // Set provides type-safe dimension setting for System.BufferpoolColumnHitRatio context
2799 func (c SystemBufferpoolColumnHitRatioContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemBufferpoolColumnHitRatioValues) {
2800 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
2801 "hits": values.Hits,
2802 "misses": values.Misses,
2803 })
2804 }
2805
2806 // SetUpdateEvery sets the update interval for this instance
2807 func (c SystemBufferpoolColumnHitRatioContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
2808 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
2809 }
2810
2811 // SystemBufferpoolReadsValues defines the type-safe values for System.BufferpoolReads context
2812 type SystemBufferpoolReadsValues struct {
2813 Logical int64
2814 Physical int64
2815 }
2816
2817 // SystemBufferpoolReadsContext provides type-safe operations for System.BufferpoolReads context
2818 type SystemBufferpoolReadsContext struct {
2819 framework.Context[EmptyLabels]
2820 }
2821
2822 // Set provides type-safe dimension setting for System.BufferpoolReads context
2823 func (c SystemBufferpoolReadsContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemBufferpoolReadsValues) {
2824 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
2825 "logical": values.Logical,
2826 "physical": values.Physical,
2827 })
2828 }
2829
2830 // SetUpdateEvery sets the update interval for this instance
2831 func (c SystemBufferpoolReadsContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
2832 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
2833 }
2834
2835 // SystemBufferpoolDataReadsValues defines the type-safe values for System.BufferpoolDataReads context
2836 type SystemBufferpoolDataReadsValues struct {
2837 Logical int64
2838 Physical int64
2839 }
2840
2841 // SystemBufferpoolDataReadsContext provides type-safe operations for System.BufferpoolDataReads context
2842 type SystemBufferpoolDataReadsContext struct {
2843 framework.Context[EmptyLabels]
2844 }
2845
2846 // Set provides type-safe dimension setting for System.BufferpoolDataReads context
2847 func (c SystemBufferpoolDataReadsContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemBufferpoolDataReadsValues) {
2848 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
2849 "logical": values.Logical,
2850 "physical": values.Physical,
2851 })
2852 }
2853
2854 // SetUpdateEvery sets the update interval for this instance
2855 func (c SystemBufferpoolDataReadsContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
2856 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
2857 }
2858
2859 // SystemBufferpoolIndexReadsValues defines the type-safe values for System.BufferpoolIndexReads context
2860 type SystemBufferpoolIndexReadsValues struct {
2861 Logical int64
2862 Physical int64
2863 }
2864
2865 // SystemBufferpoolIndexReadsContext provides type-safe operations for System.BufferpoolIndexReads context
2866 type SystemBufferpoolIndexReadsContext struct {
2867 framework.Context[EmptyLabels]
2868 }
2869
2870 // Set provides type-safe dimension setting for System.BufferpoolIndexReads context
2871 func (c SystemBufferpoolIndexReadsContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemBufferpoolIndexReadsValues) {
2872 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
2873 "logical": values.Logical,
2874 "physical": values.Physical,
2875 })
2876 }
2877
2878 // SetUpdateEvery sets the update interval for this instance
2879 func (c SystemBufferpoolIndexReadsContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
2880 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
2881 }
2882
2883 // SystemBufferpoolXDAReadsValues defines the type-safe values for System.BufferpoolXDAReads context
2884 type SystemBufferpoolXDAReadsValues struct {
2885 Logical int64
2886 Physical int64
2887 }
2888
2889 // SystemBufferpoolXDAReadsContext provides type-safe operations for System.BufferpoolXDAReads context
2890 type SystemBufferpoolXDAReadsContext struct {
2891 framework.Context[EmptyLabels]
2892 }
2893
2894 // Set provides type-safe dimension setting for System.BufferpoolXDAReads context
2895 func (c SystemBufferpoolXDAReadsContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemBufferpoolXDAReadsValues) {
2896 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
2897 "logical": values.Logical,
2898 "physical": values.Physical,
2899 })
2900 }
2901
2902 // SetUpdateEvery sets the update interval for this instance
2903 func (c SystemBufferpoolXDAReadsContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
2904 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
2905 }
2906
2907 // SystemBufferpoolColumnReadsValues defines the type-safe values for System.BufferpoolColumnReads context
2908 type SystemBufferpoolColumnReadsValues struct {
2909 Logical int64
2910 Physical int64
2911 }
2912
2913 // SystemBufferpoolColumnReadsContext provides type-safe operations for System.BufferpoolColumnReads context
2914 type SystemBufferpoolColumnReadsContext struct {
2915 framework.Context[EmptyLabels]
2916 }
2917
2918 // Set provides type-safe dimension setting for System.BufferpoolColumnReads context
2919 func (c SystemBufferpoolColumnReadsContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemBufferpoolColumnReadsValues) {
2920 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
2921 "logical": values.Logical,
2922 "physical": values.Physical,
2923 })
2924 }
2925
2926 // SetUpdateEvery sets the update interval for this instance
2927 func (c SystemBufferpoolColumnReadsContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
2928 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
2929 }
2930
2931 // SystemBufferpoolWritesValues defines the type-safe values for System.BufferpoolWrites context
2932 type SystemBufferpoolWritesValues struct {
2933 Writes int64
2934 }
2935
2936 // SystemBufferpoolWritesContext provides type-safe operations for System.BufferpoolWrites context
2937 type SystemBufferpoolWritesContext struct {
2938 framework.Context[EmptyLabels]
2939 }
2940
2941 // Set provides type-safe dimension setting for System.BufferpoolWrites context
2942 func (c SystemBufferpoolWritesContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemBufferpoolWritesValues) {
2943 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
2944 "writes": values.Writes,
2945 })
2946 }
2947
2948 // SetUpdateEvery sets the update interval for this instance
2949 func (c SystemBufferpoolWritesContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
2950 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
2951 }
2952
2953 // SystemLogSpaceValues defines the type-safe values for System.LogSpace context
2954 type SystemLogSpaceValues struct {
2955 Used int64
2956 Available int64
2957 }
2958
2959 // SystemLogSpaceContext provides type-safe operations for System.LogSpace context
2960 type SystemLogSpaceContext struct {
2961 framework.Context[EmptyLabels]
2962 }
2963
2964 // Set provides type-safe dimension setting for System.LogSpace context
2965 func (c SystemLogSpaceContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemLogSpaceValues) {
2966 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
2967 "used": values.Used,
2968 "available": values.Available,
2969 })
2970 }
2971
2972 // SetUpdateEvery sets the update interval for this instance
2973 func (c SystemLogSpaceContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
2974 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
2975 }
2976
2977 // SystemLogUtilizationValues defines the type-safe values for System.LogUtilization context
2978 type SystemLogUtilizationValues struct {
2979 Utilization int64
2980 }
2981
2982 // SystemLogUtilizationContext provides type-safe operations for System.LogUtilization context
2983 type SystemLogUtilizationContext struct {
2984 framework.Context[EmptyLabels]
2985 }
2986
2987 // Set provides type-safe dimension setting for System.LogUtilization context
2988 func (c SystemLogUtilizationContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemLogUtilizationValues) {
2989 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
2990 "utilization": values.Utilization,
2991 })
2992 }
2993
2994 // SetUpdateEvery sets the update interval for this instance
2995 func (c SystemLogUtilizationContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
2996 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
2997 }
2998
2999 // SystemLogIOValues defines the type-safe values for System.LogIO context
3000 type SystemLogIOValues struct {
3001 Reads int64
3002 Writes int64
3003 }
3004
3005 // SystemLogIOContext provides type-safe operations for System.LogIO context
3006 type SystemLogIOContext struct {
3007 framework.Context[EmptyLabels]
3008 }
3009
3010 // Set provides type-safe dimension setting for System.LogIO context
3011 func (c SystemLogIOContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemLogIOValues) {
3012 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
3013 "reads": values.Reads,
3014 "writes": values.Writes,
3015 })
3016 }
3017
3018 // SetUpdateEvery sets the update interval for this instance
3019 func (c SystemLogIOContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
3020 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
3021 }
3022
3023 // SystemLogOperationsValues defines the type-safe values for System.LogOperations context
3024 type SystemLogOperationsValues struct {
3025 Commits int64
3026 Rollbacks int64
3027 Reads int64
3028 Writes int64
3029 }
3030
3031 // SystemLogOperationsContext provides type-safe operations for System.LogOperations context
3032 type SystemLogOperationsContext struct {
3033 framework.Context[EmptyLabels]
3034 }
3035
3036 // Set provides type-safe dimension setting for System.LogOperations context
3037 func (c SystemLogOperationsContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemLogOperationsValues) {
3038 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
3039 "commits": values.Commits,
3040 "rollbacks": values.Rollbacks,
3041 "reads": values.Reads,
3042 "writes": values.Writes,
3043 })
3044 }
3045
3046 // SetUpdateEvery sets the update interval for this instance
3047 func (c SystemLogOperationsContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
3048 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
3049 }
3050
3051 // SystemLogTimingValues defines the type-safe values for System.LogTiming context
3052 type SystemLogTimingValues struct {
3053 Avg_commit int64
3054 Avg_read int64
3055 Avg_write int64
3056 }
3057
3058 // SystemLogTimingContext provides type-safe operations for System.LogTiming context
3059 type SystemLogTimingContext struct {
3060 framework.Context[EmptyLabels]
3061 }
3062
3063 // Set provides type-safe dimension setting for System.LogTiming context
3064 func (c SystemLogTimingContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemLogTimingValues) {
3065 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
3066 "avg_commit": values.Avg_commit,
3067 "avg_read": values.Avg_read,
3068 "avg_write": values.Avg_write,
3069 })
3070 }
3071
3072 // SetUpdateEvery sets the update interval for this instance
3073 func (c SystemLogTimingContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
3074 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
3075 }
3076
3077 // SystemLogBufferEventsValues defines the type-safe values for System.LogBufferEvents context
3078 type SystemLogBufferEventsValues struct {
3079 Buffer_full int64
3080 }
3081
3082 // SystemLogBufferEventsContext provides type-safe operations for System.LogBufferEvents context
3083 type SystemLogBufferEventsContext struct {
3084 framework.Context[EmptyLabels]
3085 }
3086
3087 // Set provides type-safe dimension setting for System.LogBufferEvents context
3088 func (c SystemLogBufferEventsContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemLogBufferEventsValues) {
3089 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
3090 "buffer_full": values.Buffer_full,
3091 })
3092 }
3093
3094 // SetUpdateEvery sets the update interval for this instance
3095 func (c SystemLogBufferEventsContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
3096 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
3097 }
3098
3099 // SystemLongRunningQueriesValues defines the type-safe values for System.LongRunningQueries context
3100 type SystemLongRunningQueriesValues struct {
3101 Total int64
3102 Warning int64
3103 Critical int64
3104 }
3105
3106 // SystemLongRunningQueriesContext provides type-safe operations for System.LongRunningQueries context
3107 type SystemLongRunningQueriesContext struct {
3108 framework.Context[EmptyLabels]
3109 }
3110
3111 // Set provides type-safe dimension setting for System.LongRunningQueries context
3112 func (c SystemLongRunningQueriesContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemLongRunningQueriesValues) {
3113 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
3114 "total": values.Total,
3115 "warning": values.Warning,
3116 "critical": values.Critical,
3117 })
3118 }
3119
3120 // SetUpdateEvery sets the update interval for this instance
3121 func (c SystemLongRunningQueriesContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
3122 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
3123 }
3124
3125 // SystemBackupStatusValues defines the type-safe values for System.BackupStatus context
3126 type SystemBackupStatusValues struct {
3127 Status int64
3128 }
3129
3130 // SystemBackupStatusContext provides type-safe operations for System.BackupStatus context
3131 type SystemBackupStatusContext struct {
3132 framework.Context[EmptyLabels]
3133 }
3134
3135 // Set provides type-safe dimension setting for System.BackupStatus context
3136 func (c SystemBackupStatusContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemBackupStatusValues) {
3137 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
3138 "status": values.Status,
3139 })
3140 }
3141
3142 // SetUpdateEvery sets the update interval for this instance
3143 func (c SystemBackupStatusContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
3144 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
3145 }
3146
3147 // SystemBackupAgeValues defines the type-safe values for System.BackupAge context
3148 type SystemBackupAgeValues struct {
3149 Full int64
3150 Incremental int64
3151 }
3152
3153 // SystemBackupAgeContext provides type-safe operations for System.BackupAge context
3154 type SystemBackupAgeContext struct {
3155 framework.Context[EmptyLabels]
3156 }
3157
3158 // Set provides type-safe dimension setting for System.BackupAge context
3159 func (c SystemBackupAgeContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemBackupAgeValues) {
3160 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
3161 "full": values.Full,
3162 "incremental": values.Incremental,
3163 })
3164 }
3165
3166 // SetUpdateEvery sets the update interval for this instance
3167 func (c SystemBackupAgeContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
3168 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
3169 }
3170
3171 // SystemFederationConnectionsValues defines the type-safe values for System.FederationConnections context
3172 type SystemFederationConnectionsValues struct {
3173 Active int64
3174 Idle int64
3175 }
3176
3177 // SystemFederationConnectionsContext provides type-safe operations for System.FederationConnections context
3178 type SystemFederationConnectionsContext struct {
3179 framework.Context[EmptyLabels]
3180 }
3181
3182 // Set provides type-safe dimension setting for System.FederationConnections context
3183 func (c SystemFederationConnectionsContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemFederationConnectionsValues) {
3184 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
3185 "active": values.Active,
3186 "idle": values.Idle,
3187 })
3188 }
3189
3190 // SetUpdateEvery sets the update interval for this instance
3191 func (c SystemFederationConnectionsContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
3192 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
3193 }
3194
3195 // SystemFederationOperationsValues defines the type-safe values for System.FederationOperations context
3196 type SystemFederationOperationsValues struct {
3197 Rows_read int64
3198 Selects int64
3199 Waits int64
3200 }
3201
3202 // SystemFederationOperationsContext provides type-safe operations for System.FederationOperations context
3203 type SystemFederationOperationsContext struct {
3204 framework.Context[EmptyLabels]
3205 }
3206
3207 // Set provides type-safe dimension setting for System.FederationOperations context
3208 func (c SystemFederationOperationsContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemFederationOperationsValues) {
3209 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
3210 "rows_read": values.Rows_read,
3211 "selects": values.Selects,
3212 "waits": values.Waits,
3213 })
3214 }
3215
3216 // SetUpdateEvery sets the update interval for this instance
3217 func (c SystemFederationOperationsContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
3218 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
3219 }
3220
3221 // SystemDatabaseStatusValues defines the type-safe values for System.DatabaseStatus context
3222 type SystemDatabaseStatusValues struct {
3223 Active int64
3224 Inactive int64
3225 }
3226
3227 // SystemDatabaseStatusContext provides type-safe operations for System.DatabaseStatus context
3228 type SystemDatabaseStatusContext struct {
3229 framework.Context[EmptyLabels]
3230 }
3231
3232 // Set provides type-safe dimension setting for System.DatabaseStatus context
3233 func (c SystemDatabaseStatusContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemDatabaseStatusValues) {
3234 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
3235 "active": values.Active,
3236 "inactive": values.Inactive,
3237 })
3238 }
3239
3240 // SetUpdateEvery sets the update interval for this instance
3241 func (c SystemDatabaseStatusContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
3242 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
3243 }
3244
3245 // SystemDatabaseCountValues defines the type-safe values for System.DatabaseCount context
3246 type SystemDatabaseCountValues struct {
3247 Active int64
3248 Inactive int64
3249 }
3250
3251 // SystemDatabaseCountContext provides type-safe operations for System.DatabaseCount context
3252 type SystemDatabaseCountContext struct {
3253 framework.Context[EmptyLabels]
3254 }
3255
3256 // Set provides type-safe dimension setting for System.DatabaseCount context
3257 func (c SystemDatabaseCountContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemDatabaseCountValues) {
3258 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
3259 "active": values.Active,
3260 "inactive": values.Inactive,
3261 })
3262 }
3263
3264 // SetUpdateEvery sets the update interval for this instance
3265 func (c SystemDatabaseCountContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
3266 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
3267 }
3268
3269 // SystemCPUUsageValues defines the type-safe values for System.CPUUsage context
3270 type SystemCPUUsageValues struct {
3271 User int64
3272 System int64
3273 Idle int64
3274 Iowait int64
3275 }
3276
3277 // SystemCPUUsageContext provides type-safe operations for System.CPUUsage context
3278 type SystemCPUUsageContext struct {
3279 framework.Context[EmptyLabels]
3280 }
3281
3282 // Set provides type-safe dimension setting for System.CPUUsage context
3283 func (c SystemCPUUsageContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemCPUUsageValues) {
3284 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
3285 "user": values.User,
3286 "system": values.System,
3287 "idle": values.Idle,
3288 "iowait": values.Iowait,
3289 })
3290 }
3291
3292 // SetUpdateEvery sets the update interval for this instance
3293 func (c SystemCPUUsageContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
3294 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
3295 }
3296
3297 // SystemActiveConnectionsValues defines the type-safe values for System.ActiveConnections context
3298 type SystemActiveConnectionsValues struct {
3299 Active int64
3300 Total int64
3301 }
3302
3303 // SystemActiveConnectionsContext provides type-safe operations for System.ActiveConnections context
3304 type SystemActiveConnectionsContext struct {
3305 framework.Context[EmptyLabels]
3306 }
3307
3308 // Set provides type-safe dimension setting for System.ActiveConnections context
3309 func (c SystemActiveConnectionsContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemActiveConnectionsValues) {
3310 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
3311 "active": values.Active,
3312 "total": values.Total,
3313 })
3314 }
3315
3316 // SetUpdateEvery sets the update interval for this instance
3317 func (c SystemActiveConnectionsContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
3318 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
3319 }
3320
3321 // SystemMemoryUsageValues defines the type-safe values for System.MemoryUsage context
3322 type SystemMemoryUsageValues struct {
3323 Database int64
3324 Instance int64
3325 Bufferpool int64
3326 Shared_sort int64
3327 }
3328
3329 // SystemMemoryUsageContext provides type-safe operations for System.MemoryUsage context
3330 type SystemMemoryUsageContext struct {
3331 framework.Context[EmptyLabels]
3332 }
3333
3334 // Set provides type-safe dimension setting for System.MemoryUsage context
3335 func (c SystemMemoryUsageContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemMemoryUsageValues) {
3336 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
3337 "database": values.Database,
3338 "instance": values.Instance,
3339 "bufferpool": values.Bufferpool,
3340 "shared_sort": values.Shared_sort,
3341 })
3342 }
3343
3344 // SetUpdateEvery sets the update interval for this instance
3345 func (c SystemMemoryUsageContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
3346 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
3347 }
3348
3349 // SystemSQLStatementsValues defines the type-safe values for System.SQLStatements context
3350 type SystemSQLStatementsValues struct {
3351 Selects int64
3352 Modifications int64
3353 }
3354
3355 // SystemSQLStatementsContext provides type-safe operations for System.SQLStatements context
3356 type SystemSQLStatementsContext struct {
3357 framework.Context[EmptyLabels]
3358 }
3359
3360 // Set provides type-safe dimension setting for System.SQLStatements context
3361 func (c SystemSQLStatementsContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemSQLStatementsValues) {
3362 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
3363 "selects": values.Selects,
3364 "modifications": values.Modifications,
3365 })
3366 }
3367
3368 // SetUpdateEvery sets the update interval for this instance
3369 func (c SystemSQLStatementsContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
3370 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
3371 }
3372
3373 // SystemTransactionActivityValues defines the type-safe values for System.TransactionActivity context
3374 type SystemTransactionActivityValues struct {
3375 Committed int64
3376 Aborted int64
3377 }
3378
3379 // SystemTransactionActivityContext provides type-safe operations for System.TransactionActivity context
3380 type SystemTransactionActivityContext struct {
3381 framework.Context[EmptyLabels]
3382 }
3383
3384 // Set provides type-safe dimension setting for System.TransactionActivity context
3385 func (c SystemTransactionActivityContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemTransactionActivityValues) {
3386 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
3387 "committed": values.Committed,
3388 "aborted": values.Aborted,
3389 })
3390 }
3391
3392 // SetUpdateEvery sets the update interval for this instance
3393 func (c SystemTransactionActivityContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
3394 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
3395 }
3396
3397 // SystemTimeSpentValues defines the type-safe values for System.TimeSpent context
3398 type SystemTimeSpentValues struct {
3399 Direct_read int64
3400 Direct_write int64
3401 Pool_read int64
3402 Pool_write int64
3403 }
3404
3405 // SystemTimeSpentContext provides type-safe operations for System.TimeSpent context
3406 type SystemTimeSpentContext struct {
3407 framework.Context[EmptyLabels]
3408 }
3409
3410 // Set provides type-safe dimension setting for System.TimeSpent context
3411 func (c SystemTimeSpentContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemTimeSpentValues) {
3412 state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{
3413 "direct_read": values.Direct_read,
3414 "direct_write": values.Direct_write,
3415 "pool_read": values.Pool_read,
3416 "pool_write": values.Pool_write,
3417 })
3418 }
3419
3420 // SetUpdateEvery sets the update interval for this instance
3421 func (c SystemTimeSpentContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) {
3422 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery)
3423 }
3424
3425 // System contains all metric contexts for System
3426 var System = struct {
3427 ServiceHealth SystemServiceHealthContext
3428 Connections SystemConnectionsContext
3429 Locking SystemLockingContext
3430 Deadlocks SystemDeadlocksContext
3431 LockDetails SystemLockDetailsContext
3432 LockWaitTime SystemLockWaitTimeContext
3433 Sorting SystemSortingContext
3434 RowActivity SystemRowActivityContext
3435 BufferpoolHitRatio SystemBufferpoolHitRatioContext
3436 BufferpoolDataHitRatio SystemBufferpoolDataHitRatioContext
3437 BufferpoolIndexHitRatio SystemBufferpoolIndexHitRatioContext
3438 BufferpoolXDAHitRatio SystemBufferpoolXDAHitRatioContext
3439 BufferpoolColumnHitRatio SystemBufferpoolColumnHitRatioContext
3440 BufferpoolReads SystemBufferpoolReadsContext
3441 BufferpoolDataReads SystemBufferpoolDataReadsContext
3442 BufferpoolIndexReads SystemBufferpoolIndexReadsContext
3443 BufferpoolXDAReads SystemBufferpoolXDAReadsContext
3444 BufferpoolColumnReads SystemBufferpoolColumnReadsContext
3445 BufferpoolWrites SystemBufferpoolWritesContext
3446 LogSpace SystemLogSpaceContext
3447 LogUtilization SystemLogUtilizationContext
3448 LogIO SystemLogIOContext
3449 LogOperations SystemLogOperationsContext
3450 LogTiming SystemLogTimingContext
3451 LogBufferEvents SystemLogBufferEventsContext
3452 LongRunningQueries SystemLongRunningQueriesContext
3453 BackupStatus SystemBackupStatusContext
3454 BackupAge SystemBackupAgeContext
3455 FederationConnections SystemFederationConnectionsContext
3456 FederationOperations SystemFederationOperationsContext
3457 DatabaseStatus SystemDatabaseStatusContext
3458 DatabaseCount SystemDatabaseCountContext
3459 CPUUsage SystemCPUUsageContext
3460 ActiveConnections SystemActiveConnectionsContext
3461 MemoryUsage SystemMemoryUsageContext
3462 SQLStatements SystemSQLStatementsContext
3463 TransactionActivity SystemTransactionActivityContext
3464 TimeSpent SystemTimeSpentContext
3465 }{
3466 ServiceHealth: SystemServiceHealthContext{
3467 Context: framework.Context[EmptyLabels]{
3468 Name: "db2.service_health",
3469 Family: "overview",
3470 Title: "Service Health Status",
3471 Units: "status",
3472 Type: module.Line,
3473 Priority: 990,
3474 UpdateEvery: 1,
3475 Dimensions: []framework.Dimension{
3476 {
3477 Name: "connection",
3478 Algorithm: module.Absolute,
3479 Mul: 1,
3480 Div: 1,
3481 Precision: 1,
3482 },
3483 {
3484 Name: "database",
3485 Algorithm: module.Absolute,
3486 Mul: 1,
3487 Div: 1,
3488 Precision: 1,
3489 },
3490 },
3491 LabelKeys: []string{},
3492 },
3493 },
3494 Connections: SystemConnectionsContext{
3495 Context: framework.Context[EmptyLabels]{
3496 Name: "db2.connections",
3497 Family: "connections/overview",
3498 Title: "Database Connections",
3499 Units: "connections",
3500 Type: module.Line,
3501 Priority: 1000,
3502 UpdateEvery: 1,
3503 Dimensions: []framework.Dimension{
3504 {
3505 Name: "total",
3506 Algorithm: module.Absolute,
3507 Mul: 1,
3508 Div: 1,
3509 Precision: 1,
3510 },
3511 {
3512 Name: "active",
3513 Algorithm: module.Absolute,
3514 Mul: 1,
3515 Div: 1,
3516 Precision: 1,
3517 },
3518 {
3519 Name: "executing",
3520 Algorithm: module.Absolute,
3521 Mul: 1,
3522 Div: 1,
3523 Precision: 1,
3524 },
3525 {
3526 Name: "idle",
3527 Algorithm: module.Absolute,
3528 Mul: 1,
3529 Div: 1,
3530 Precision: 1,
3531 },
3532 {
3533 Name: "max_allowed",
3534 Algorithm: module.Absolute,
3535 Mul: 1,
3536 Div: 1,
3537 Precision: 1,
3538 },
3539 },
3540 LabelKeys: []string{},
3541 },
3542 },
3543 Locking: SystemLockingContext{
3544 Context: framework.Context[EmptyLabels]{
3545 Name: "db2.locking",
3546 Family: "locking",
3547 Title: "Database Locking",
3548 Units: "events/s",
3549 Type: module.Line,
3550 Priority: 1010,
3551 UpdateEvery: 1,
3552 Dimensions: []framework.Dimension{
3553 {
3554 Name: "waits",
3555 Algorithm: module.Incremental,
3556 Mul: 1,
3557 Div: 1,
3558 Precision: 1,
3559 },
3560 {
3561 Name: "timeouts",
3562 Algorithm: module.Incremental,
3563 Mul: 1,
3564 Div: 1,
3565 Precision: 1,
3566 },
3567 {
3568 Name: "escalations",
3569 Algorithm: module.Incremental,
3570 Mul: 1,
3571 Div: 1,
3572 Precision: 1,
3573 },
3574 },
3575 LabelKeys: []string{},
3576 },
3577 },
3578 Deadlocks: SystemDeadlocksContext{
3579 Context: framework.Context[EmptyLabels]{
3580 Name: "db2.deadlocks",
3581 Family: "locking",
3582 Title: "Database Deadlocks",
3583 Units: "deadlocks/s",
3584 Type: module.Line,
3585 Priority: 1011,
3586 UpdateEvery: 1,
3587 Dimensions: []framework.Dimension{
3588 {
3589 Name: "deadlocks",
3590 Algorithm: module.Incremental,
3591 Mul: 1,
3592 Div: 1,
3593 Precision: 1,
3594 },
3595 },
3596 LabelKeys: []string{},
3597 },
3598 },
3599 LockDetails: SystemLockDetailsContext{
3600 Context: framework.Context[EmptyLabels]{
3601 Name: "db2.lock_details",
3602 Family: "locking",
3603 Title: "Lock Details",
3604 Units: "locks",
3605 Type: module.Line,
3606 Priority: 1012,
3607 UpdateEvery: 1,
3608 Dimensions: []framework.Dimension{
3609 {
3610 Name: "active",
3611 Algorithm: module.Absolute,
3612 Mul: 1,
3613 Div: 1,
3614 Precision: 1,
3615 },
3616 {
3617 Name: "waiting_agents",
3618 Algorithm: module.Absolute,
3619 Mul: 1,
3620 Div: 1,
3621 Precision: 1,
3622 },
3623 {
3624 Name: "memory_pages",
3625 Algorithm: module.Absolute,
3626 Mul: 1,
3627 Div: 1,
3628 Precision: 1,
3629 },
3630 },
3631 LabelKeys: []string{},
3632 },
3633 },
3634 LockWaitTime: SystemLockWaitTimeContext{
3635 Context: framework.Context[EmptyLabels]{
3636 Name: "db2.lock_wait_time",
3637 Family: "locking",
3638 Title: "Average Lock Wait Time",
3639 Units: "milliseconds",
3640 Type: module.Line,
3641 Priority: 1013,
3642 UpdateEvery: 1,
3643 Dimensions: []framework.Dimension{
3644 {
3645 Name: "wait_time",
3646 Algorithm: module.Absolute,
3647 Mul: 1,
3648 Div: 1000,
3649 Precision: 1000,
3650 },
3651 },
3652 LabelKeys: []string{},
3653 },
3654 },
3655 Sorting: SystemSortingContext{
3656 Context: framework.Context[EmptyLabels]{
3657 Name: "db2.sorting",
3658 Family: "activity/sorting",
3659 Title: "Database Sorting",
3660 Units: "sorts/s",
3661 Type: module.Stacked,
3662 Priority: 1020,
3663 UpdateEvery: 1,
3664 Dimensions: []framework.Dimension{
3665 {
3666 Name: "sorts",
3667 Algorithm: module.Incremental,
3668 Mul: 1,
3669 Div: 1,
3670 Precision: 1,
3671 },
3672 {
3673 Name: "overflows",
3674 Algorithm: module.Incremental,
3675 Mul: 1,
3676 Div: 1,
3677 Precision: 1,
3678 },
3679 },
3680 LabelKeys: []string{},
3681 },
3682 },
3683 RowActivity: SystemRowActivityContext{
3684 Context: framework.Context[EmptyLabels]{
3685 Name: "db2.row_activity",
3686 Family: "activity/rows",
3687 Title: "Row Activity",
3688 Units: "rows/s",
3689 Type: module.Area,
3690 Priority: 1030,
3691 UpdateEvery: 1,
3692 Dimensions: []framework.Dimension{
3693 {
3694 Name: "read",
3695 Algorithm: module.Incremental,
3696 Mul: 1,
3697 Div: 1,
3698 Precision: 1,
3699 },
3700 {
3701 Name: "returned",
3702 Algorithm: module.Incremental,
3703 Mul: 1,
3704 Div: 1,
3705 Precision: 1,
3706 },
3707 {
3708 Name: "modified",
3709 Algorithm: module.Incremental,
3710 Mul: -1,
3711 Div: 1,
3712 Precision: 1,
3713 },
3714 },
3715 LabelKeys: []string{},
3716 },
3717 },
3718 BufferpoolHitRatio: SystemBufferpoolHitRatioContext{
3719 Context: framework.Context[EmptyLabels]{
3720 Name: "db2.bufferpool_hit_ratio",
3721 Family: "bufferpools/overview",
3722 Title: "Buffer Pool Hit Ratio",
3723 Units: "percentage",
3724 Type: module.Line,
3725 Priority: 1040,
3726 UpdateEvery: 1,
3727 Dimensions: []framework.Dimension{
3728 {
3729 Name: "hits",
3730 Algorithm: module.Absolute,
3731 Mul: 1,
3732 Div: 1000,
3733 Precision: 1000,
3734 },
3735 {
3736 Name: "misses",
3737 Algorithm: module.Absolute,
3738 Mul: 1,
3739 Div: 1000,
3740 Precision: 1000,
3741 },
3742 },
3743 LabelKeys: []string{},
3744 },
3745 },
3746 BufferpoolDataHitRatio: SystemBufferpoolDataHitRatioContext{
3747 Context: framework.Context[EmptyLabels]{
3748 Name: "db2.bufferpool_data_hit_ratio",
3749 Family: "bufferpools/data",
3750 Title: "Buffer Pool Data Page Hit Ratio",
3751 Units: "percentage",
3752 Type: module.Line,
3753 Priority: 1041,
3754 UpdateEvery: 1,
3755 Dimensions: []framework.Dimension{
3756 {
3757 Name: "hits",
3758 Algorithm: module.Absolute,
3759 Mul: 1,
3760 Div: 1000,
3761 Precision: 1000,
3762 },
3763 {
3764 Name: "misses",
3765 Algorithm: module.Absolute,
3766 Mul: 1,
3767 Div: 1000,
3768 Precision: 1000,
3769 },
3770 },
3771 LabelKeys: []string{},
3772 },
3773 },
3774 BufferpoolIndexHitRatio: SystemBufferpoolIndexHitRatioContext{
3775 Context: framework.Context[EmptyLabels]{
3776 Name: "db2.bufferpool_index_hit_ratio",
3777 Family: "bufferpools/index",
3778 Title: "Buffer Pool Index Page Hit Ratio",
3779 Units: "percentage",
3780 Type: module.Line,
3781 Priority: 1042,
3782 UpdateEvery: 1,
3783 Dimensions: []framework.Dimension{
3784 {
3785 Name: "hits",
3786 Algorithm: module.Absolute,
3787 Mul: 1,
3788 Div: 1000,
3789 Precision: 1000,
3790 },
3791 {
3792 Name: "misses",
3793 Algorithm: module.Absolute,
3794 Mul: 1,
3795 Div: 1000,
3796 Precision: 1000,
3797 },
3798 },
3799 LabelKeys: []string{},
3800 },
3801 },
3802 BufferpoolXDAHitRatio: SystemBufferpoolXDAHitRatioContext{
3803 Context: framework.Context[EmptyLabels]{
3804 Name: "db2.bufferpool_xda_hit_ratio",
3805 Family: "bufferpools/xda",
3806 Title: "Buffer Pool XDA Page Hit Ratio",
3807 Units: "percentage",
3808 Type: module.Line,
3809 Priority: 1043,
3810 UpdateEvery: 1,
3811 Dimensions: []framework.Dimension{
3812 {
3813 Name: "hits",
3814 Algorithm: module.Absolute,
3815 Mul: 1,
3816 Div: 1000,
3817 Precision: 1000,
3818 },
3819 {
3820 Name: "misses",
3821 Algorithm: module.Absolute,
3822 Mul: 1,
3823 Div: 1000,
3824 Precision: 1000,
3825 },
3826 },
3827 LabelKeys: []string{},
3828 },
3829 },
3830 BufferpoolColumnHitRatio: SystemBufferpoolColumnHitRatioContext{
3831 Context: framework.Context[EmptyLabels]{
3832 Name: "db2.bufferpool_column_hit_ratio",
3833 Family: "bufferpools/columns",
3834 Title: "Buffer Pool Column Page Hit Ratio",
3835 Units: "percentage",
3836 Type: module.Line,
3837 Priority: 1044,
3838 UpdateEvery: 1,
3839 Dimensions: []framework.Dimension{
3840 {
3841 Name: "hits",
3842 Algorithm: module.Absolute,
3843 Mul: 1,
3844 Div: 1000,
3845 Precision: 1000,
3846 },
3847 {
3848 Name: "misses",
3849 Algorithm: module.Absolute,
3850 Mul: 1,
3851 Div: 1000,
3852 Precision: 1000,
3853 },
3854 },
3855 LabelKeys: []string{},
3856 },
3857 },
3858 BufferpoolReads: SystemBufferpoolReadsContext{
3859 Context: framework.Context[EmptyLabels]{
3860 Name: "db2.bufferpool_reads",
3861 Family: "bufferpools/overview",
3862 Title: "Buffer Pool Reads",
3863 Units: "reads/s",
3864 Type: module.Stacked,
3865 Priority: 1045,
3866 UpdateEvery: 1,
3867 Dimensions: []framework.Dimension{
3868 {
3869 Name: "logical",
3870 Algorithm: module.Incremental,
3871 Mul: 1,
3872 Div: 1,
3873 Precision: 1,
3874 },
3875 {
3876 Name: "physical",
3877 Algorithm: module.Incremental,
3878 Mul: 1,
3879 Div: 1,
3880 Precision: 1,
3881 },
3882 },
3883 LabelKeys: []string{},
3884 },
3885 },
3886 BufferpoolDataReads: SystemBufferpoolDataReadsContext{
3887 Context: framework.Context[EmptyLabels]{
3888 Name: "db2.bufferpool_data_reads",
3889 Family: "bufferpools/data",
3890 Title: "Buffer Pool Data Page Reads",
3891 Units: "reads/s",
3892 Type: module.Stacked,
3893 Priority: 1043,
3894 UpdateEvery: 1,
3895 Dimensions: []framework.Dimension{
3896 {
3897 Name: "logical",
3898 Algorithm: module.Incremental,
3899 Mul: 1,
3900 Div: 1,
3901 Precision: 1,
3902 },
3903 {
3904 Name: "physical",
3905 Algorithm: module.Incremental,
3906 Mul: 1,
3907 Div: 1,
3908 Precision: 1,
3909 },
3910 },
3911 LabelKeys: []string{},
3912 },
3913 },
3914 BufferpoolIndexReads: SystemBufferpoolIndexReadsContext{
3915 Context: framework.Context[EmptyLabels]{
3916 Name: "db2.bufferpool_index_reads",
3917 Family: "bufferpools/index",
3918 Title: "Buffer Pool Index Page Reads",
3919 Units: "reads/s",
3920 Type: module.Stacked,
3921 Priority: 1044,
3922 UpdateEvery: 1,
3923 Dimensions: []framework.Dimension{
3924 {
3925 Name: "logical",
3926 Algorithm: module.Incremental,
3927 Mul: 1,
3928 Div: 1,
3929 Precision: 1,
3930 },
3931 {
3932 Name: "physical",
3933 Algorithm: module.Incremental,
3934 Mul: 1,
3935 Div: 1,
3936 Precision: 1,
3937 },
3938 },
3939 LabelKeys: []string{},
3940 },
3941 },
3942 BufferpoolXDAReads: SystemBufferpoolXDAReadsContext{
3943 Context: framework.Context[EmptyLabels]{
3944 Name: "db2.bufferpool_xda_reads",
3945 Family: "bufferpools/xda",
3946 Title: "Buffer Pool XDA Page Reads",
3947 Units: "reads/s",
3948 Type: module.Stacked,
3949 Priority: 1045,
3950 UpdateEvery: 1,
3951 Dimensions: []framework.Dimension{
3952 {
3953 Name: "logical",
3954 Algorithm: module.Incremental,
3955 Mul: 1,
3956 Div: 1,
3957 Precision: 1,
3958 },
3959 {
3960 Name: "physical",
3961 Algorithm: module.Incremental,
3962 Mul: 1,
3963 Div: 1,
3964 Precision: 1,
3965 },
3966 },
3967 LabelKeys: []string{},
3968 },
3969 },
3970 BufferpoolColumnReads: SystemBufferpoolColumnReadsContext{
3971 Context: framework.Context[EmptyLabels]{
3972 Name: "db2.bufferpool_column_reads",
3973 Family: "bufferpools/columns",
3974 Title: "Buffer Pool Column Page Reads",
3975 Units: "reads/s",
3976 Type: module.Stacked,
3977 Priority: 1046,
3978 UpdateEvery: 1,
3979 Dimensions: []framework.Dimension{
3980 {
3981 Name: "logical",
3982 Algorithm: module.Incremental,
3983 Mul: 1,
3984 Div: 1,
3985 Precision: 1,
3986 },
3987 {
3988 Name: "physical",
3989 Algorithm: module.Incremental,
3990 Mul: 1,
3991 Div: 1,
3992 Precision: 1,
3993 },
3994 },
3995 LabelKeys: []string{},
3996 },
3997 },
3998 BufferpoolWrites: SystemBufferpoolWritesContext{
3999 Context: framework.Context[EmptyLabels]{
4000 Name: "db2.bufferpool_writes",
4001 Family: "bufferpools/overview",
4002 Title: "Buffer Pool Writes",
4003 Units: "writes/s",
4004 Type: module.Line,
4005 Priority: 1047,
4006 UpdateEvery: 1,
4007 Dimensions: []framework.Dimension{
4008 {
4009 Name: "writes",
4010 Algorithm: module.Incremental,
4011 Mul: 1,
4012 Div: 1,
4013 Precision: 1,
4014 },
4015 },
4016 LabelKeys: []string{},
4017 },
4018 },
4019 LogSpace: SystemLogSpaceContext{
4020 Context: framework.Context[EmptyLabels]{
4021 Name: "db2.log_space",
4022 Family: "storage/space",
4023 Title: "Log Space Usage",
4024 Units: "bytes",
4025 Type: module.Stacked,
4026 Priority: 1050,
4027 UpdateEvery: 1,
4028 Dimensions: []framework.Dimension{
4029 {
4030 Name: "used",
4031 Algorithm: module.Absolute,
4032 Mul: 1,
4033 Div: 1,
4034 Precision: 1,
4035 },
4036 {
4037 Name: "available",
4038 Algorithm: module.Absolute,
4039 Mul: 1,
4040 Div: 1,
4041 Precision: 1,
4042 },
4043 },
4044 LabelKeys: []string{},
4045 },
4046 },
4047 LogUtilization: SystemLogUtilizationContext{
4048 Context: framework.Context[EmptyLabels]{
4049 Name: "db2.log_utilization",
4050 Family: "storage/space",
4051 Title: "Log Space Utilization",
4052 Units: "percentage",
4053 Type: module.Line,
4054 Priority: 1051,
4055 UpdateEvery: 1,
4056 Dimensions: []framework.Dimension{
4057 {
4058 Name: "utilization",
4059 Algorithm: module.Absolute,
4060 Mul: 1,
4061 Div: 1000,
4062 Precision: 1000,
4063 },
4064 },
4065 LabelKeys: []string{},
4066 },
4067 },
4068 LogIO: SystemLogIOContext{
4069 Context: framework.Context[EmptyLabels]{
4070 Name: "db2.log_io",
4071 Family: "storage/operations",
4072 Title: "Log I/O Operations",
4073 Units: "operations/s",
4074 Type: module.Area,
4075 Priority: 1052,
4076 UpdateEvery: 1,
4077 Dimensions: []framework.Dimension{
4078 {
4079 Name: "reads",
4080 Algorithm: module.Incremental,
4081 Mul: 1,
4082 Div: 1,
4083 Precision: 1,
4084 },
4085 {
4086 Name: "writes",
4087 Algorithm: module.Incremental,
4088 Mul: -1,
4089 Div: 1,
4090 Precision: 1,
4091 },
4092 },
4093 LabelKeys: []string{},
4094 },
4095 },
4096 LogOperations: SystemLogOperationsContext{
4097 Context: framework.Context[EmptyLabels]{
4098 Name: "db2.log_operations",
4099 Family: "storage/operations",
4100 Title: "Log Operations",
4101 Units: "operations/s",
4102 Type: module.Line,
4103 Priority: 1053,
4104 UpdateEvery: 1,
4105 Dimensions: []framework.Dimension{
4106 {
4107 Name: "commits",
4108 Algorithm: module.Incremental,
4109 Mul: 1,
4110 Div: 1,
4111 Precision: 1,
4112 },
4113 {
4114 Name: "rollbacks",
4115 Algorithm: module.Incremental,
4116 Mul: 1,
4117 Div: 1,
4118 Precision: 1,
4119 },
4120 {
4121 Name: "reads",
4122 Algorithm: module.Incremental,
4123 Mul: 1,
4124 Div: 1,
4125 Precision: 1,
4126 },
4127 {
4128 Name: "writes",
4129 Algorithm: module.Incremental,
4130 Mul: 1,
4131 Div: 1,
4132 Precision: 1,
4133 },
4134 },
4135 LabelKeys: []string{},
4136 },
4137 },
4138 LogTiming: SystemLogTimingContext{
4139 Context: framework.Context[EmptyLabels]{
4140 Name: "db2.log_timing",
4141 Family: "storage/operations",
4142 Title: "Log Operation Times",
4143 Units: "milliseconds",
4144 Type: module.Line,
4145 Priority: 1054,
4146 UpdateEvery: 1,
4147 Dimensions: []framework.Dimension{
4148 {
4149 Name: "avg_commit",
4150 Algorithm: module.Absolute,
4151 Mul: 1,
4152 Div: 1000,
4153 Precision: 1000,
4154 },
4155 {
4156 Name: "avg_read",
4157 Algorithm: module.Absolute,
4158 Mul: 1,
4159 Div: 1000,
4160 Precision: 1000,
4161 },
4162 {
4163 Name: "avg_write",
4164 Algorithm: module.Absolute,
4165 Mul: 1,
4166 Div: 1000,
4167 Precision: 1000,
4168 },
4169 },
4170 LabelKeys: []string{},
4171 },
4172 },
4173 LogBufferEvents: SystemLogBufferEventsContext{
4174 Context: framework.Context[EmptyLabels]{
4175 Name: "db2.log_buffer_events",
4176 Family: "storage/operations",
4177 Title: "Log Buffer Full Events",
4178 Units: "events/s",
4179 Type: module.Line,
4180 Priority: 1055,
4181 UpdateEvery: 1,
4182 Dimensions: []framework.Dimension{
4183 {
4184 Name: "buffer_full",
4185 Algorithm: module.Incremental,
4186 Mul: 1,
4187 Div: 1,
4188 Precision: 1,
4189 },
4190 },
4191 LabelKeys: []string{},
4192 },
4193 },
4194 LongRunningQueries: SystemLongRunningQueriesContext{
4195 Context: framework.Context[EmptyLabels]{
4196 Name: "db2.long_running_queries",
4197 Family: "activity/requests",
4198 Title: "Long Running Queries",
4199 Units: "queries",
4200 Type: module.Stacked,
4201 Priority: 1060,
4202 UpdateEvery: 1,
4203 Dimensions: []framework.Dimension{
4204 {
4205 Name: "total",
4206 Algorithm: module.Absolute,
4207 Mul: 1,
4208 Div: 1,
4209 Precision: 1,
4210 },
4211 {
4212 Name: "warning",
4213 Algorithm: module.Absolute,
4214 Mul: 1,
4215 Div: 1,
4216 Precision: 1,
4217 },
4218 {
4219 Name: "critical",
4220 Algorithm: module.Absolute,
4221 Mul: 1,
4222 Div: 1,
4223 Precision: 1,
4224 },
4225 },
4226 LabelKeys: []string{},
4227 },
4228 },
4229 BackupStatus: SystemBackupStatusContext{
4230 Context: framework.Context[EmptyLabels]{
4231 Name: "db2.backup_status",
4232 Family: "storage/backup",
4233 Title: "Last Backup Status",
4234 Units: "status",
4235 Type: module.Line,
4236 Priority: 1070,
4237 UpdateEvery: 1,
4238 Dimensions: []framework.Dimension{
4239 {
4240 Name: "status",
4241 Algorithm: module.Absolute,
4242 Mul: 1,
4243 Div: 1,
4244 Precision: 1,
4245 },
4246 },
4247 LabelKeys: []string{},
4248 },
4249 },
4250 BackupAge: SystemBackupAgeContext{
4251 Context: framework.Context[EmptyLabels]{
4252 Name: "db2.backup_age",
4253 Family: "storage/backup",
4254 Title: "Time Since Last Backup",
4255 Units: "hours",
4256 Type: module.Line,
4257 Priority: 1071,
4258 UpdateEvery: 1,
4259 Dimensions: []framework.Dimension{
4260 {
4261 Name: "full",
4262 Algorithm: module.Absolute,
4263 Mul: 1,
4264 Div: 1,
4265 Precision: 1,
4266 },
4267 {
4268 Name: "incremental",
4269 Algorithm: module.Absolute,
4270 Mul: 1,
4271 Div: 1,
4272 Precision: 1,
4273 },
4274 },
4275 LabelKeys: []string{},
4276 },
4277 },
4278 FederationConnections: SystemFederationConnectionsContext{
4279 Context: framework.Context[EmptyLabels]{
4280 Name: "db2.federation_connections",
4281 Family: "federation",
4282 Title: "Federated Connections",
4283 Units: "connections",
4284 Type: module.Line,
4285 Priority: 1080,
4286 UpdateEvery: 1,
4287 Dimensions: []framework.Dimension{
4288 {
4289 Name: "active",
4290 Algorithm: module.Absolute,
4291 Mul: 1,
4292 Div: 1,
4293 Precision: 1,
4294 },
4295 {
4296 Name: "idle",
4297 Algorithm: module.Absolute,
4298 Mul: 1,
4299 Div: 1,
4300 Precision: 1,
4301 },
4302 },
4303 LabelKeys: []string{},
4304 },
4305 },
4306 FederationOperations: SystemFederationOperationsContext{
4307 Context: framework.Context[EmptyLabels]{
4308 Name: "db2.federation_operations",
4309 Family: "federation",
4310 Title: "Federated Operations",
4311 Units: "operations/s",
4312 Type: module.Line,
4313 Priority: 1081,
4314 UpdateEvery: 1,
4315 Dimensions: []framework.Dimension{
4316 {
4317 Name: "rows_read",
4318 Algorithm: module.Incremental,
4319 Mul: 1,
4320 Div: 1,
4321 Precision: 1,
4322 },
4323 {
4324 Name: "selects",
4325 Algorithm: module.Incremental,
4326 Mul: 1,
4327 Div: 1,
4328 Precision: 1,
4329 },
4330 {
4331 Name: "waits",
4332 Algorithm: module.Incremental,
4333 Mul: 1,
4334 Div: 1,
4335 Precision: 1,
4336 },
4337 },
4338 LabelKeys: []string{},
4339 },
4340 },
4341 DatabaseStatus: SystemDatabaseStatusContext{
4342 Context: framework.Context[EmptyLabels]{
4343 Name: "db2.database_status",
4344 Family: "overview",
4345 Title: "Current Database Status",
4346 Units: "status",
4347 Type: module.Line,
4348 Priority: 900,
4349 UpdateEvery: 1,
4350 Dimensions: []framework.Dimension{
4351 {
4352 Name: "active",
4353 Algorithm: module.Absolute,
4354 Mul: 1,
4355 Div: 1,
4356 Precision: 1,
4357 },
4358 {
4359 Name: "inactive",
4360 Algorithm: module.Absolute,
4361 Mul: 1,
4362 Div: 1,
4363 Precision: 1,
4364 },
4365 },
4366 LabelKeys: []string{},
4367 },
4368 },
4369 DatabaseCount: SystemDatabaseCountContext{
4370 Context: framework.Context[EmptyLabels]{
4371 Name: "db2.database_count",
4372 Family: "overview",
4373 Title: "Database Count",
4374 Units: "databases",
4375 Type: module.Line,
4376 Priority: 899,
4377 UpdateEvery: 1,
4378 Dimensions: []framework.Dimension{
4379 {
4380 Name: "active",
4381 Algorithm: module.Absolute,
4382 Mul: 1,
4383 Div: 1,
4384 Precision: 1,
4385 },
4386 {
4387 Name: "inactive",
4388 Algorithm: module.Absolute,
4389 Mul: 1,
4390 Div: 1,
4391 Precision: 1,
4392 },
4393 },
4394 LabelKeys: []string{},
4395 },
4396 },
4397 CPUUsage: SystemCPUUsageContext{
4398 Context: framework.Context[EmptyLabels]{
4399 Name: "db2.cpu_usage",
4400 Family: "overview",
4401 Title: "CPU Usage (100% = 1 CPU core)",
4402 Units: "percentage",
4403 Type: module.Stacked,
4404 Priority: 901,
4405 UpdateEvery: 1,
4406 Dimensions: []framework.Dimension{
4407 {
4408 Name: "user",
4409 Algorithm: module.Absolute,
4410 Mul: 1,
4411 Div: 1000,
4412 Precision: 1000,
4413 },
4414 {
4415 Name: "system",
4416 Algorithm: module.Absolute,
4417 Mul: 1,
4418 Div: 1000,
4419 Precision: 1000,
4420 },
4421 {
4422 Name: "idle",
4423 Algorithm: module.Absolute,
4424 Mul: 1,
4425 Div: 1000,
4426 Precision: 1000,
4427 },
4428 {
4429 Name: "iowait",
4430 Algorithm: module.Absolute,
4431 Mul: 1,
4432 Div: 1000,
4433 Precision: 1000,
4434 },
4435 },
4436 LabelKeys: []string{},
4437 },
4438 },
4439 ActiveConnections: SystemActiveConnectionsContext{
4440 Context: framework.Context[EmptyLabels]{
4441 Name: "db2.active_connections",
4442 Family: "connections/overview",
4443 Title: "Active Connections",
4444 Units: "connections",
4445 Type: module.Line,
4446 Priority: 902,
4447 UpdateEvery: 1,
4448 Dimensions: []framework.Dimension{
4449 {
4450 Name: "active",
4451 Algorithm: module.Absolute,
4452 Mul: 1,
4453 Div: 1,
4454 Precision: 1,
4455 },
4456 {
4457 Name: "total",
4458 Algorithm: module.Absolute,
4459 Mul: 1,
4460 Div: 1,
4461 Precision: 1,
4462 },
4463 },
4464 LabelKeys: []string{},
4465 },
4466 },
4467 MemoryUsage: SystemMemoryUsageContext{
4468 Context: framework.Context[EmptyLabels]{
4469 Name: "db2.memory_usage",
4470 Family: "overview",
4471 Title: "Memory Usage",
4472 Units: "MiB",
4473 Type: module.Stacked,
4474 Priority: 903,
4475 UpdateEvery: 1,
4476 Dimensions: []framework.Dimension{
4477 {
4478 Name: "database",
4479 Algorithm: module.Absolute,
4480 Mul: 1,
4481 Div: 1048576,
4482 Precision: 1,
4483 },
4484 {
4485 Name: "instance",
4486 Algorithm: module.Absolute,
4487 Mul: 1,
4488 Div: 1048576,
4489 Precision: 1,
4490 },
4491 {
4492 Name: "bufferpool",
4493 Algorithm: module.Absolute,
4494 Mul: 1,
4495 Div: 1048576,
4496 Precision: 1,
4497 },
4498 {
4499 Name: "shared_sort",
4500 Algorithm: module.Absolute,
4501 Mul: 1,
4502 Div: 1048576,
4503 Precision: 1,
4504 },
4505 },
4506 LabelKeys: []string{},
4507 },
4508 },
4509 SQLStatements: SystemSQLStatementsContext{
4510 Context: framework.Context[EmptyLabels]{
4511 Name: "db2.sql_statements",
4512 Family: "activity/requests",
4513 Title: "SQL Statements",
4514 Units: "statements/s",
4515 Type: module.Stacked,
4516 Priority: 904,
4517 UpdateEvery: 1,
4518 Dimensions: []framework.Dimension{
4519 {
4520 Name: "selects",
4521 Algorithm: module.Incremental,
4522 Mul: 1,
4523 Div: 1,
4524 Precision: 1,
4525 },
4526 {
4527 Name: "modifications",
4528 Algorithm: module.Incremental,
4529 Mul: 1,
4530 Div: 1,
4531 Precision: 1,
4532 },
4533 },
4534 LabelKeys: []string{},
4535 },
4536 },
4537 TransactionActivity: SystemTransactionActivityContext{
4538 Context: framework.Context[EmptyLabels]{
4539 Name: "db2.transaction_activity",
4540 Family: "activity/transactions",
4541 Title: "Transaction Activity",
4542 Units: "transactions/s",
4543 Type: module.Stacked,
4544 Priority: 905,
4545 UpdateEvery: 1,
4546 Dimensions: []framework.Dimension{
4547 {
4548 Name: "committed",
4549 Algorithm: module.Incremental,
4550 Mul: 1,
4551 Div: 1,
4552 Precision: 1,
4553 },
4554 {
4555 Name: "aborted",
4556 Algorithm: module.Incremental,
4557 Mul: 1,
4558 Div: 1,
4559 Precision: 1,
4560 },
4561 },
4562 LabelKeys: []string{},
4563 },
4564 },
4565 TimeSpent: SystemTimeSpentContext{
4566 Context: framework.Context[EmptyLabels]{
4567 Name: "db2.time_spent",
4568 Family: "activity/time-spent",
4569 Title: "Average Operation Times",
4570 Units: "milliseconds",
4571 Type: module.Line,
4572 Priority: 905,
4573 UpdateEvery: 1,
4574 Dimensions: []framework.Dimension{
4575 {
4576 Name: "direct_read",
4577 Algorithm: module.Absolute,
4578 Mul: 1,
4579 Div: 1000,
4580 Precision: 1000,
4581 },
4582 {
4583 Name: "direct_write",
4584 Algorithm: module.Absolute,
4585 Mul: 1,
4586 Div: 1000,
4587 Precision: 1000,
4588 },
4589 {
4590 Name: "pool_read",
4591 Algorithm: module.Absolute,
4592 Mul: 1,
4593 Div: 1000,
4594 Precision: 1000,
4595 },
4596 {
4597 Name: "pool_write",
4598 Algorithm: module.Absolute,
4599 Mul: 1,
4600 Div: 1000,
4601 Precision: 1000,
4602 },
4603 },
4604 LabelKeys: []string{},
4605 },
4606 },
4607 }
4608
4609 // --- Table ---
4610
4611 // TableSizeValues defines the type-safe values for Table.Size context
4612 type TableSizeValues struct {
4613 Data int64
4614 Index int64
4615 Long_obj int64
4616 }
4617
4618 // TableSizeContext provides type-safe operations for Table.Size context
4619 type TableSizeContext struct {
4620 framework.Context[TableLabels]
4621 }
4622
4623 // Set provides type-safe dimension setting for Table.Size context
4624 func (c TableSizeContext) Set(state *framework.CollectorState, labels TableLabels, values TableSizeValues) {
4625 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
4626 "data": values.Data,
4627 "index": values.Index,
4628 "long_obj": values.Long_obj,
4629 })
4630 }
4631
4632 // SetUpdateEvery sets the update interval for this instance
4633 func (c TableSizeContext) SetUpdateEvery(state *framework.CollectorState, labels TableLabels, updateEvery int) {
4634 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
4635 }
4636
4637 // TableActivityValues defines the type-safe values for Table.Activity context
4638 type TableActivityValues struct {
4639 Read int64
4640 Written int64
4641 }
4642
4643 // TableActivityContext provides type-safe operations for Table.Activity context
4644 type TableActivityContext struct {
4645 framework.Context[TableLabels]
4646 }
4647
4648 // Set provides type-safe dimension setting for Table.Activity context
4649 func (c TableActivityContext) Set(state *framework.CollectorState, labels TableLabels, values TableActivityValues) {
4650 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
4651 "read": values.Read,
4652 "written": values.Written,
4653 })
4654 }
4655
4656 // SetUpdateEvery sets the update interval for this instance
4657 func (c TableActivityContext) SetUpdateEvery(state *framework.CollectorState, labels TableLabels, updateEvery int) {
4658 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
4659 }
4660
4661 // TableLabels defines the required labels for Table contexts
4662 type TableLabels struct {
4663 Table string
4664 }
4665
4666 // InstanceID generates a unique instance ID using the hardcoded label order from YAML
4667 func (l TableLabels) InstanceID(contextName string) string {
4668 // Label order from YAML: table
4669 return contextName + "." + cleanLabelValue(l.Table)
4670 }
4671
4672 // Table contains all metric contexts for Table
4673 var Table = struct {
4674 Size TableSizeContext
4675 Activity TableActivityContext
4676 }{
4677 Size: TableSizeContext{
4678 Context: framework.Context[TableLabels]{
4679 Name: "db2.table_size",
4680 Family: "tables",
4681 Title: "Table Size",
4682 Units: "bytes",
4683 Type: module.Stacked,
4684 Priority: 1140,
4685 UpdateEvery: 1,
4686 Dimensions: []framework.Dimension{
4687 {
4688 Name: "data",
4689 Algorithm: module.Absolute,
4690 Mul: 1,
4691 Div: 1,
4692 Precision: 1,
4693 },
4694 {
4695 Name: "index",
4696 Algorithm: module.Absolute,
4697 Mul: 1,
4698 Div: 1,
4699 Precision: 1,
4700 },
4701 {
4702 Name: "long_obj",
4703 Algorithm: module.Absolute,
4704 Mul: 1,
4705 Div: 1,
4706 Precision: 1,
4707 },
4708 },
4709 LabelKeys: []string{
4710 "table",
4711 },
4712 },
4713 },
4714 Activity: TableActivityContext{
4715 Context: framework.Context[TableLabels]{
4716 Name: "db2.table_activity",
4717 Family: "tables",
4718 Title: "Table Activity",
4719 Units: "rows/s",
4720 Type: module.Area,
4721 Priority: 1141,
4722 UpdateEvery: 1,
4723 Dimensions: []framework.Dimension{
4724 {
4725 Name: "read",
4726 Algorithm: module.Incremental,
4727 Mul: 1,
4728 Div: 1,
4729 Precision: 1,
4730 },
4731 {
4732 Name: "written",
4733 Algorithm: module.Incremental,
4734 Mul: 1,
4735 Div: 1,
4736 Precision: 1,
4737 },
4738 },
4739 LabelKeys: []string{
4740 "table",
4741 },
4742 },
4743 },
4744 }
4745
4746 // --- TableGroup ---
4747
4748 // TableGroupSizeValues defines the type-safe values for TableGroup.Size context
4749 type TableGroupSizeValues struct {
4750 Data int64
4751 Index int64
4752 Long_obj int64
4753 }
4754
4755 // TableGroupSizeContext provides type-safe operations for TableGroup.Size context
4756 type TableGroupSizeContext struct {
4757 framework.Context[TableGroupLabels]
4758 }
4759
4760 // Set provides type-safe dimension setting for TableGroup.Size context
4761 func (c TableGroupSizeContext) Set(state *framework.CollectorState, labels TableGroupLabels, values TableGroupSizeValues) {
4762 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
4763 "data": values.Data,
4764 "index": values.Index,
4765 "long_obj": values.Long_obj,
4766 })
4767 }
4768
4769 // SetUpdateEvery sets the update interval for this instance
4770 func (c TableGroupSizeContext) SetUpdateEvery(state *framework.CollectorState, labels TableGroupLabels, updateEvery int) {
4771 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
4772 }
4773
4774 // TableGroupActivityValues defines the type-safe values for TableGroup.Activity context
4775 type TableGroupActivityValues struct {
4776 Read int64
4777 Written int64
4778 }
4779
4780 // TableGroupActivityContext provides type-safe operations for TableGroup.Activity context
4781 type TableGroupActivityContext struct {
4782 framework.Context[TableGroupLabels]
4783 }
4784
4785 // Set provides type-safe dimension setting for TableGroup.Activity context
4786 func (c TableGroupActivityContext) Set(state *framework.CollectorState, labels TableGroupLabels, values TableGroupActivityValues) {
4787 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
4788 "read": values.Read,
4789 "written": values.Written,
4790 })
4791 }
4792
4793 // SetUpdateEvery sets the update interval for this instance
4794 func (c TableGroupActivityContext) SetUpdateEvery(state *framework.CollectorState, labels TableGroupLabels, updateEvery int) {
4795 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
4796 }
4797
4798 // TableGroupLabels defines the required labels for TableGroup contexts
4799 type TableGroupLabels struct {
4800 Group string
4801 }
4802
4803 // InstanceID generates a unique instance ID using the hardcoded label order from YAML
4804 func (l TableGroupLabels) InstanceID(contextName string) string {
4805 // Label order from YAML: group
4806 return contextName + "." + cleanLabelValue(l.Group)
4807 }
4808
4809 // TableGroup contains all metric contexts for TableGroup
4810 var TableGroup = struct {
4811 Size TableGroupSizeContext
4812 Activity TableGroupActivityContext
4813 }{
4814 Size: TableGroupSizeContext{
4815 Context: framework.Context[TableGroupLabels]{
4816 Name: "db2.table_group_size",
4817 Family: "tables/groups",
4818 Title: "Table Group Size",
4819 Units: "bytes",
4820 Type: module.Stacked,
4821 Priority: 1142,
4822 UpdateEvery: 1,
4823 Dimensions: []framework.Dimension{
4824 {
4825 Name: "data",
4826 Algorithm: module.Absolute,
4827 Mul: 1,
4828 Div: 1,
4829 Precision: 1,
4830 },
4831 {
4832 Name: "index",
4833 Algorithm: module.Absolute,
4834 Mul: 1,
4835 Div: 1,
4836 Precision: 1,
4837 },
4838 {
4839 Name: "long_obj",
4840 Algorithm: module.Absolute,
4841 Mul: 1,
4842 Div: 1,
4843 Precision: 1,
4844 },
4845 },
4846 LabelKeys: []string{
4847 "group",
4848 },
4849 },
4850 },
4851 Activity: TableGroupActivityContext{
4852 Context: framework.Context[TableGroupLabels]{
4853 Name: "db2.table_group_activity",
4854 Family: "tables/groups",
4855 Title: "Table Group Activity",
4856 Units: "rows/s",
4857 Type: module.Area,
4858 Priority: 1143,
4859 UpdateEvery: 1,
4860 Dimensions: []framework.Dimension{
4861 {
4862 Name: "read",
4863 Algorithm: module.Incremental,
4864 Mul: 1,
4865 Div: 1,
4866 Precision: 1,
4867 },
4868 {
4869 Name: "written",
4870 Algorithm: module.Incremental,
4871 Mul: 1,
4872 Div: 1,
4873 Precision: 1,
4874 },
4875 },
4876 LabelKeys: []string{
4877 "group",
4878 },
4879 },
4880 },
4881 }
4882
4883 // --- TableIO ---
4884
4885 // TableIOScansValues defines the type-safe values for TableIO.Scans context
4886 type TableIOScansValues struct {
4887 Scans int64
4888 }
4889
4890 // TableIOScansContext provides type-safe operations for TableIO.Scans context
4891 type TableIOScansContext struct {
4892 framework.Context[TableIOLabels]
4893 }
4894
4895 // Set provides type-safe dimension setting for TableIO.Scans context
4896 func (c TableIOScansContext) Set(state *framework.CollectorState, labels TableIOLabels, values TableIOScansValues) {
4897 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
4898 "scans": values.Scans,
4899 })
4900 }
4901
4902 // SetUpdateEvery sets the update interval for this instance
4903 func (c TableIOScansContext) SetUpdateEvery(state *framework.CollectorState, labels TableIOLabels, updateEvery int) {
4904 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
4905 }
4906
4907 // TableIORowsValues defines the type-safe values for TableIO.Rows context
4908 type TableIORowsValues struct {
4909 Read int64
4910 }
4911
4912 // TableIORowsContext provides type-safe operations for TableIO.Rows context
4913 type TableIORowsContext struct {
4914 framework.Context[TableIOLabels]
4915 }
4916
4917 // Set provides type-safe dimension setting for TableIO.Rows context
4918 func (c TableIORowsContext) Set(state *framework.CollectorState, labels TableIOLabels, values TableIORowsValues) {
4919 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
4920 "read": values.Read,
4921 })
4922 }
4923
4924 // SetUpdateEvery sets the update interval for this instance
4925 func (c TableIORowsContext) SetUpdateEvery(state *framework.CollectorState, labels TableIOLabels, updateEvery int) {
4926 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
4927 }
4928
4929 // TableIOActivityValues defines the type-safe values for TableIO.Activity context
4930 type TableIOActivityValues struct {
4931 Inserts int64
4932 Updates int64
4933 Deletes int64
4934 }
4935
4936 // TableIOActivityContext provides type-safe operations for TableIO.Activity context
4937 type TableIOActivityContext struct {
4938 framework.Context[TableIOLabels]
4939 }
4940
4941 // Set provides type-safe dimension setting for TableIO.Activity context
4942 func (c TableIOActivityContext) Set(state *framework.CollectorState, labels TableIOLabels, values TableIOActivityValues) {
4943 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
4944 "inserts": values.Inserts,
4945 "updates": values.Updates,
4946 "deletes": values.Deletes,
4947 })
4948 }
4949
4950 // SetUpdateEvery sets the update interval for this instance
4951 func (c TableIOActivityContext) SetUpdateEvery(state *framework.CollectorState, labels TableIOLabels, updateEvery int) {
4952 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
4953 }
4954
4955 // TableIOOverflowValues defines the type-safe values for TableIO.Overflow context
4956 type TableIOOverflowValues struct {
4957 Overflow int64
4958 }
4959
4960 // TableIOOverflowContext provides type-safe operations for TableIO.Overflow context
4961 type TableIOOverflowContext struct {
4962 framework.Context[TableIOLabels]
4963 }
4964
4965 // Set provides type-safe dimension setting for TableIO.Overflow context
4966 func (c TableIOOverflowContext) Set(state *framework.CollectorState, labels TableIOLabels, values TableIOOverflowValues) {
4967 state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{
4968 "overflow": values.Overflow,
4969 })
4970 }
4971
4972 // SetUpdateEvery sets the update interval for this instance
4973 func (c TableIOOverflowContext) SetUpdateEvery(state *framework.CollectorState, labels TableIOLabels, updateEvery int) {
4974 state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery)
4975 }
4976
4977 // TableIOLabels defines the required labels for TableIO contexts
4978 type TableIOLabels struct {
4979 Table string
4980 }
4981
4982 // InstanceID generates a unique instance ID using the hardcoded label order from YAML
4983 func (l TableIOLabels) InstanceID(contextName string) string {
4984 // Label order from YAML: table
4985 return contextName + "." + cleanLabelValue(l.Table)
4986 }
4987
4988 // TableIO contains all metric contexts for TableIO
4989 var TableIO = struct {
4990 Scans TableIOScansContext
4991 Rows TableIORowsContext
4992 Activity TableIOActivityContext
4993 Overflow TableIOOverflowContext
4994 }{
4995 Scans: TableIOScansContext{
4996 Context: framework.Context[TableIOLabels]{
4997 Name: "db2.table_io_scans",
4998 Family: "table_io",
4999 Title: "Table Scans",
5000 Units: "scans/s",
Showing first 5,000 of 5,656 lines. View raw