| 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 | // --- ActiveJob --- |
| 38 | |
| 39 | // ActiveJobCPUValues defines the type-safe values for ActiveJob.CPU context |
| 40 | type ActiveJobCPUValues struct { |
| 41 | Cpu int64 |
| 42 | } |
| 43 | |
| 44 | // ActiveJobCPUContext provides type-safe operations for ActiveJob.CPU context |
| 45 | type ActiveJobCPUContext struct { |
| 46 | framework.Context[ActiveJobLabels] |
| 47 | } |
| 48 | |
| 49 | // Set provides type-safe dimension setting for ActiveJob.CPU context |
| 50 | func (c ActiveJobCPUContext) Set(state *framework.CollectorState, labels ActiveJobLabels, values ActiveJobCPUValues) { |
| 51 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 52 | "cpu": values.Cpu, |
| 53 | }) |
| 54 | } |
| 55 | |
| 56 | // SetUpdateEvery sets the update interval for this instance |
| 57 | func (c ActiveJobCPUContext) SetUpdateEvery(state *framework.CollectorState, labels ActiveJobLabels, updateEvery int) { |
| 58 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 59 | } |
| 60 | |
| 61 | // ActiveJobResourcesValues defines the type-safe values for ActiveJob.Resources context |
| 62 | type ActiveJobResourcesValues struct { |
| 63 | Temp_storage int64 |
| 64 | } |
| 65 | |
| 66 | // ActiveJobResourcesContext provides type-safe operations for ActiveJob.Resources context |
| 67 | type ActiveJobResourcesContext struct { |
| 68 | framework.Context[ActiveJobLabels] |
| 69 | } |
| 70 | |
| 71 | // Set provides type-safe dimension setting for ActiveJob.Resources context |
| 72 | func (c ActiveJobResourcesContext) Set(state *framework.CollectorState, labels ActiveJobLabels, values ActiveJobResourcesValues) { |
| 73 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 74 | "temp_storage": values.Temp_storage, |
| 75 | }) |
| 76 | } |
| 77 | |
| 78 | // SetUpdateEvery sets the update interval for this instance |
| 79 | func (c ActiveJobResourcesContext) SetUpdateEvery(state *framework.CollectorState, labels ActiveJobLabels, updateEvery int) { |
| 80 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 81 | } |
| 82 | |
| 83 | // ActiveJobTimeValues defines the type-safe values for ActiveJob.Time context |
| 84 | type ActiveJobTimeValues struct { |
| 85 | Cpu_time int64 |
| 86 | Total_time int64 |
| 87 | } |
| 88 | |
| 89 | // ActiveJobTimeContext provides type-safe operations for ActiveJob.Time context |
| 90 | type ActiveJobTimeContext struct { |
| 91 | framework.Context[ActiveJobLabels] |
| 92 | } |
| 93 | |
| 94 | // Set provides type-safe dimension setting for ActiveJob.Time context |
| 95 | func (c ActiveJobTimeContext) Set(state *framework.CollectorState, labels ActiveJobLabels, values ActiveJobTimeValues) { |
| 96 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 97 | "cpu_time": values.Cpu_time, |
| 98 | "total_time": values.Total_time, |
| 99 | }) |
| 100 | } |
| 101 | |
| 102 | // SetUpdateEvery sets the update interval for this instance |
| 103 | func (c ActiveJobTimeContext) SetUpdateEvery(state *framework.CollectorState, labels ActiveJobLabels, updateEvery int) { |
| 104 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 105 | } |
| 106 | |
| 107 | // ActiveJobActivityValues defines the type-safe values for ActiveJob.Activity context |
| 108 | type ActiveJobActivityValues struct { |
| 109 | Disk_io int64 |
| 110 | Interactive_transactions int64 |
| 111 | } |
| 112 | |
| 113 | // ActiveJobActivityContext provides type-safe operations for ActiveJob.Activity context |
| 114 | type ActiveJobActivityContext struct { |
| 115 | framework.Context[ActiveJobLabels] |
| 116 | } |
| 117 | |
| 118 | // Set provides type-safe dimension setting for ActiveJob.Activity context |
| 119 | func (c ActiveJobActivityContext) Set(state *framework.CollectorState, labels ActiveJobLabels, values ActiveJobActivityValues) { |
| 120 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 121 | "disk_io": values.Disk_io, |
| 122 | "interactive_transactions": values.Interactive_transactions, |
| 123 | }) |
| 124 | } |
| 125 | |
| 126 | // SetUpdateEvery sets the update interval for this instance |
| 127 | func (c ActiveJobActivityContext) SetUpdateEvery(state *framework.CollectorState, labels ActiveJobLabels, updateEvery int) { |
| 128 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 129 | } |
| 130 | |
| 131 | // ActiveJobThreadsValues defines the type-safe values for ActiveJob.Threads context |
| 132 | type ActiveJobThreadsValues struct { |
| 133 | Threads int64 |
| 134 | } |
| 135 | |
| 136 | // ActiveJobThreadsContext provides type-safe operations for ActiveJob.Threads context |
| 137 | type ActiveJobThreadsContext struct { |
| 138 | framework.Context[ActiveJobLabels] |
| 139 | } |
| 140 | |
| 141 | // Set provides type-safe dimension setting for ActiveJob.Threads context |
| 142 | func (c ActiveJobThreadsContext) Set(state *framework.CollectorState, labels ActiveJobLabels, values ActiveJobThreadsValues) { |
| 143 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 144 | "threads": values.Threads, |
| 145 | }) |
| 146 | } |
| 147 | |
| 148 | // SetUpdateEvery sets the update interval for this instance |
| 149 | func (c ActiveJobThreadsContext) SetUpdateEvery(state *framework.CollectorState, labels ActiveJobLabels, updateEvery int) { |
| 150 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 151 | } |
| 152 | |
| 153 | // ActiveJobLabels defines the required labels for ActiveJob contexts |
| 154 | type ActiveJobLabels struct { |
| 155 | Job_name string |
| 156 | Job_status string |
| 157 | Subsystem string |
| 158 | Job_type string |
| 159 | } |
| 160 | |
| 161 | // InstanceID generates a unique instance ID using the hardcoded label order from YAML |
| 162 | func (l ActiveJobLabels) InstanceID(contextName string) string { |
| 163 | // Label order from YAML: job_name, job_status, subsystem, job_type |
| 164 | return contextName + "." + cleanLabelValue(l.Job_name) + "_" + cleanLabelValue(l.Job_status) + "_" + cleanLabelValue(l.Subsystem) + "_" + cleanLabelValue(l.Job_type) |
| 165 | } |
| 166 | |
| 167 | // ActiveJob contains all metric contexts for ActiveJob |
| 168 | var ActiveJob = struct { |
| 169 | CPU ActiveJobCPUContext |
| 170 | Resources ActiveJobResourcesContext |
| 171 | Time ActiveJobTimeContext |
| 172 | Activity ActiveJobActivityContext |
| 173 | Threads ActiveJobThreadsContext |
| 174 | }{ |
| 175 | CPU: ActiveJobCPUContext{ |
| 176 | Context: framework.Context[ActiveJobLabels]{ |
| 177 | Name: "as400.activejob_cpu", |
| 178 | Family: "workloads/active_jobs", |
| 179 | Title: "Active Job CPU Usage", |
| 180 | Units: "percentage", |
| 181 | Type: module.Line, |
| 182 | Priority: 506, |
| 183 | UpdateEvery: 1, |
| 184 | Dimensions: []framework.Dimension{ |
| 185 | { |
| 186 | Name: "cpu", |
| 187 | Algorithm: module.Absolute, |
| 188 | Mul: 1, |
| 189 | Div: 1000, |
| 190 | Precision: 1, |
| 191 | }, |
| 192 | }, |
| 193 | LabelKeys: []string{ |
| 194 | "job_name", |
| 195 | "job_status", |
| 196 | "subsystem", |
| 197 | "job_type", |
| 198 | }, |
| 199 | }, |
| 200 | }, |
| 201 | Resources: ActiveJobResourcesContext{ |
| 202 | Context: framework.Context[ActiveJobLabels]{ |
| 203 | Name: "as400.activejob_resources", |
| 204 | Family: "workloads/active_jobs", |
| 205 | Title: "Active Job Resources", |
| 206 | Units: "MiB", |
| 207 | Type: module.Stacked, |
| 208 | Priority: 507, |
| 209 | UpdateEvery: 1, |
| 210 | Dimensions: []framework.Dimension{ |
| 211 | { |
| 212 | Name: "temp_storage", |
| 213 | Algorithm: module.Absolute, |
| 214 | Mul: 1, |
| 215 | Div: 1, |
| 216 | Precision: 1, |
| 217 | }, |
| 218 | }, |
| 219 | LabelKeys: []string{ |
| 220 | "job_name", |
| 221 | "job_status", |
| 222 | "subsystem", |
| 223 | "job_type", |
| 224 | }, |
| 225 | }, |
| 226 | }, |
| 227 | Time: ActiveJobTimeContext{ |
| 228 | Context: framework.Context[ActiveJobLabels]{ |
| 229 | Name: "as400.activejob_time", |
| 230 | Family: "workloads/active_jobs", |
| 231 | Title: "Active Job Elapsed Time", |
| 232 | Units: "seconds", |
| 233 | Type: module.Line, |
| 234 | Priority: 508, |
| 235 | UpdateEvery: 1, |
| 236 | Dimensions: []framework.Dimension{ |
| 237 | { |
| 238 | Name: "cpu_time", |
| 239 | Algorithm: module.Absolute, |
| 240 | Mul: 1, |
| 241 | Div: 1, |
| 242 | Precision: 1, |
| 243 | }, |
| 244 | { |
| 245 | Name: "total_time", |
| 246 | Algorithm: module.Absolute, |
| 247 | Mul: 1, |
| 248 | Div: 1, |
| 249 | Precision: 1, |
| 250 | }, |
| 251 | }, |
| 252 | LabelKeys: []string{ |
| 253 | "job_name", |
| 254 | "job_status", |
| 255 | "subsystem", |
| 256 | "job_type", |
| 257 | }, |
| 258 | }, |
| 259 | }, |
| 260 | Activity: ActiveJobActivityContext{ |
| 261 | Context: framework.Context[ActiveJobLabels]{ |
| 262 | Name: "as400.activejob_activity", |
| 263 | Family: "workloads/active_jobs", |
| 264 | Title: "Active Job Activity", |
| 265 | Units: "operations/s", |
| 266 | Type: module.Area, |
| 267 | Priority: 509, |
| 268 | UpdateEvery: 1, |
| 269 | Dimensions: []framework.Dimension{ |
| 270 | { |
| 271 | Name: "disk_io", |
| 272 | Algorithm: module.Incremental, |
| 273 | Mul: 1, |
| 274 | Div: 1, |
| 275 | Precision: 1, |
| 276 | }, |
| 277 | { |
| 278 | Name: "interactive_transactions", |
| 279 | Algorithm: module.Incremental, |
| 280 | Mul: 1, |
| 281 | Div: 1, |
| 282 | Precision: 1, |
| 283 | }, |
| 284 | }, |
| 285 | LabelKeys: []string{ |
| 286 | "job_name", |
| 287 | "job_status", |
| 288 | "subsystem", |
| 289 | "job_type", |
| 290 | }, |
| 291 | }, |
| 292 | }, |
| 293 | Threads: ActiveJobThreadsContext{ |
| 294 | Context: framework.Context[ActiveJobLabels]{ |
| 295 | Name: "as400.activejob_threads", |
| 296 | Family: "workloads/active_jobs", |
| 297 | Title: "Active Job Thread Count", |
| 298 | Units: "threads", |
| 299 | Type: module.Line, |
| 300 | Priority: 510, |
| 301 | UpdateEvery: 1, |
| 302 | Dimensions: []framework.Dimension{ |
| 303 | { |
| 304 | Name: "threads", |
| 305 | Algorithm: module.Absolute, |
| 306 | Mul: 1, |
| 307 | Div: 1, |
| 308 | Precision: 1, |
| 309 | }, |
| 310 | }, |
| 311 | LabelKeys: []string{ |
| 312 | "job_name", |
| 313 | "job_status", |
| 314 | "subsystem", |
| 315 | "job_type", |
| 316 | }, |
| 317 | }, |
| 318 | }, |
| 319 | } |
| 320 | |
| 321 | // --- Disk --- |
| 322 | |
| 323 | // DiskBusyValues defines the type-safe values for Disk.Busy context |
| 324 | type DiskBusyValues struct { |
| 325 | Busy int64 |
| 326 | } |
| 327 | |
| 328 | // DiskBusyContext provides type-safe operations for Disk.Busy context |
| 329 | type DiskBusyContext struct { |
| 330 | framework.Context[DiskLabels] |
| 331 | } |
| 332 | |
| 333 | // Set provides type-safe dimension setting for Disk.Busy context |
| 334 | func (c DiskBusyContext) Set(state *framework.CollectorState, labels DiskLabels, values DiskBusyValues) { |
| 335 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 336 | "busy": values.Busy, |
| 337 | }) |
| 338 | } |
| 339 | |
| 340 | // SetUpdateEvery sets the update interval for this instance |
| 341 | func (c DiskBusyContext) SetUpdateEvery(state *framework.CollectorState, labels DiskLabels, updateEvery int) { |
| 342 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 343 | } |
| 344 | |
| 345 | // DiskIORequestsValues defines the type-safe values for Disk.IORequests context |
| 346 | type DiskIORequestsValues struct { |
| 347 | Read int64 |
| 348 | Write int64 |
| 349 | } |
| 350 | |
| 351 | // DiskIORequestsContext provides type-safe operations for Disk.IORequests context |
| 352 | type DiskIORequestsContext struct { |
| 353 | framework.Context[DiskLabels] |
| 354 | } |
| 355 | |
| 356 | // Set provides type-safe dimension setting for Disk.IORequests context |
| 357 | func (c DiskIORequestsContext) Set(state *framework.CollectorState, labels DiskLabels, values DiskIORequestsValues) { |
| 358 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 359 | "read": values.Read, |
| 360 | "write": values.Write, |
| 361 | }) |
| 362 | } |
| 363 | |
| 364 | // SetUpdateEvery sets the update interval for this instance |
| 365 | func (c DiskIORequestsContext) SetUpdateEvery(state *framework.CollectorState, labels DiskLabels, updateEvery int) { |
| 366 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 367 | } |
| 368 | |
| 369 | // DiskSpaceUsageValues defines the type-safe values for Disk.SpaceUsage context |
| 370 | type DiskSpaceUsageValues struct { |
| 371 | Used int64 |
| 372 | } |
| 373 | |
| 374 | // DiskSpaceUsageContext provides type-safe operations for Disk.SpaceUsage context |
| 375 | type DiskSpaceUsageContext struct { |
| 376 | framework.Context[DiskLabels] |
| 377 | } |
| 378 | |
| 379 | // Set provides type-safe dimension setting for Disk.SpaceUsage context |
| 380 | func (c DiskSpaceUsageContext) Set(state *framework.CollectorState, labels DiskLabels, values DiskSpaceUsageValues) { |
| 381 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 382 | "used": values.Used, |
| 383 | }) |
| 384 | } |
| 385 | |
| 386 | // SetUpdateEvery sets the update interval for this instance |
| 387 | func (c DiskSpaceUsageContext) SetUpdateEvery(state *framework.CollectorState, labels DiskLabels, updateEvery int) { |
| 388 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 389 | } |
| 390 | |
| 391 | // DiskCapacityValues defines the type-safe values for Disk.Capacity context |
| 392 | type DiskCapacityValues struct { |
| 393 | Available int64 |
| 394 | Used int64 |
| 395 | } |
| 396 | |
| 397 | // DiskCapacityContext provides type-safe operations for Disk.Capacity context |
| 398 | type DiskCapacityContext struct { |
| 399 | framework.Context[DiskLabels] |
| 400 | } |
| 401 | |
| 402 | // Set provides type-safe dimension setting for Disk.Capacity context |
| 403 | func (c DiskCapacityContext) Set(state *framework.CollectorState, labels DiskLabels, values DiskCapacityValues) { |
| 404 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 405 | "available": values.Available, |
| 406 | "used": values.Used, |
| 407 | }) |
| 408 | } |
| 409 | |
| 410 | // SetUpdateEvery sets the update interval for this instance |
| 411 | func (c DiskCapacityContext) SetUpdateEvery(state *framework.CollectorState, labels DiskLabels, updateEvery int) { |
| 412 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 413 | } |
| 414 | |
| 415 | // DiskBlocksValues defines the type-safe values for Disk.Blocks context |
| 416 | type DiskBlocksValues struct { |
| 417 | Read int64 |
| 418 | Write int64 |
| 419 | } |
| 420 | |
| 421 | // DiskBlocksContext provides type-safe operations for Disk.Blocks context |
| 422 | type DiskBlocksContext struct { |
| 423 | framework.Context[DiskLabels] |
| 424 | } |
| 425 | |
| 426 | // Set provides type-safe dimension setting for Disk.Blocks context |
| 427 | func (c DiskBlocksContext) Set(state *framework.CollectorState, labels DiskLabels, values DiskBlocksValues) { |
| 428 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 429 | "read": values.Read, |
| 430 | "write": values.Write, |
| 431 | }) |
| 432 | } |
| 433 | |
| 434 | // SetUpdateEvery sets the update interval for this instance |
| 435 | func (c DiskBlocksContext) SetUpdateEvery(state *framework.CollectorState, labels DiskLabels, updateEvery int) { |
| 436 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 437 | } |
| 438 | |
| 439 | // DiskSSDHealthValues defines the type-safe values for Disk.SSDHealth context |
| 440 | type DiskSSDHealthValues struct { |
| 441 | Life_remaining int64 |
| 442 | } |
| 443 | |
| 444 | // DiskSSDHealthContext provides type-safe operations for Disk.SSDHealth context |
| 445 | type DiskSSDHealthContext struct { |
| 446 | framework.Context[DiskLabels] |
| 447 | } |
| 448 | |
| 449 | // Set provides type-safe dimension setting for Disk.SSDHealth context |
| 450 | func (c DiskSSDHealthContext) Set(state *framework.CollectorState, labels DiskLabels, values DiskSSDHealthValues) { |
| 451 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 452 | "life_remaining": values.Life_remaining, |
| 453 | }) |
| 454 | } |
| 455 | |
| 456 | // SetUpdateEvery sets the update interval for this instance |
| 457 | func (c DiskSSDHealthContext) SetUpdateEvery(state *framework.CollectorState, labels DiskLabels, updateEvery int) { |
| 458 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 459 | } |
| 460 | |
| 461 | // DiskSSDPowerOnValues defines the type-safe values for Disk.SSDPowerOn context |
| 462 | type DiskSSDPowerOnValues struct { |
| 463 | Power_on_days int64 |
| 464 | } |
| 465 | |
| 466 | // DiskSSDPowerOnContext provides type-safe operations for Disk.SSDPowerOn context |
| 467 | type DiskSSDPowerOnContext struct { |
| 468 | framework.Context[DiskLabels] |
| 469 | } |
| 470 | |
| 471 | // Set provides type-safe dimension setting for Disk.SSDPowerOn context |
| 472 | func (c DiskSSDPowerOnContext) Set(state *framework.CollectorState, labels DiskLabels, values DiskSSDPowerOnValues) { |
| 473 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 474 | "power_on_days": values.Power_on_days, |
| 475 | }) |
| 476 | } |
| 477 | |
| 478 | // SetUpdateEvery sets the update interval for this instance |
| 479 | func (c DiskSSDPowerOnContext) SetUpdateEvery(state *framework.CollectorState, labels DiskLabels, updateEvery int) { |
| 480 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 481 | } |
| 482 | |
| 483 | // DiskLabels defines the required labels for Disk contexts |
| 484 | type DiskLabels struct { |
| 485 | Disk_unit string |
| 486 | Disk_type string |
| 487 | Disk_model string |
| 488 | Hardware_status string |
| 489 | Disk_serial_number string |
| 490 | } |
| 491 | |
| 492 | // InstanceID generates a unique instance ID using the hardcoded label order from YAML |
| 493 | func (l DiskLabels) InstanceID(contextName string) string { |
| 494 | // Label order from YAML: disk_unit, disk_type, disk_model, hardware_status, disk_serial_number |
| 495 | return contextName + "." + cleanLabelValue(l.Disk_unit) + "_" + cleanLabelValue(l.Disk_type) + "_" + cleanLabelValue(l.Disk_model) + "_" + cleanLabelValue(l.Hardware_status) + "_" + cleanLabelValue(l.Disk_serial_number) |
| 496 | } |
| 497 | |
| 498 | // Disk contains all metric contexts for Disk |
| 499 | var Disk = struct { |
| 500 | Busy DiskBusyContext |
| 501 | IORequests DiskIORequestsContext |
| 502 | SpaceUsage DiskSpaceUsageContext |
| 503 | Capacity DiskCapacityContext |
| 504 | Blocks DiskBlocksContext |
| 505 | SSDHealth DiskSSDHealthContext |
| 506 | SSDPowerOn DiskSSDPowerOnContext |
| 507 | }{ |
| 508 | Busy: DiskBusyContext{ |
| 509 | Context: framework.Context[DiskLabels]{ |
| 510 | Name: "as400.disk_busy", |
| 511 | Family: "storage/disk/devices", |
| 512 | Title: "Disk Busy Percentage", |
| 513 | Units: "percentage", |
| 514 | Type: module.Line, |
| 515 | Priority: 307, |
| 516 | UpdateEvery: 1, |
| 517 | Dimensions: []framework.Dimension{ |
| 518 | { |
| 519 | Name: "busy", |
| 520 | Algorithm: module.Absolute, |
| 521 | Mul: 1, |
| 522 | Div: 1000, |
| 523 | Precision: 1, |
| 524 | }, |
| 525 | }, |
| 526 | LabelKeys: []string{ |
| 527 | "disk_unit", |
| 528 | "disk_type", |
| 529 | "disk_model", |
| 530 | "hardware_status", |
| 531 | "disk_serial_number", |
| 532 | }, |
| 533 | }, |
| 534 | }, |
| 535 | IORequests: DiskIORequestsContext{ |
| 536 | Context: framework.Context[DiskLabels]{ |
| 537 | Name: "as400.disk_io_requests", |
| 538 | Family: "storage/disk/devices", |
| 539 | Title: "Disk I/O Requests", |
| 540 | Units: "requests/s", |
| 541 | Type: module.Area, |
| 542 | Priority: 308, |
| 543 | UpdateEvery: 1, |
| 544 | Dimensions: []framework.Dimension{ |
| 545 | { |
| 546 | Name: "read", |
| 547 | Algorithm: module.Incremental, |
| 548 | Mul: 1, |
| 549 | Div: 1, |
| 550 | Precision: 1, |
| 551 | }, |
| 552 | { |
| 553 | Name: "write", |
| 554 | Algorithm: module.Incremental, |
| 555 | Mul: 1, |
| 556 | Div: 1, |
| 557 | Precision: 1, |
| 558 | }, |
| 559 | }, |
| 560 | LabelKeys: []string{ |
| 561 | "disk_unit", |
| 562 | "disk_type", |
| 563 | "disk_model", |
| 564 | "hardware_status", |
| 565 | "disk_serial_number", |
| 566 | }, |
| 567 | }, |
| 568 | }, |
| 569 | SpaceUsage: DiskSpaceUsageContext{ |
| 570 | Context: framework.Context[DiskLabels]{ |
| 571 | Name: "as400.disk_space_usage", |
| 572 | Family: "storage/disk/devices", |
| 573 | Title: "Disk Space Usage", |
| 574 | Units: "percentage", |
| 575 | Type: module.Line, |
| 576 | Priority: 309, |
| 577 | UpdateEvery: 1, |
| 578 | Dimensions: []framework.Dimension{ |
| 579 | { |
| 580 | Name: "used", |
| 581 | Algorithm: module.Absolute, |
| 582 | Mul: 1, |
| 583 | Div: 1000, |
| 584 | Precision: 1, |
| 585 | }, |
| 586 | }, |
| 587 | LabelKeys: []string{ |
| 588 | "disk_unit", |
| 589 | "disk_type", |
| 590 | "disk_model", |
| 591 | "hardware_status", |
| 592 | "disk_serial_number", |
| 593 | }, |
| 594 | }, |
| 595 | }, |
| 596 | Capacity: DiskCapacityContext{ |
| 597 | Context: framework.Context[DiskLabels]{ |
| 598 | Name: "as400.disk_capacity", |
| 599 | Family: "storage/disk/devices", |
| 600 | Title: "Disk Capacity", |
| 601 | Units: "gigabytes", |
| 602 | Type: module.Stacked, |
| 603 | Priority: 310, |
| 604 | UpdateEvery: 1, |
| 605 | Dimensions: []framework.Dimension{ |
| 606 | { |
| 607 | Name: "available", |
| 608 | Algorithm: module.Absolute, |
| 609 | Mul: 1, |
| 610 | Div: 1000, |
| 611 | Precision: 1, |
| 612 | }, |
| 613 | { |
| 614 | Name: "used", |
| 615 | Algorithm: module.Absolute, |
| 616 | Mul: 1, |
| 617 | Div: 1000, |
| 618 | Precision: 1, |
| 619 | }, |
| 620 | }, |
| 621 | LabelKeys: []string{ |
| 622 | "disk_unit", |
| 623 | "disk_type", |
| 624 | "disk_model", |
| 625 | "hardware_status", |
| 626 | "disk_serial_number", |
| 627 | }, |
| 628 | }, |
| 629 | }, |
| 630 | Blocks: DiskBlocksContext{ |
| 631 | Context: framework.Context[DiskLabels]{ |
| 632 | Name: "as400.disk_blocks", |
| 633 | Family: "storage/disk/devices", |
| 634 | Title: "Disk Block Operations", |
| 635 | Units: "blocks/s", |
| 636 | Type: module.Area, |
| 637 | Priority: 311, |
| 638 | UpdateEvery: 1, |
| 639 | Dimensions: []framework.Dimension{ |
| 640 | { |
| 641 | Name: "read", |
| 642 | Algorithm: module.Incremental, |
| 643 | Mul: 1, |
| 644 | Div: 1, |
| 645 | Precision: 1, |
| 646 | }, |
| 647 | { |
| 648 | Name: "write", |
| 649 | Algorithm: module.Incremental, |
| 650 | Mul: 1, |
| 651 | Div: 1, |
| 652 | Precision: 1, |
| 653 | }, |
| 654 | }, |
| 655 | LabelKeys: []string{ |
| 656 | "disk_unit", |
| 657 | "disk_type", |
| 658 | "disk_model", |
| 659 | "hardware_status", |
| 660 | "disk_serial_number", |
| 661 | }, |
| 662 | }, |
| 663 | }, |
| 664 | SSDHealth: DiskSSDHealthContext{ |
| 665 | Context: framework.Context[DiskLabels]{ |
| 666 | Name: "as400.disk_ssd_health", |
| 667 | Family: "storage/disk/devices", |
| 668 | Title: "Disk SSD Health", |
| 669 | Units: "percentage", |
| 670 | Type: module.Line, |
| 671 | Priority: 312, |
| 672 | UpdateEvery: 1, |
| 673 | Dimensions: []framework.Dimension{ |
| 674 | { |
| 675 | Name: "life_remaining", |
| 676 | Algorithm: module.Absolute, |
| 677 | Mul: 1, |
| 678 | Div: 1, |
| 679 | Precision: 1, |
| 680 | }, |
| 681 | }, |
| 682 | LabelKeys: []string{ |
| 683 | "disk_unit", |
| 684 | "disk_type", |
| 685 | "disk_model", |
| 686 | "hardware_status", |
| 687 | "disk_serial_number", |
| 688 | }, |
| 689 | }, |
| 690 | }, |
| 691 | SSDPowerOn: DiskSSDPowerOnContext{ |
| 692 | Context: framework.Context[DiskLabels]{ |
| 693 | Name: "as400.disk_ssd_age", |
| 694 | Family: "storage/disk/devices", |
| 695 | Title: "Disk SSD Power On Days", |
| 696 | Units: "days", |
| 697 | Type: module.Line, |
| 698 | Priority: 313, |
| 699 | UpdateEvery: 1, |
| 700 | Dimensions: []framework.Dimension{ |
| 701 | { |
| 702 | Name: "power_on_days", |
| 703 | Algorithm: module.Absolute, |
| 704 | Mul: 1, |
| 705 | Div: 1, |
| 706 | Precision: 1, |
| 707 | }, |
| 708 | }, |
| 709 | LabelKeys: []string{ |
| 710 | "disk_unit", |
| 711 | "disk_type", |
| 712 | "disk_model", |
| 713 | "hardware_status", |
| 714 | "disk_serial_number", |
| 715 | }, |
| 716 | }, |
| 717 | }, |
| 718 | } |
| 719 | |
| 720 | // --- HTTPServer --- |
| 721 | |
| 722 | // HTTPServerConnectionsValues defines the type-safe values for HTTPServer.Connections context |
| 723 | type HTTPServerConnectionsValues struct { |
| 724 | Normal int64 |
| 725 | Ssl int64 |
| 726 | } |
| 727 | |
| 728 | // HTTPServerConnectionsContext provides type-safe operations for HTTPServer.Connections context |
| 729 | type HTTPServerConnectionsContext struct { |
| 730 | framework.Context[HTTPServerLabels] |
| 731 | } |
| 732 | |
| 733 | // Set provides type-safe dimension setting for HTTPServer.Connections context |
| 734 | func (c HTTPServerConnectionsContext) Set(state *framework.CollectorState, labels HTTPServerLabels, values HTTPServerConnectionsValues) { |
| 735 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 736 | "normal": values.Normal, |
| 737 | "ssl": values.Ssl, |
| 738 | }) |
| 739 | } |
| 740 | |
| 741 | // SetUpdateEvery sets the update interval for this instance |
| 742 | func (c HTTPServerConnectionsContext) SetUpdateEvery(state *framework.CollectorState, labels HTTPServerLabels, updateEvery int) { |
| 743 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 744 | } |
| 745 | |
| 746 | // HTTPServerThreadsValues defines the type-safe values for HTTPServer.Threads context |
| 747 | type HTTPServerThreadsValues struct { |
| 748 | Active int64 |
| 749 | Idle int64 |
| 750 | } |
| 751 | |
| 752 | // HTTPServerThreadsContext provides type-safe operations for HTTPServer.Threads context |
| 753 | type HTTPServerThreadsContext struct { |
| 754 | framework.Context[HTTPServerLabels] |
| 755 | } |
| 756 | |
| 757 | // Set provides type-safe dimension setting for HTTPServer.Threads context |
| 758 | func (c HTTPServerThreadsContext) Set(state *framework.CollectorState, labels HTTPServerLabels, values HTTPServerThreadsValues) { |
| 759 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 760 | "active": values.Active, |
| 761 | "idle": values.Idle, |
| 762 | }) |
| 763 | } |
| 764 | |
| 765 | // SetUpdateEvery sets the update interval for this instance |
| 766 | func (c HTTPServerThreadsContext) SetUpdateEvery(state *framework.CollectorState, labels HTTPServerLabels, updateEvery int) { |
| 767 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 768 | } |
| 769 | |
| 770 | // HTTPServerRequestsValues defines the type-safe values for HTTPServer.Requests context |
| 771 | type HTTPServerRequestsValues struct { |
| 772 | Requests int64 |
| 773 | Responses int64 |
| 774 | Rejected int64 |
| 775 | } |
| 776 | |
| 777 | // HTTPServerRequestsContext provides type-safe operations for HTTPServer.Requests context |
| 778 | type HTTPServerRequestsContext struct { |
| 779 | framework.Context[HTTPServerLabels] |
| 780 | } |
| 781 | |
| 782 | // Set provides type-safe dimension setting for HTTPServer.Requests context |
| 783 | func (c HTTPServerRequestsContext) Set(state *framework.CollectorState, labels HTTPServerLabels, values HTTPServerRequestsValues) { |
| 784 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 785 | "requests": values.Requests, |
| 786 | "responses": values.Responses, |
| 787 | "rejected": values.Rejected, |
| 788 | }) |
| 789 | } |
| 790 | |
| 791 | // SetUpdateEvery sets the update interval for this instance |
| 792 | func (c HTTPServerRequestsContext) SetUpdateEvery(state *framework.CollectorState, labels HTTPServerLabels, updateEvery int) { |
| 793 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 794 | } |
| 795 | |
| 796 | // HTTPServerBytesValues defines the type-safe values for HTTPServer.Bytes context |
| 797 | type HTTPServerBytesValues struct { |
| 798 | Received int64 |
| 799 | Sent int64 |
| 800 | } |
| 801 | |
| 802 | // HTTPServerBytesContext provides type-safe operations for HTTPServer.Bytes context |
| 803 | type HTTPServerBytesContext struct { |
| 804 | framework.Context[HTTPServerLabels] |
| 805 | } |
| 806 | |
| 807 | // Set provides type-safe dimension setting for HTTPServer.Bytes context |
| 808 | func (c HTTPServerBytesContext) Set(state *framework.CollectorState, labels HTTPServerLabels, values HTTPServerBytesValues) { |
| 809 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 810 | "received": values.Received, |
| 811 | "sent": values.Sent, |
| 812 | }) |
| 813 | } |
| 814 | |
| 815 | // SetUpdateEvery sets the update interval for this instance |
| 816 | func (c HTTPServerBytesContext) SetUpdateEvery(state *framework.CollectorState, labels HTTPServerLabels, updateEvery int) { |
| 817 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 818 | } |
| 819 | |
| 820 | // HTTPServerLabels defines the required labels for HTTPServer contexts |
| 821 | type HTTPServerLabels struct { |
| 822 | Server string |
| 823 | Function string |
| 824 | } |
| 825 | |
| 826 | // InstanceID generates a unique instance ID using the hardcoded label order from YAML |
| 827 | func (l HTTPServerLabels) InstanceID(contextName string) string { |
| 828 | // Label order from YAML: server, function |
| 829 | return contextName + "." + cleanLabelValue(l.Server) + "_" + cleanLabelValue(l.Function) |
| 830 | } |
| 831 | |
| 832 | // HTTPServer contains all metric contexts for HTTPServer |
| 833 | var HTTPServer = struct { |
| 834 | Connections HTTPServerConnectionsContext |
| 835 | Threads HTTPServerThreadsContext |
| 836 | Requests HTTPServerRequestsContext |
| 837 | Bytes HTTPServerBytesContext |
| 838 | }{ |
| 839 | Connections: HTTPServerConnectionsContext{ |
| 840 | Context: framework.Context[HTTPServerLabels]{ |
| 841 | Name: "as400.http_server_connections", |
| 842 | Family: "network/http", |
| 843 | Title: "HTTP Server Connections", |
| 844 | Units: "connections", |
| 845 | Type: module.Line, |
| 846 | Priority: 601, |
| 847 | UpdateEvery: 1, |
| 848 | Dimensions: []framework.Dimension{ |
| 849 | { |
| 850 | Name: "normal", |
| 851 | Algorithm: module.Absolute, |
| 852 | Mul: 1, |
| 853 | Div: 1, |
| 854 | Precision: 1, |
| 855 | }, |
| 856 | { |
| 857 | Name: "ssl", |
| 858 | Algorithm: module.Absolute, |
| 859 | Mul: 1, |
| 860 | Div: 1, |
| 861 | Precision: 1, |
| 862 | }, |
| 863 | }, |
| 864 | LabelKeys: []string{ |
| 865 | "server", |
| 866 | "function", |
| 867 | }, |
| 868 | }, |
| 869 | }, |
| 870 | Threads: HTTPServerThreadsContext{ |
| 871 | Context: framework.Context[HTTPServerLabels]{ |
| 872 | Name: "as400.http_server_threads", |
| 873 | Family: "network/http", |
| 874 | Title: "HTTP Server Threads", |
| 875 | Units: "threads", |
| 876 | Type: module.Line, |
| 877 | Priority: 602, |
| 878 | UpdateEvery: 1, |
| 879 | Dimensions: []framework.Dimension{ |
| 880 | { |
| 881 | Name: "active", |
| 882 | Algorithm: module.Absolute, |
| 883 | Mul: 1, |
| 884 | Div: 1, |
| 885 | Precision: 1, |
| 886 | }, |
| 887 | { |
| 888 | Name: "idle", |
| 889 | Algorithm: module.Absolute, |
| 890 | Mul: 1, |
| 891 | Div: 1, |
| 892 | Precision: 1, |
| 893 | }, |
| 894 | }, |
| 895 | LabelKeys: []string{ |
| 896 | "server", |
| 897 | "function", |
| 898 | }, |
| 899 | }, |
| 900 | }, |
| 901 | Requests: HTTPServerRequestsContext{ |
| 902 | Context: framework.Context[HTTPServerLabels]{ |
| 903 | Name: "as400.http_server_requests", |
| 904 | Family: "network/http", |
| 905 | Title: "HTTP Server Requests", |
| 906 | Units: "requests/s", |
| 907 | Type: module.Area, |
| 908 | Priority: 603, |
| 909 | UpdateEvery: 1, |
| 910 | Dimensions: []framework.Dimension{ |
| 911 | { |
| 912 | Name: "requests", |
| 913 | Algorithm: module.Incremental, |
| 914 | Mul: 1, |
| 915 | Div: 1, |
| 916 | Precision: 1, |
| 917 | }, |
| 918 | { |
| 919 | Name: "responses", |
| 920 | Algorithm: module.Incremental, |
| 921 | Mul: 1, |
| 922 | Div: 1, |
| 923 | Precision: 1, |
| 924 | }, |
| 925 | { |
| 926 | Name: "rejected", |
| 927 | Algorithm: module.Incremental, |
| 928 | Mul: 1, |
| 929 | Div: 1, |
| 930 | Precision: 1, |
| 931 | }, |
| 932 | }, |
| 933 | LabelKeys: []string{ |
| 934 | "server", |
| 935 | "function", |
| 936 | }, |
| 937 | }, |
| 938 | }, |
| 939 | Bytes: HTTPServerBytesContext{ |
| 940 | Context: framework.Context[HTTPServerLabels]{ |
| 941 | Name: "as400.http_server_bytes", |
| 942 | Family: "network/http", |
| 943 | Title: "HTTP Server Throughput", |
| 944 | Units: "bytes/s", |
| 945 | Type: module.Area, |
| 946 | Priority: 604, |
| 947 | UpdateEvery: 1, |
| 948 | Dimensions: []framework.Dimension{ |
| 949 | { |
| 950 | Name: "received", |
| 951 | Algorithm: module.Incremental, |
| 952 | Mul: 1, |
| 953 | Div: 1, |
| 954 | Precision: 1, |
| 955 | }, |
| 956 | { |
| 957 | Name: "sent", |
| 958 | Algorithm: module.Incremental, |
| 959 | Mul: 1, |
| 960 | Div: 1, |
| 961 | Precision: 1, |
| 962 | }, |
| 963 | }, |
| 964 | LabelKeys: []string{ |
| 965 | "server", |
| 966 | "function", |
| 967 | }, |
| 968 | }, |
| 969 | }, |
| 970 | } |
| 971 | |
| 972 | // --- JobQueue --- |
| 973 | |
| 974 | // JobQueueLengthValues defines the type-safe values for JobQueue.Length context |
| 975 | type JobQueueLengthValues struct { |
| 976 | Jobs int64 |
| 977 | } |
| 978 | |
| 979 | // JobQueueLengthContext provides type-safe operations for JobQueue.Length context |
| 980 | type JobQueueLengthContext struct { |
| 981 | framework.Context[JobQueueLabels] |
| 982 | } |
| 983 | |
| 984 | // Set provides type-safe dimension setting for JobQueue.Length context |
| 985 | func (c JobQueueLengthContext) Set(state *framework.CollectorState, labels JobQueueLabels, values JobQueueLengthValues) { |
| 986 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 987 | "jobs": values.Jobs, |
| 988 | }) |
| 989 | } |
| 990 | |
| 991 | // SetUpdateEvery sets the update interval for this instance |
| 992 | func (c JobQueueLengthContext) SetUpdateEvery(state *framework.CollectorState, labels JobQueueLabels, updateEvery int) { |
| 993 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 994 | } |
| 995 | |
| 996 | // JobQueueLabels defines the required labels for JobQueue contexts |
| 997 | type JobQueueLabels struct { |
| 998 | Job_queue string |
| 999 | Library string |
| 1000 | Status string |
| 1001 | } |
| 1002 | |
| 1003 | // InstanceID generates a unique instance ID using the hardcoded label order from YAML |
| 1004 | func (l JobQueueLabels) InstanceID(contextName string) string { |
| 1005 | // Label order from YAML: job_queue, library, status |
| 1006 | return contextName + "." + cleanLabelValue(l.Job_queue) + "_" + cleanLabelValue(l.Library) + "_" + cleanLabelValue(l.Status) |
| 1007 | } |
| 1008 | |
| 1009 | // JobQueue contains all metric contexts for JobQueue |
| 1010 | var JobQueue = struct { |
| 1011 | Length JobQueueLengthContext |
| 1012 | }{ |
| 1013 | Length: JobQueueLengthContext{ |
| 1014 | Context: framework.Context[JobQueueLabels]{ |
| 1015 | Name: "as400.jobqueue_length", |
| 1016 | Family: "queues/job", |
| 1017 | Title: "Job Queue Length", |
| 1018 | Units: "jobs", |
| 1019 | Type: module.Line, |
| 1020 | Priority: 505, |
| 1021 | UpdateEvery: 1, |
| 1022 | Dimensions: []framework.Dimension{ |
| 1023 | { |
| 1024 | Name: "jobs", |
| 1025 | Algorithm: module.Absolute, |
| 1026 | Mul: 1, |
| 1027 | Div: 1, |
| 1028 | Precision: 1, |
| 1029 | }, |
| 1030 | }, |
| 1031 | LabelKeys: []string{ |
| 1032 | "job_queue", |
| 1033 | "library", |
| 1034 | "status", |
| 1035 | }, |
| 1036 | }, |
| 1037 | }, |
| 1038 | } |
| 1039 | |
| 1040 | // --- MessageQueue --- |
| 1041 | |
| 1042 | // MessageQueueMessagesValues defines the type-safe values for MessageQueue.Messages context |
| 1043 | type MessageQueueMessagesValues struct { |
| 1044 | Total int64 |
| 1045 | Informational int64 |
| 1046 | Inquiry int64 |
| 1047 | Diagnostic int64 |
| 1048 | Escape int64 |
| 1049 | Notify int64 |
| 1050 | Sender_copy int64 |
| 1051 | } |
| 1052 | |
| 1053 | // MessageQueueMessagesContext provides type-safe operations for MessageQueue.Messages context |
| 1054 | type MessageQueueMessagesContext struct { |
| 1055 | framework.Context[MessageQueueLabels] |
| 1056 | } |
| 1057 | |
| 1058 | // Set provides type-safe dimension setting for MessageQueue.Messages context |
| 1059 | func (c MessageQueueMessagesContext) Set(state *framework.CollectorState, labels MessageQueueLabels, values MessageQueueMessagesValues) { |
| 1060 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1061 | "total": values.Total, |
| 1062 | "informational": values.Informational, |
| 1063 | "inquiry": values.Inquiry, |
| 1064 | "diagnostic": values.Diagnostic, |
| 1065 | "escape": values.Escape, |
| 1066 | "notify": values.Notify, |
| 1067 | "sender_copy": values.Sender_copy, |
| 1068 | }) |
| 1069 | } |
| 1070 | |
| 1071 | // SetUpdateEvery sets the update interval for this instance |
| 1072 | func (c MessageQueueMessagesContext) SetUpdateEvery(state *framework.CollectorState, labels MessageQueueLabels, updateEvery int) { |
| 1073 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1074 | } |
| 1075 | |
| 1076 | // MessageQueueSeverityValues defines the type-safe values for MessageQueue.Severity context |
| 1077 | type MessageQueueSeverityValues struct { |
| 1078 | Max int64 |
| 1079 | } |
| 1080 | |
| 1081 | // MessageQueueSeverityContext provides type-safe operations for MessageQueue.Severity context |
| 1082 | type MessageQueueSeverityContext struct { |
| 1083 | framework.Context[MessageQueueLabels] |
| 1084 | } |
| 1085 | |
| 1086 | // Set provides type-safe dimension setting for MessageQueue.Severity context |
| 1087 | func (c MessageQueueSeverityContext) Set(state *framework.CollectorState, labels MessageQueueLabels, values MessageQueueSeverityValues) { |
| 1088 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1089 | "max": values.Max, |
| 1090 | }) |
| 1091 | } |
| 1092 | |
| 1093 | // SetUpdateEvery sets the update interval for this instance |
| 1094 | func (c MessageQueueSeverityContext) SetUpdateEvery(state *framework.CollectorState, labels MessageQueueLabels, updateEvery int) { |
| 1095 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1096 | } |
| 1097 | |
| 1098 | // MessageQueueLabels defines the required labels for MessageQueue contexts |
| 1099 | type MessageQueueLabels struct { |
| 1100 | Library string |
| 1101 | Queue string |
| 1102 | } |
| 1103 | |
| 1104 | // InstanceID generates a unique instance ID using the hardcoded label order from YAML |
| 1105 | func (l MessageQueueLabels) InstanceID(contextName string) string { |
| 1106 | // Label order from YAML: library, queue |
| 1107 | return contextName + "." + cleanLabelValue(l.Library) + "_" + cleanLabelValue(l.Queue) |
| 1108 | } |
| 1109 | |
| 1110 | // MessageQueue contains all metric contexts for MessageQueue |
| 1111 | var MessageQueue = struct { |
| 1112 | Messages MessageQueueMessagesContext |
| 1113 | Severity MessageQueueSeverityContext |
| 1114 | }{ |
| 1115 | Messages: MessageQueueMessagesContext{ |
| 1116 | Context: framework.Context[MessageQueueLabels]{ |
| 1117 | Name: "as400.message_queue_messages", |
| 1118 | Family: "queues/message", |
| 1119 | Title: "Message Queue Messages", |
| 1120 | Units: "messages", |
| 1121 | Type: module.Stacked, |
| 1122 | Priority: 700, |
| 1123 | UpdateEvery: 1, |
| 1124 | Dimensions: []framework.Dimension{ |
| 1125 | { |
| 1126 | Name: "total", |
| 1127 | Algorithm: module.Absolute, |
| 1128 | Mul: 1, |
| 1129 | Div: 1, |
| 1130 | Precision: 1, |
| 1131 | }, |
| 1132 | { |
| 1133 | Name: "informational", |
| 1134 | Algorithm: module.Absolute, |
| 1135 | Mul: 1, |
| 1136 | Div: 1, |
| 1137 | Precision: 1, |
| 1138 | }, |
| 1139 | { |
| 1140 | Name: "inquiry", |
| 1141 | Algorithm: module.Absolute, |
| 1142 | Mul: 1, |
| 1143 | Div: 1, |
| 1144 | Precision: 1, |
| 1145 | }, |
| 1146 | { |
| 1147 | Name: "diagnostic", |
| 1148 | Algorithm: module.Absolute, |
| 1149 | Mul: 1, |
| 1150 | Div: 1, |
| 1151 | Precision: 1, |
| 1152 | }, |
| 1153 | { |
| 1154 | Name: "escape", |
| 1155 | Algorithm: module.Absolute, |
| 1156 | Mul: 1, |
| 1157 | Div: 1, |
| 1158 | Precision: 1, |
| 1159 | }, |
| 1160 | { |
| 1161 | Name: "notify", |
| 1162 | Algorithm: module.Absolute, |
| 1163 | Mul: 1, |
| 1164 | Div: 1, |
| 1165 | Precision: 1, |
| 1166 | }, |
| 1167 | { |
| 1168 | Name: "sender_copy", |
| 1169 | Algorithm: module.Absolute, |
| 1170 | Mul: 1, |
| 1171 | Div: 1, |
| 1172 | Precision: 1, |
| 1173 | }, |
| 1174 | }, |
| 1175 | LabelKeys: []string{ |
| 1176 | "library", |
| 1177 | "queue", |
| 1178 | }, |
| 1179 | }, |
| 1180 | }, |
| 1181 | Severity: MessageQueueSeverityContext{ |
| 1182 | Context: framework.Context[MessageQueueLabels]{ |
| 1183 | Name: "as400.message_queue_severity", |
| 1184 | Family: "queues/message", |
| 1185 | Title: "Message Queue Severity", |
| 1186 | Units: "severity", |
| 1187 | Type: module.Line, |
| 1188 | Priority: 701, |
| 1189 | UpdateEvery: 1, |
| 1190 | Dimensions: []framework.Dimension{ |
| 1191 | { |
| 1192 | Name: "max", |
| 1193 | Algorithm: module.Absolute, |
| 1194 | Mul: 1, |
| 1195 | Div: 1, |
| 1196 | Precision: 1, |
| 1197 | }, |
| 1198 | }, |
| 1199 | LabelKeys: []string{ |
| 1200 | "library", |
| 1201 | "queue", |
| 1202 | }, |
| 1203 | }, |
| 1204 | }, |
| 1205 | } |
| 1206 | |
| 1207 | // --- NetworkInterface --- |
| 1208 | |
| 1209 | // NetworkInterfaceStatusValues defines the type-safe values for NetworkInterface.Status context |
| 1210 | type NetworkInterfaceStatusValues struct { |
| 1211 | Active int64 |
| 1212 | } |
| 1213 | |
| 1214 | // NetworkInterfaceStatusContext provides type-safe operations for NetworkInterface.Status context |
| 1215 | type NetworkInterfaceStatusContext struct { |
| 1216 | framework.Context[NetworkInterfaceLabels] |
| 1217 | } |
| 1218 | |
| 1219 | // Set provides type-safe dimension setting for NetworkInterface.Status context |
| 1220 | func (c NetworkInterfaceStatusContext) Set(state *framework.CollectorState, labels NetworkInterfaceLabels, values NetworkInterfaceStatusValues) { |
| 1221 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1222 | "active": values.Active, |
| 1223 | }) |
| 1224 | } |
| 1225 | |
| 1226 | // SetUpdateEvery sets the update interval for this instance |
| 1227 | func (c NetworkInterfaceStatusContext) SetUpdateEvery(state *framework.CollectorState, labels NetworkInterfaceLabels, updateEvery int) { |
| 1228 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1229 | } |
| 1230 | |
| 1231 | // NetworkInterfaceMTUValues defines the type-safe values for NetworkInterface.MTU context |
| 1232 | type NetworkInterfaceMTUValues struct { |
| 1233 | Mtu int64 |
| 1234 | } |
| 1235 | |
| 1236 | // NetworkInterfaceMTUContext provides type-safe operations for NetworkInterface.MTU context |
| 1237 | type NetworkInterfaceMTUContext struct { |
| 1238 | framework.Context[NetworkInterfaceLabels] |
| 1239 | } |
| 1240 | |
| 1241 | // Set provides type-safe dimension setting for NetworkInterface.MTU context |
| 1242 | func (c NetworkInterfaceMTUContext) Set(state *framework.CollectorState, labels NetworkInterfaceLabels, values NetworkInterfaceMTUValues) { |
| 1243 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1244 | "mtu": values.Mtu, |
| 1245 | }) |
| 1246 | } |
| 1247 | |
| 1248 | // SetUpdateEvery sets the update interval for this instance |
| 1249 | func (c NetworkInterfaceMTUContext) SetUpdateEvery(state *framework.CollectorState, labels NetworkInterfaceLabels, updateEvery int) { |
| 1250 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1251 | } |
| 1252 | |
| 1253 | // NetworkInterfaceLabels defines the required labels for NetworkInterface contexts |
| 1254 | type NetworkInterfaceLabels struct { |
| 1255 | Interface string |
| 1256 | Interface_type string |
| 1257 | Connection_type string |
| 1258 | Internet_address string |
| 1259 | Network_address string |
| 1260 | Subnet_mask string |
| 1261 | } |
| 1262 | |
| 1263 | // InstanceID generates a unique instance ID using the hardcoded label order from YAML |
| 1264 | func (l NetworkInterfaceLabels) InstanceID(contextName string) string { |
| 1265 | // Label order from YAML: interface, interface_type, connection_type, internet_address, network_address, subnet_mask |
| 1266 | return contextName + "." + cleanLabelValue(l.Interface) + "_" + cleanLabelValue(l.Interface_type) + "_" + cleanLabelValue(l.Connection_type) + "_" + cleanLabelValue(l.Internet_address) + "_" + cleanLabelValue(l.Network_address) + "_" + cleanLabelValue(l.Subnet_mask) |
| 1267 | } |
| 1268 | |
| 1269 | // NetworkInterface contains all metric contexts for NetworkInterface |
| 1270 | var NetworkInterface = struct { |
| 1271 | Status NetworkInterfaceStatusContext |
| 1272 | MTU NetworkInterfaceMTUContext |
| 1273 | }{ |
| 1274 | Status: NetworkInterfaceStatusContext{ |
| 1275 | Context: framework.Context[NetworkInterfaceLabels]{ |
| 1276 | Name: "as400.network_interface_status", |
| 1277 | Family: "network/interfaces", |
| 1278 | Title: "Network Interface Status", |
| 1279 | Units: "status", |
| 1280 | Type: module.Line, |
| 1281 | Priority: 403, |
| 1282 | UpdateEvery: 1, |
| 1283 | Dimensions: []framework.Dimension{ |
| 1284 | { |
| 1285 | Name: "active", |
| 1286 | Algorithm: module.Absolute, |
| 1287 | Mul: 1, |
| 1288 | Div: 1, |
| 1289 | Precision: 1, |
| 1290 | }, |
| 1291 | }, |
| 1292 | LabelKeys: []string{ |
| 1293 | "interface", |
| 1294 | "interface_type", |
| 1295 | "connection_type", |
| 1296 | "internet_address", |
| 1297 | "network_address", |
| 1298 | "subnet_mask", |
| 1299 | }, |
| 1300 | }, |
| 1301 | }, |
| 1302 | MTU: NetworkInterfaceMTUContext{ |
| 1303 | Context: framework.Context[NetworkInterfaceLabels]{ |
| 1304 | Name: "as400.network_interface_mtu", |
| 1305 | Family: "network/interfaces", |
| 1306 | Title: "Network Interface MTU", |
| 1307 | Units: "bytes", |
| 1308 | Type: module.Line, |
| 1309 | Priority: 404, |
| 1310 | UpdateEvery: 1, |
| 1311 | Dimensions: []framework.Dimension{ |
| 1312 | { |
| 1313 | Name: "mtu", |
| 1314 | Algorithm: module.Absolute, |
| 1315 | Mul: 1, |
| 1316 | Div: 1, |
| 1317 | Precision: 1, |
| 1318 | }, |
| 1319 | }, |
| 1320 | LabelKeys: []string{ |
| 1321 | "interface", |
| 1322 | "interface_type", |
| 1323 | "connection_type", |
| 1324 | "internet_address", |
| 1325 | "network_address", |
| 1326 | "subnet_mask", |
| 1327 | }, |
| 1328 | }, |
| 1329 | }, |
| 1330 | } |
| 1331 | |
| 1332 | // --- Observability --- |
| 1333 | |
| 1334 | // ObservabilityQueryLatencyFastValues defines the type-safe values for Observability.QueryLatencyFast context |
| 1335 | type ObservabilityQueryLatencyFastValues struct { |
| 1336 | Count_disks int64 |
| 1337 | Count_http_servers int64 |
| 1338 | Count_network_interfaces int64 |
| 1339 | Detect_ibmi_version_primary int64 |
| 1340 | Detect_ibmi_version_fallback int64 |
| 1341 | Disk_instances int64 |
| 1342 | Disk_instances_enhanced int64 |
| 1343 | Disk_status int64 |
| 1344 | Http_server_info int64 |
| 1345 | Job_info int64 |
| 1346 | Memory_pools int64 |
| 1347 | Network_connections int64 |
| 1348 | Network_interfaces int64 |
| 1349 | Serial_number int64 |
| 1350 | System_name int64 |
| 1351 | System_activity int64 |
| 1352 | System_model int64 |
| 1353 | System_status int64 |
| 1354 | Temp_storage_named int64 |
| 1355 | Temp_storage_total int64 |
| 1356 | Technology_refresh_level int64 |
| 1357 | Active_job int64 |
| 1358 | } |
| 1359 | |
| 1360 | // ObservabilityQueryLatencyFastContext provides type-safe operations for Observability.QueryLatencyFast context |
| 1361 | type ObservabilityQueryLatencyFastContext struct { |
| 1362 | framework.Context[EmptyLabels] |
| 1363 | } |
| 1364 | |
| 1365 | // Set provides type-safe dimension setting for Observability.QueryLatencyFast context |
| 1366 | func (c ObservabilityQueryLatencyFastContext) Set(state *framework.CollectorState, labels EmptyLabels, values ObservabilityQueryLatencyFastValues) { |
| 1367 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 1368 | "count_disks": values.Count_disks, |
| 1369 | "count_http_servers": values.Count_http_servers, |
| 1370 | "count_network_interfaces": values.Count_network_interfaces, |
| 1371 | "detect_ibmi_version_primary": values.Detect_ibmi_version_primary, |
| 1372 | "detect_ibmi_version_fallback": values.Detect_ibmi_version_fallback, |
| 1373 | "disk_instances": values.Disk_instances, |
| 1374 | "disk_instances_enhanced": values.Disk_instances_enhanced, |
| 1375 | "disk_status": values.Disk_status, |
| 1376 | "http_server_info": values.Http_server_info, |
| 1377 | "job_info": values.Job_info, |
| 1378 | "memory_pools": values.Memory_pools, |
| 1379 | "network_connections": values.Network_connections, |
| 1380 | "network_interfaces": values.Network_interfaces, |
| 1381 | "serial_number": values.Serial_number, |
| 1382 | "system_name": values.System_name, |
| 1383 | "system_activity": values.System_activity, |
| 1384 | "system_model": values.System_model, |
| 1385 | "system_status": values.System_status, |
| 1386 | "temp_storage_named": values.Temp_storage_named, |
| 1387 | "temp_storage_total": values.Temp_storage_total, |
| 1388 | "technology_refresh_level": values.Technology_refresh_level, |
| 1389 | "active_job": values.Active_job, |
| 1390 | }) |
| 1391 | } |
| 1392 | |
| 1393 | // SetUpdateEvery sets the update interval for this instance |
| 1394 | func (c ObservabilityQueryLatencyFastContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 1395 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 1396 | } |
| 1397 | |
| 1398 | // ObservabilityQueryLatencySlowValues defines the type-safe values for Observability.QueryLatencySlow context |
| 1399 | type ObservabilityQueryLatencySlowValues struct { |
| 1400 | Analyze_plan_cache int64 |
| 1401 | Count_subsystems int64 |
| 1402 | Subsystems int64 |
| 1403 | Message_queue_aggregates int64 |
| 1404 | Job_queues int64 |
| 1405 | Output_queue_info int64 |
| 1406 | Plan_cache_summary int64 |
| 1407 | } |
| 1408 | |
| 1409 | // ObservabilityQueryLatencySlowContext provides type-safe operations for Observability.QueryLatencySlow context |
| 1410 | type ObservabilityQueryLatencySlowContext struct { |
| 1411 | framework.Context[EmptyLabels] |
| 1412 | } |
| 1413 | |
| 1414 | // Set provides type-safe dimension setting for Observability.QueryLatencySlow context |
| 1415 | func (c ObservabilityQueryLatencySlowContext) Set(state *framework.CollectorState, labels EmptyLabels, values ObservabilityQueryLatencySlowValues) { |
| 1416 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 1417 | "analyze_plan_cache": values.Analyze_plan_cache, |
| 1418 | "count_subsystems": values.Count_subsystems, |
| 1419 | "subsystems": values.Subsystems, |
| 1420 | "message_queue_aggregates": values.Message_queue_aggregates, |
| 1421 | "job_queues": values.Job_queues, |
| 1422 | "output_queue_info": values.Output_queue_info, |
| 1423 | "plan_cache_summary": values.Plan_cache_summary, |
| 1424 | }) |
| 1425 | } |
| 1426 | |
| 1427 | // SetUpdateEvery sets the update interval for this instance |
| 1428 | func (c ObservabilityQueryLatencySlowContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 1429 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 1430 | } |
| 1431 | |
| 1432 | // ObservabilityQueryLatencyBatchValues defines the type-safe values for Observability.QueryLatencyBatch context |
| 1433 | type ObservabilityQueryLatencyBatchValues struct { |
| 1434 | Message_queue_totals int64 |
| 1435 | Job_queue_totals int64 |
| 1436 | Output_queue_totals int64 |
| 1437 | } |
| 1438 | |
| 1439 | // ObservabilityQueryLatencyBatchContext provides type-safe operations for Observability.QueryLatencyBatch context |
| 1440 | type ObservabilityQueryLatencyBatchContext struct { |
| 1441 | framework.Context[EmptyLabels] |
| 1442 | } |
| 1443 | |
| 1444 | // Set provides type-safe dimension setting for Observability.QueryLatencyBatch context |
| 1445 | func (c ObservabilityQueryLatencyBatchContext) Set(state *framework.CollectorState, labels EmptyLabels, values ObservabilityQueryLatencyBatchValues) { |
| 1446 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 1447 | "message_queue_totals": values.Message_queue_totals, |
| 1448 | "job_queue_totals": values.Job_queue_totals, |
| 1449 | "output_queue_totals": values.Output_queue_totals, |
| 1450 | }) |
| 1451 | } |
| 1452 | |
| 1453 | // SetUpdateEvery sets the update interval for this instance |
| 1454 | func (c ObservabilityQueryLatencyBatchContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 1455 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 1456 | } |
| 1457 | |
| 1458 | // Observability contains all metric contexts for Observability |
| 1459 | var Observability = struct { |
| 1460 | QueryLatencyFast ObservabilityQueryLatencyFastContext |
| 1461 | QueryLatencySlow ObservabilityQueryLatencySlowContext |
| 1462 | QueryLatencyBatch ObservabilityQueryLatencyBatchContext |
| 1463 | }{ |
| 1464 | QueryLatencyFast: ObservabilityQueryLatencyFastContext{ |
| 1465 | Context: framework.Context[EmptyLabels]{ |
| 1466 | Name: "netdata.plugin_ibm.as400_query_latency_fast", |
| 1467 | Family: "plugins/ibm.d/latency", |
| 1468 | Title: "AS400 Query Latency (Fast Path)", |
| 1469 | Units: "ms", |
| 1470 | Type: module.Stacked, |
| 1471 | Priority: 146000, |
| 1472 | UpdateEvery: 1, |
| 1473 | Dimensions: []framework.Dimension{ |
| 1474 | { |
| 1475 | Name: "count_disks", |
| 1476 | Algorithm: module.Incremental, |
| 1477 | Mul: 1, |
| 1478 | Div: 1000, |
| 1479 | Precision: 1, |
| 1480 | }, |
| 1481 | { |
| 1482 | Name: "count_http_servers", |
| 1483 | Algorithm: module.Incremental, |
| 1484 | Mul: 1, |
| 1485 | Div: 1000, |
| 1486 | Precision: 1, |
| 1487 | }, |
| 1488 | { |
| 1489 | Name: "count_network_interfaces", |
| 1490 | Algorithm: module.Incremental, |
| 1491 | Mul: 1, |
| 1492 | Div: 1000, |
| 1493 | Precision: 1, |
| 1494 | }, |
| 1495 | { |
| 1496 | Name: "detect_ibmi_version_primary", |
| 1497 | Algorithm: module.Incremental, |
| 1498 | Mul: 1, |
| 1499 | Div: 1000, |
| 1500 | Precision: 1, |
| 1501 | }, |
| 1502 | { |
| 1503 | Name: "detect_ibmi_version_fallback", |
| 1504 | Algorithm: module.Incremental, |
| 1505 | Mul: 1, |
| 1506 | Div: 1000, |
| 1507 | Precision: 1, |
| 1508 | }, |
| 1509 | { |
| 1510 | Name: "disk_instances", |
| 1511 | Algorithm: module.Incremental, |
| 1512 | Mul: 1, |
| 1513 | Div: 1000, |
| 1514 | Precision: 1, |
| 1515 | }, |
| 1516 | { |
| 1517 | Name: "disk_instances_enhanced", |
| 1518 | Algorithm: module.Incremental, |
| 1519 | Mul: 1, |
| 1520 | Div: 1000, |
| 1521 | Precision: 1, |
| 1522 | }, |
| 1523 | { |
| 1524 | Name: "disk_status", |
| 1525 | Algorithm: module.Incremental, |
| 1526 | Mul: 1, |
| 1527 | Div: 1000, |
| 1528 | Precision: 1, |
| 1529 | }, |
| 1530 | { |
| 1531 | Name: "http_server_info", |
| 1532 | Algorithm: module.Incremental, |
| 1533 | Mul: 1, |
| 1534 | Div: 1000, |
| 1535 | Precision: 1, |
| 1536 | }, |
| 1537 | { |
| 1538 | Name: "job_info", |
| 1539 | Algorithm: module.Incremental, |
| 1540 | Mul: 1, |
| 1541 | Div: 1000, |
| 1542 | Precision: 1, |
| 1543 | }, |
| 1544 | { |
| 1545 | Name: "memory_pools", |
| 1546 | Algorithm: module.Incremental, |
| 1547 | Mul: 1, |
| 1548 | Div: 1000, |
| 1549 | Precision: 1, |
| 1550 | }, |
| 1551 | { |
| 1552 | Name: "network_connections", |
| 1553 | Algorithm: module.Incremental, |
| 1554 | Mul: 1, |
| 1555 | Div: 1000, |
| 1556 | Precision: 1, |
| 1557 | }, |
| 1558 | { |
| 1559 | Name: "network_interfaces", |
| 1560 | Algorithm: module.Incremental, |
| 1561 | Mul: 1, |
| 1562 | Div: 1000, |
| 1563 | Precision: 1, |
| 1564 | }, |
| 1565 | { |
| 1566 | Name: "serial_number", |
| 1567 | Algorithm: module.Incremental, |
| 1568 | Mul: 1, |
| 1569 | Div: 1000, |
| 1570 | Precision: 1, |
| 1571 | }, |
| 1572 | { |
| 1573 | Name: "system_name", |
| 1574 | Algorithm: module.Incremental, |
| 1575 | Mul: 1, |
| 1576 | Div: 1000, |
| 1577 | Precision: 1, |
| 1578 | }, |
| 1579 | { |
| 1580 | Name: "system_activity", |
| 1581 | Algorithm: module.Incremental, |
| 1582 | Mul: 1, |
| 1583 | Div: 1000, |
| 1584 | Precision: 1, |
| 1585 | }, |
| 1586 | { |
| 1587 | Name: "system_model", |
| 1588 | Algorithm: module.Incremental, |
| 1589 | Mul: 1, |
| 1590 | Div: 1000, |
| 1591 | Precision: 1, |
| 1592 | }, |
| 1593 | { |
| 1594 | Name: "system_status", |
| 1595 | Algorithm: module.Incremental, |
| 1596 | Mul: 1, |
| 1597 | Div: 1000, |
| 1598 | Precision: 1, |
| 1599 | }, |
| 1600 | { |
| 1601 | Name: "temp_storage_named", |
| 1602 | Algorithm: module.Incremental, |
| 1603 | Mul: 1, |
| 1604 | Div: 1000, |
| 1605 | Precision: 1, |
| 1606 | }, |
| 1607 | { |
| 1608 | Name: "temp_storage_total", |
| 1609 | Algorithm: module.Incremental, |
| 1610 | Mul: 1, |
| 1611 | Div: 1000, |
| 1612 | Precision: 1, |
| 1613 | }, |
| 1614 | { |
| 1615 | Name: "technology_refresh_level", |
| 1616 | Algorithm: module.Incremental, |
| 1617 | Mul: 1, |
| 1618 | Div: 1000, |
| 1619 | Precision: 1, |
| 1620 | }, |
| 1621 | { |
| 1622 | Name: "active_job", |
| 1623 | Algorithm: module.Incremental, |
| 1624 | Mul: 1, |
| 1625 | Div: 1000, |
| 1626 | Precision: 1, |
| 1627 | }, |
| 1628 | }, |
| 1629 | LabelKeys: []string{}, |
| 1630 | }, |
| 1631 | }, |
| 1632 | QueryLatencySlow: ObservabilityQueryLatencySlowContext{ |
| 1633 | Context: framework.Context[EmptyLabels]{ |
| 1634 | Name: "netdata.plugin_ibm.as400_query_latency_slow", |
| 1635 | Family: "plugins/ibm.d/latency", |
| 1636 | Title: "AS400 Query Latency (Slow Path)", |
| 1637 | Units: "ms", |
| 1638 | Type: module.Stacked, |
| 1639 | Priority: 146010, |
| 1640 | UpdateEvery: 1, |
| 1641 | Dimensions: []framework.Dimension{ |
| 1642 | { |
| 1643 | Name: "analyze_plan_cache", |
| 1644 | Algorithm: module.Incremental, |
| 1645 | Mul: 1, |
| 1646 | Div: 1000, |
| 1647 | Precision: 1, |
| 1648 | }, |
| 1649 | { |
| 1650 | Name: "count_subsystems", |
| 1651 | Algorithm: module.Incremental, |
| 1652 | Mul: 1, |
| 1653 | Div: 1000, |
| 1654 | Precision: 1, |
| 1655 | }, |
| 1656 | { |
| 1657 | Name: "subsystems", |
| 1658 | Algorithm: module.Incremental, |
| 1659 | Mul: 1, |
| 1660 | Div: 1000, |
| 1661 | Precision: 1, |
| 1662 | }, |
| 1663 | { |
| 1664 | Name: "message_queue_aggregates", |
| 1665 | Algorithm: module.Incremental, |
| 1666 | Mul: 1, |
| 1667 | Div: 1000, |
| 1668 | Precision: 1, |
| 1669 | }, |
| 1670 | { |
| 1671 | Name: "job_queues", |
| 1672 | Algorithm: module.Incremental, |
| 1673 | Mul: 1, |
| 1674 | Div: 1000, |
| 1675 | Precision: 1, |
| 1676 | }, |
| 1677 | { |
| 1678 | Name: "output_queue_info", |
| 1679 | Algorithm: module.Incremental, |
| 1680 | Mul: 1, |
| 1681 | Div: 1000, |
| 1682 | Precision: 1, |
| 1683 | }, |
| 1684 | { |
| 1685 | Name: "plan_cache_summary", |
| 1686 | Algorithm: module.Incremental, |
| 1687 | Mul: 1, |
| 1688 | Div: 1000, |
| 1689 | Precision: 1, |
| 1690 | }, |
| 1691 | }, |
| 1692 | LabelKeys: []string{}, |
| 1693 | }, |
| 1694 | }, |
| 1695 | QueryLatencyBatch: ObservabilityQueryLatencyBatchContext{ |
| 1696 | Context: framework.Context[EmptyLabels]{ |
| 1697 | Name: "netdata.plugin_ibm.as400_query_latency_batch", |
| 1698 | Family: "plugins/ibm.d/latency", |
| 1699 | Title: "AS400 Query Latency (Batch Path)", |
| 1700 | Units: "ms", |
| 1701 | Type: module.Stacked, |
| 1702 | Priority: 146020, |
| 1703 | UpdateEvery: 1, |
| 1704 | Dimensions: []framework.Dimension{ |
| 1705 | { |
| 1706 | Name: "message_queue_totals", |
| 1707 | Algorithm: module.Incremental, |
| 1708 | Mul: 1, |
| 1709 | Div: 1000, |
| 1710 | Precision: 1, |
| 1711 | }, |
| 1712 | { |
| 1713 | Name: "job_queue_totals", |
| 1714 | Algorithm: module.Incremental, |
| 1715 | Mul: 1, |
| 1716 | Div: 1000, |
| 1717 | Precision: 1, |
| 1718 | }, |
| 1719 | { |
| 1720 | Name: "output_queue_totals", |
| 1721 | Algorithm: module.Incremental, |
| 1722 | Mul: 1, |
| 1723 | Div: 1000, |
| 1724 | Precision: 1, |
| 1725 | }, |
| 1726 | }, |
| 1727 | LabelKeys: []string{}, |
| 1728 | }, |
| 1729 | }, |
| 1730 | } |
| 1731 | |
| 1732 | // --- OutputQueue --- |
| 1733 | |
| 1734 | // OutputQueueFilesValues defines the type-safe values for OutputQueue.Files context |
| 1735 | type OutputQueueFilesValues struct { |
| 1736 | Files int64 |
| 1737 | } |
| 1738 | |
| 1739 | // OutputQueueFilesContext provides type-safe operations for OutputQueue.Files context |
| 1740 | type OutputQueueFilesContext struct { |
| 1741 | framework.Context[OutputQueueLabels] |
| 1742 | } |
| 1743 | |
| 1744 | // Set provides type-safe dimension setting for OutputQueue.Files context |
| 1745 | func (c OutputQueueFilesContext) Set(state *framework.CollectorState, labels OutputQueueLabels, values OutputQueueFilesValues) { |
| 1746 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1747 | "files": values.Files, |
| 1748 | }) |
| 1749 | } |
| 1750 | |
| 1751 | // SetUpdateEvery sets the update interval for this instance |
| 1752 | func (c OutputQueueFilesContext) SetUpdateEvery(state *framework.CollectorState, labels OutputQueueLabels, updateEvery int) { |
| 1753 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1754 | } |
| 1755 | |
| 1756 | // OutputQueueWritersValues defines the type-safe values for OutputQueue.Writers context |
| 1757 | type OutputQueueWritersValues struct { |
| 1758 | Writers int64 |
| 1759 | } |
| 1760 | |
| 1761 | // OutputQueueWritersContext provides type-safe operations for OutputQueue.Writers context |
| 1762 | type OutputQueueWritersContext struct { |
| 1763 | framework.Context[OutputQueueLabels] |
| 1764 | } |
| 1765 | |
| 1766 | // Set provides type-safe dimension setting for OutputQueue.Writers context |
| 1767 | func (c OutputQueueWritersContext) Set(state *framework.CollectorState, labels OutputQueueLabels, values OutputQueueWritersValues) { |
| 1768 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1769 | "writers": values.Writers, |
| 1770 | }) |
| 1771 | } |
| 1772 | |
| 1773 | // SetUpdateEvery sets the update interval for this instance |
| 1774 | func (c OutputQueueWritersContext) SetUpdateEvery(state *framework.CollectorState, labels OutputQueueLabels, updateEvery int) { |
| 1775 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1776 | } |
| 1777 | |
| 1778 | // OutputQueueStatusValues defines the type-safe values for OutputQueue.Status context |
| 1779 | type OutputQueueStatusValues struct { |
| 1780 | Released int64 |
| 1781 | } |
| 1782 | |
| 1783 | // OutputQueueStatusContext provides type-safe operations for OutputQueue.Status context |
| 1784 | type OutputQueueStatusContext struct { |
| 1785 | framework.Context[OutputQueueLabels] |
| 1786 | } |
| 1787 | |
| 1788 | // Set provides type-safe dimension setting for OutputQueue.Status context |
| 1789 | func (c OutputQueueStatusContext) Set(state *framework.CollectorState, labels OutputQueueLabels, values OutputQueueStatusValues) { |
| 1790 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1791 | "released": values.Released, |
| 1792 | }) |
| 1793 | } |
| 1794 | |
| 1795 | // SetUpdateEvery sets the update interval for this instance |
| 1796 | func (c OutputQueueStatusContext) SetUpdateEvery(state *framework.CollectorState, labels OutputQueueLabels, updateEvery int) { |
| 1797 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1798 | } |
| 1799 | |
| 1800 | // OutputQueueLabels defines the required labels for OutputQueue contexts |
| 1801 | type OutputQueueLabels struct { |
| 1802 | Library string |
| 1803 | Queue string |
| 1804 | Status string |
| 1805 | } |
| 1806 | |
| 1807 | // InstanceID generates a unique instance ID using the hardcoded label order from YAML |
| 1808 | func (l OutputQueueLabels) InstanceID(contextName string) string { |
| 1809 | // Label order from YAML: library, queue, status |
| 1810 | return contextName + "." + cleanLabelValue(l.Library) + "_" + cleanLabelValue(l.Queue) + "_" + cleanLabelValue(l.Status) |
| 1811 | } |
| 1812 | |
| 1813 | // OutputQueue contains all metric contexts for OutputQueue |
| 1814 | var OutputQueue = struct { |
| 1815 | Files OutputQueueFilesContext |
| 1816 | Writers OutputQueueWritersContext |
| 1817 | Status OutputQueueStatusContext |
| 1818 | }{ |
| 1819 | Files: OutputQueueFilesContext{ |
| 1820 | Context: framework.Context[OutputQueueLabels]{ |
| 1821 | Name: "as400.output_queue_files", |
| 1822 | Family: "queues/output", |
| 1823 | Title: "Output Queue Files", |
| 1824 | Units: "files", |
| 1825 | Type: module.Line, |
| 1826 | Priority: 702, |
| 1827 | UpdateEvery: 1, |
| 1828 | Dimensions: []framework.Dimension{ |
| 1829 | { |
| 1830 | Name: "files", |
| 1831 | Algorithm: module.Absolute, |
| 1832 | Mul: 1, |
| 1833 | Div: 1, |
| 1834 | Precision: 1, |
| 1835 | }, |
| 1836 | }, |
| 1837 | LabelKeys: []string{ |
| 1838 | "library", |
| 1839 | "queue", |
| 1840 | "status", |
| 1841 | }, |
| 1842 | }, |
| 1843 | }, |
| 1844 | Writers: OutputQueueWritersContext{ |
| 1845 | Context: framework.Context[OutputQueueLabels]{ |
| 1846 | Name: "as400.output_queue_writers", |
| 1847 | Family: "queues/output", |
| 1848 | Title: "Output Queue Writers", |
| 1849 | Units: "writers", |
| 1850 | Type: module.Line, |
| 1851 | Priority: 703, |
| 1852 | UpdateEvery: 1, |
| 1853 | Dimensions: []framework.Dimension{ |
| 1854 | { |
| 1855 | Name: "writers", |
| 1856 | Algorithm: module.Absolute, |
| 1857 | Mul: 1, |
| 1858 | Div: 1, |
| 1859 | Precision: 1, |
| 1860 | }, |
| 1861 | }, |
| 1862 | LabelKeys: []string{ |
| 1863 | "library", |
| 1864 | "queue", |
| 1865 | "status", |
| 1866 | }, |
| 1867 | }, |
| 1868 | }, |
| 1869 | Status: OutputQueueStatusContext{ |
| 1870 | Context: framework.Context[OutputQueueLabels]{ |
| 1871 | Name: "as400.output_queue_status", |
| 1872 | Family: "queues/output", |
| 1873 | Title: "Output Queue Status", |
| 1874 | Units: "state", |
| 1875 | Type: module.Line, |
| 1876 | Priority: 704, |
| 1877 | UpdateEvery: 1, |
| 1878 | Dimensions: []framework.Dimension{ |
| 1879 | { |
| 1880 | Name: "released", |
| 1881 | Algorithm: module.Absolute, |
| 1882 | Mul: 1, |
| 1883 | Div: 1, |
| 1884 | Precision: 1, |
| 1885 | }, |
| 1886 | }, |
| 1887 | LabelKeys: []string{ |
| 1888 | "library", |
| 1889 | "queue", |
| 1890 | "status", |
| 1891 | }, |
| 1892 | }, |
| 1893 | }, |
| 1894 | } |
| 1895 | |
| 1896 | // --- PlanCache --- |
| 1897 | |
| 1898 | // PlanCacheSummaryValues defines the type-safe values for PlanCache.Summary context |
| 1899 | type PlanCacheSummaryValues struct { |
| 1900 | Value int64 |
| 1901 | } |
| 1902 | |
| 1903 | // PlanCacheSummaryContext provides type-safe operations for PlanCache.Summary context |
| 1904 | type PlanCacheSummaryContext struct { |
| 1905 | framework.Context[PlanCacheLabels] |
| 1906 | } |
| 1907 | |
| 1908 | // Set provides type-safe dimension setting for PlanCache.Summary context |
| 1909 | func (c PlanCacheSummaryContext) Set(state *framework.CollectorState, labels PlanCacheLabels, values PlanCacheSummaryValues) { |
| 1910 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1911 | "value": values.Value, |
| 1912 | }) |
| 1913 | } |
| 1914 | |
| 1915 | // SetUpdateEvery sets the update interval for this instance |
| 1916 | func (c PlanCacheSummaryContext) SetUpdateEvery(state *framework.CollectorState, labels PlanCacheLabels, updateEvery int) { |
| 1917 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1918 | } |
| 1919 | |
| 1920 | // PlanCacheLabels defines the required labels for PlanCache contexts |
| 1921 | type PlanCacheLabels struct { |
| 1922 | Metric string |
| 1923 | } |
| 1924 | |
| 1925 | // InstanceID generates a unique instance ID using the hardcoded label order from YAML |
| 1926 | func (l PlanCacheLabels) InstanceID(contextName string) string { |
| 1927 | // Label order from YAML: metric |
| 1928 | return contextName + "." + cleanLabelValue(l.Metric) |
| 1929 | } |
| 1930 | |
| 1931 | // PlanCache contains all metric contexts for PlanCache |
| 1932 | var PlanCache = struct { |
| 1933 | Summary PlanCacheSummaryContext |
| 1934 | }{ |
| 1935 | Summary: PlanCacheSummaryContext{ |
| 1936 | Context: framework.Context[PlanCacheLabels]{ |
| 1937 | Name: "as400.plan_cache_summary", |
| 1938 | Family: "database/cache", |
| 1939 | Title: "Plan Cache Summary", |
| 1940 | Units: "value", |
| 1941 | Type: module.Line, |
| 1942 | Priority: 802, |
| 1943 | UpdateEvery: 1, |
| 1944 | Dimensions: []framework.Dimension{ |
| 1945 | { |
| 1946 | Name: "value", |
| 1947 | Algorithm: module.Absolute, |
| 1948 | Mul: 1, |
| 1949 | Div: 1000, |
| 1950 | Precision: 1, |
| 1951 | }, |
| 1952 | }, |
| 1953 | LabelKeys: []string{ |
| 1954 | "metric", |
| 1955 | }, |
| 1956 | }, |
| 1957 | }, |
| 1958 | } |
| 1959 | |
| 1960 | // --- QueueOverview --- |
| 1961 | |
| 1962 | // QueueOverviewCountValues defines the type-safe values for QueueOverview.Count context |
| 1963 | type QueueOverviewCountValues struct { |
| 1964 | Queues int64 |
| 1965 | } |
| 1966 | |
| 1967 | // QueueOverviewCountContext provides type-safe operations for QueueOverview.Count context |
| 1968 | type QueueOverviewCountContext struct { |
| 1969 | framework.Context[QueueOverviewLabels] |
| 1970 | } |
| 1971 | |
| 1972 | // Set provides type-safe dimension setting for QueueOverview.Count context |
| 1973 | func (c QueueOverviewCountContext) Set(state *framework.CollectorState, labels QueueOverviewLabels, values QueueOverviewCountValues) { |
| 1974 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1975 | "queues": values.Queues, |
| 1976 | }) |
| 1977 | } |
| 1978 | |
| 1979 | // SetUpdateEvery sets the update interval for this instance |
| 1980 | func (c QueueOverviewCountContext) SetUpdateEvery(state *framework.CollectorState, labels QueueOverviewLabels, updateEvery int) { |
| 1981 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1982 | } |
| 1983 | |
| 1984 | // QueueOverviewItemsValues defines the type-safe values for QueueOverview.Items context |
| 1985 | type QueueOverviewItemsValues struct { |
| 1986 | Items int64 |
| 1987 | } |
| 1988 | |
| 1989 | // QueueOverviewItemsContext provides type-safe operations for QueueOverview.Items context |
| 1990 | type QueueOverviewItemsContext struct { |
| 1991 | framework.Context[QueueOverviewLabels] |
| 1992 | } |
| 1993 | |
| 1994 | // Set provides type-safe dimension setting for QueueOverview.Items context |
| 1995 | func (c QueueOverviewItemsContext) Set(state *framework.CollectorState, labels QueueOverviewLabels, values QueueOverviewItemsValues) { |
| 1996 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1997 | "items": values.Items, |
| 1998 | }) |
| 1999 | } |
| 2000 | |
| 2001 | // SetUpdateEvery sets the update interval for this instance |
| 2002 | func (c QueueOverviewItemsContext) SetUpdateEvery(state *framework.CollectorState, labels QueueOverviewLabels, updateEvery int) { |
| 2003 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 2004 | } |
| 2005 | |
| 2006 | // QueueOverviewLabels defines the required labels for QueueOverview contexts |
| 2007 | type QueueOverviewLabels struct { |
| 2008 | Queue_type string |
| 2009 | Item_type string |
| 2010 | } |
| 2011 | |
| 2012 | // InstanceID generates a unique instance ID using the hardcoded label order from YAML |
| 2013 | func (l QueueOverviewLabels) InstanceID(contextName string) string { |
| 2014 | // Label order from YAML: queue_type, item_type |
| 2015 | return contextName + "." + cleanLabelValue(l.Queue_type) + "_" + cleanLabelValue(l.Item_type) |
| 2016 | } |
| 2017 | |
| 2018 | // QueueOverview contains all metric contexts for QueueOverview |
| 2019 | var QueueOverview = struct { |
| 2020 | Count QueueOverviewCountContext |
| 2021 | Items QueueOverviewItemsContext |
| 2022 | }{ |
| 2023 | Count: QueueOverviewCountContext{ |
| 2024 | Context: framework.Context[QueueOverviewLabels]{ |
| 2025 | Name: "as400.queues_count", |
| 2026 | Family: "queues/overview", |
| 2027 | Title: "Queue Counts", |
| 2028 | Units: "queues", |
| 2029 | Type: module.Line, |
| 2030 | Priority: 504, |
| 2031 | UpdateEvery: 1, |
| 2032 | Dimensions: []framework.Dimension{ |
| 2033 | { |
| 2034 | Name: "queues", |
| 2035 | Algorithm: module.Absolute, |
| 2036 | Mul: 1, |
| 2037 | Div: 1, |
| 2038 | Precision: 1, |
| 2039 | }, |
| 2040 | }, |
| 2041 | LabelKeys: []string{ |
| 2042 | "queue_type", |
| 2043 | "item_type", |
| 2044 | }, |
| 2045 | }, |
| 2046 | }, |
| 2047 | Items: QueueOverviewItemsContext{ |
| 2048 | Context: framework.Context[QueueOverviewLabels]{ |
| 2049 | Name: "as400.queued_items", |
| 2050 | Family: "queues/overview", |
| 2051 | Title: "Queued Items", |
| 2052 | Units: "items", |
| 2053 | Type: module.Line, |
| 2054 | Priority: 505, |
| 2055 | UpdateEvery: 1, |
| 2056 | Dimensions: []framework.Dimension{ |
| 2057 | { |
| 2058 | Name: "items", |
| 2059 | Algorithm: module.Absolute, |
| 2060 | Mul: 1, |
| 2061 | Div: 1, |
| 2062 | Precision: 1, |
| 2063 | }, |
| 2064 | }, |
| 2065 | LabelKeys: []string{ |
| 2066 | "queue_type", |
| 2067 | "item_type", |
| 2068 | }, |
| 2069 | }, |
| 2070 | }, |
| 2071 | } |
| 2072 | |
| 2073 | // --- Subsystem --- |
| 2074 | |
| 2075 | // SubsystemJobsValues defines the type-safe values for Subsystem.Jobs context |
| 2076 | type SubsystemJobsValues struct { |
| 2077 | Active int64 |
| 2078 | Maximum int64 |
| 2079 | } |
| 2080 | |
| 2081 | // SubsystemJobsContext provides type-safe operations for Subsystem.Jobs context |
| 2082 | type SubsystemJobsContext struct { |
| 2083 | framework.Context[SubsystemLabels] |
| 2084 | } |
| 2085 | |
| 2086 | // Set provides type-safe dimension setting for Subsystem.Jobs context |
| 2087 | func (c SubsystemJobsContext) Set(state *framework.CollectorState, labels SubsystemLabels, values SubsystemJobsValues) { |
| 2088 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 2089 | "active": values.Active, |
| 2090 | "maximum": values.Maximum, |
| 2091 | }) |
| 2092 | } |
| 2093 | |
| 2094 | // SetUpdateEvery sets the update interval for this instance |
| 2095 | func (c SubsystemJobsContext) SetUpdateEvery(state *framework.CollectorState, labels SubsystemLabels, updateEvery int) { |
| 2096 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 2097 | } |
| 2098 | |
| 2099 | // SubsystemLabels defines the required labels for Subsystem contexts |
| 2100 | type SubsystemLabels struct { |
| 2101 | Subsystem string |
| 2102 | Library string |
| 2103 | Status string |
| 2104 | } |
| 2105 | |
| 2106 | // InstanceID generates a unique instance ID using the hardcoded label order from YAML |
| 2107 | func (l SubsystemLabels) InstanceID(contextName string) string { |
| 2108 | // Label order from YAML: subsystem, library, status |
| 2109 | return contextName + "." + cleanLabelValue(l.Subsystem) + "_" + cleanLabelValue(l.Library) + "_" + cleanLabelValue(l.Status) |
| 2110 | } |
| 2111 | |
| 2112 | // Subsystem contains all metric contexts for Subsystem |
| 2113 | var Subsystem = struct { |
| 2114 | Jobs SubsystemJobsContext |
| 2115 | }{ |
| 2116 | Jobs: SubsystemJobsContext{ |
| 2117 | Context: framework.Context[SubsystemLabels]{ |
| 2118 | Name: "as400.subsystem_jobs", |
| 2119 | Family: "workloads/subsystems", |
| 2120 | Title: "Subsystem Jobs", |
| 2121 | Units: "jobs", |
| 2122 | Type: module.Line, |
| 2123 | Priority: 504, |
| 2124 | UpdateEvery: 1, |
| 2125 | Dimensions: []framework.Dimension{ |
| 2126 | { |
| 2127 | Name: "active", |
| 2128 | Algorithm: module.Absolute, |
| 2129 | Mul: 1, |
| 2130 | Div: 1, |
| 2131 | Precision: 1, |
| 2132 | }, |
| 2133 | { |
| 2134 | Name: "maximum", |
| 2135 | Algorithm: module.Absolute, |
| 2136 | Mul: 1, |
| 2137 | Div: 1, |
| 2138 | Precision: 1, |
| 2139 | }, |
| 2140 | }, |
| 2141 | LabelKeys: []string{ |
| 2142 | "subsystem", |
| 2143 | "library", |
| 2144 | "status", |
| 2145 | }, |
| 2146 | }, |
| 2147 | }, |
| 2148 | } |
| 2149 | |
| 2150 | // --- System --- |
| 2151 | |
| 2152 | // SystemCPUUtilizationValues defines the type-safe values for System.CPUUtilization context |
| 2153 | type SystemCPUUtilizationValues struct { |
| 2154 | Utilization int64 |
| 2155 | } |
| 2156 | |
| 2157 | // SystemCPUUtilizationContext provides type-safe operations for System.CPUUtilization context |
| 2158 | type SystemCPUUtilizationContext struct { |
| 2159 | framework.Context[EmptyLabels] |
| 2160 | } |
| 2161 | |
| 2162 | // Set provides type-safe dimension setting for System.CPUUtilization context |
| 2163 | func (c SystemCPUUtilizationContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemCPUUtilizationValues) { |
| 2164 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 2165 | "utilization": values.Utilization, |
| 2166 | }) |
| 2167 | } |
| 2168 | |
| 2169 | // SetUpdateEvery sets the update interval for this instance |
| 2170 | func (c SystemCPUUtilizationContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 2171 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 2172 | } |
| 2173 | |
| 2174 | // SystemCPUEntitledUtilizationValues defines the type-safe values for System.CPUEntitledUtilization context |
| 2175 | type SystemCPUEntitledUtilizationValues struct { |
| 2176 | Utilization int64 |
| 2177 | } |
| 2178 | |
| 2179 | // SystemCPUEntitledUtilizationContext provides type-safe operations for System.CPUEntitledUtilization context |
| 2180 | type SystemCPUEntitledUtilizationContext struct { |
| 2181 | framework.Context[EmptyLabels] |
| 2182 | } |
| 2183 | |
| 2184 | // Set provides type-safe dimension setting for System.CPUEntitledUtilization context |
| 2185 | func (c SystemCPUEntitledUtilizationContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemCPUEntitledUtilizationValues) { |
| 2186 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 2187 | "utilization": values.Utilization, |
| 2188 | }) |
| 2189 | } |
| 2190 | |
| 2191 | // SetUpdateEvery sets the update interval for this instance |
| 2192 | func (c SystemCPUEntitledUtilizationContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 2193 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 2194 | } |
| 2195 | |
| 2196 | // SystemCPUDetailsValues defines the type-safe values for System.CPUDetails context |
| 2197 | type SystemCPUDetailsValues struct { |
| 2198 | Configured int64 |
| 2199 | } |
| 2200 | |
| 2201 | // SystemCPUDetailsContext provides type-safe operations for System.CPUDetails context |
| 2202 | type SystemCPUDetailsContext struct { |
| 2203 | framework.Context[EmptyLabels] |
| 2204 | } |
| 2205 | |
| 2206 | // Set provides type-safe dimension setting for System.CPUDetails context |
| 2207 | func (c SystemCPUDetailsContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemCPUDetailsValues) { |
| 2208 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 2209 | "configured": values.Configured, |
| 2210 | }) |
| 2211 | } |
| 2212 | |
| 2213 | // SetUpdateEvery sets the update interval for this instance |
| 2214 | func (c SystemCPUDetailsContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 2215 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 2216 | } |
| 2217 | |
| 2218 | // SystemCPUCapacityValues defines the type-safe values for System.CPUCapacity context |
| 2219 | type SystemCPUCapacityValues struct { |
| 2220 | Capacity int64 |
| 2221 | } |
| 2222 | |
| 2223 | // SystemCPUCapacityContext provides type-safe operations for System.CPUCapacity context |
| 2224 | type SystemCPUCapacityContext struct { |
| 2225 | framework.Context[EmptyLabels] |
| 2226 | } |
| 2227 | |
| 2228 | // Set provides type-safe dimension setting for System.CPUCapacity context |
| 2229 | func (c SystemCPUCapacityContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemCPUCapacityValues) { |
| 2230 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 2231 | "capacity": values.Capacity, |
| 2232 | }) |
| 2233 | } |
| 2234 | |
| 2235 | // SetUpdateEvery sets the update interval for this instance |
| 2236 | func (c SystemCPUCapacityContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 2237 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 2238 | } |
| 2239 | |
| 2240 | // SystemTotalJobsValues defines the type-safe values for System.TotalJobs context |
| 2241 | type SystemTotalJobsValues struct { |
| 2242 | Total int64 |
| 2243 | } |
| 2244 | |
| 2245 | // SystemTotalJobsContext provides type-safe operations for System.TotalJobs context |
| 2246 | type SystemTotalJobsContext struct { |
| 2247 | framework.Context[EmptyLabels] |
| 2248 | } |
| 2249 | |
| 2250 | // Set provides type-safe dimension setting for System.TotalJobs context |
| 2251 | func (c SystemTotalJobsContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemTotalJobsValues) { |
| 2252 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 2253 | "total": values.Total, |
| 2254 | }) |
| 2255 | } |
| 2256 | |
| 2257 | // SetUpdateEvery sets the update interval for this instance |
| 2258 | func (c SystemTotalJobsContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 2259 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 2260 | } |
| 2261 | |
| 2262 | // SystemActiveJobsByTypeValues defines the type-safe values for System.ActiveJobsByType context |
| 2263 | type SystemActiveJobsByTypeValues struct { |
| 2264 | Batch int64 |
| 2265 | Interactive int64 |
| 2266 | Active int64 |
| 2267 | } |
| 2268 | |
| 2269 | // SystemActiveJobsByTypeContext provides type-safe operations for System.ActiveJobsByType context |
| 2270 | type SystemActiveJobsByTypeContext struct { |
| 2271 | framework.Context[EmptyLabels] |
| 2272 | } |
| 2273 | |
| 2274 | // Set provides type-safe dimension setting for System.ActiveJobsByType context |
| 2275 | func (c SystemActiveJobsByTypeContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemActiveJobsByTypeValues) { |
| 2276 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 2277 | "batch": values.Batch, |
| 2278 | "interactive": values.Interactive, |
| 2279 | "active": values.Active, |
| 2280 | }) |
| 2281 | } |
| 2282 | |
| 2283 | // SetUpdateEvery sets the update interval for this instance |
| 2284 | func (c SystemActiveJobsByTypeContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 2285 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 2286 | } |
| 2287 | |
| 2288 | // SystemJobQueueLengthValues defines the type-safe values for System.JobQueueLength context |
| 2289 | type SystemJobQueueLengthValues struct { |
| 2290 | Waiting int64 |
| 2291 | } |
| 2292 | |
| 2293 | // SystemJobQueueLengthContext provides type-safe operations for System.JobQueueLength context |
| 2294 | type SystemJobQueueLengthContext struct { |
| 2295 | framework.Context[EmptyLabels] |
| 2296 | } |
| 2297 | |
| 2298 | // Set provides type-safe dimension setting for System.JobQueueLength context |
| 2299 | func (c SystemJobQueueLengthContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemJobQueueLengthValues) { |
| 2300 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 2301 | "waiting": values.Waiting, |
| 2302 | }) |
| 2303 | } |
| 2304 | |
| 2305 | // SetUpdateEvery sets the update interval for this instance |
| 2306 | func (c SystemJobQueueLengthContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 2307 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 2308 | } |
| 2309 | |
| 2310 | // SystemMainStorageSizeValues defines the type-safe values for System.MainStorageSize context |
| 2311 | type SystemMainStorageSizeValues struct { |
| 2312 | Total int64 |
| 2313 | } |
| 2314 | |
| 2315 | // SystemMainStorageSizeContext provides type-safe operations for System.MainStorageSize context |
| 2316 | type SystemMainStorageSizeContext struct { |
| 2317 | framework.Context[EmptyLabels] |
| 2318 | } |
| 2319 | |
| 2320 | // Set provides type-safe dimension setting for System.MainStorageSize context |
| 2321 | func (c SystemMainStorageSizeContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemMainStorageSizeValues) { |
| 2322 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 2323 | "total": values.Total, |
| 2324 | }) |
| 2325 | } |
| 2326 | |
| 2327 | // SetUpdateEvery sets the update interval for this instance |
| 2328 | func (c SystemMainStorageSizeContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 2329 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 2330 | } |
| 2331 | |
| 2332 | // SystemTemporaryStorageValues defines the type-safe values for System.TemporaryStorage context |
| 2333 | type SystemTemporaryStorageValues struct { |
| 2334 | Current int64 |
| 2335 | Maximum int64 |
| 2336 | } |
| 2337 | |
| 2338 | // SystemTemporaryStorageContext provides type-safe operations for System.TemporaryStorage context |
| 2339 | type SystemTemporaryStorageContext struct { |
| 2340 | framework.Context[EmptyLabels] |
| 2341 | } |
| 2342 | |
| 2343 | // Set provides type-safe dimension setting for System.TemporaryStorage context |
| 2344 | func (c SystemTemporaryStorageContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemTemporaryStorageValues) { |
| 2345 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 2346 | "current": values.Current, |
| 2347 | "maximum": values.Maximum, |
| 2348 | }) |
| 2349 | } |
| 2350 | |
| 2351 | // SetUpdateEvery sets the update interval for this instance |
| 2352 | func (c SystemTemporaryStorageContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 2353 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 2354 | } |
| 2355 | |
| 2356 | // SystemMemoryPoolUsageValues defines the type-safe values for System.MemoryPoolUsage context |
| 2357 | type SystemMemoryPoolUsageValues struct { |
| 2358 | Machine int64 |
| 2359 | Base int64 |
| 2360 | Interactive int64 |
| 2361 | Spool int64 |
| 2362 | } |
| 2363 | |
| 2364 | // SystemMemoryPoolUsageContext provides type-safe operations for System.MemoryPoolUsage context |
| 2365 | type SystemMemoryPoolUsageContext struct { |
| 2366 | framework.Context[EmptyLabels] |
| 2367 | } |
| 2368 | |
| 2369 | // Set provides type-safe dimension setting for System.MemoryPoolUsage context |
| 2370 | func (c SystemMemoryPoolUsageContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemMemoryPoolUsageValues) { |
| 2371 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 2372 | "machine": values.Machine, |
| 2373 | "base": values.Base, |
| 2374 | "interactive": values.Interactive, |
| 2375 | "spool": values.Spool, |
| 2376 | }) |
| 2377 | } |
| 2378 | |
| 2379 | // SetUpdateEvery sets the update interval for this instance |
| 2380 | func (c SystemMemoryPoolUsageContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 2381 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 2382 | } |
| 2383 | |
| 2384 | // SystemMemoryPoolDefinedValues defines the type-safe values for System.MemoryPoolDefined context |
| 2385 | type SystemMemoryPoolDefinedValues struct { |
| 2386 | Machine int64 |
| 2387 | Base int64 |
| 2388 | } |
| 2389 | |
| 2390 | // SystemMemoryPoolDefinedContext provides type-safe operations for System.MemoryPoolDefined context |
| 2391 | type SystemMemoryPoolDefinedContext struct { |
| 2392 | framework.Context[EmptyLabels] |
| 2393 | } |
| 2394 | |
| 2395 | // Set provides type-safe dimension setting for System.MemoryPoolDefined context |
| 2396 | func (c SystemMemoryPoolDefinedContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemMemoryPoolDefinedValues) { |
| 2397 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 2398 | "machine": values.Machine, |
| 2399 | "base": values.Base, |
| 2400 | }) |
| 2401 | } |
| 2402 | |
| 2403 | // SetUpdateEvery sets the update interval for this instance |
| 2404 | func (c SystemMemoryPoolDefinedContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 2405 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 2406 | } |
| 2407 | |
| 2408 | // SystemMemoryPoolReservedValues defines the type-safe values for System.MemoryPoolReserved context |
| 2409 | type SystemMemoryPoolReservedValues struct { |
| 2410 | Machine int64 |
| 2411 | Base int64 |
| 2412 | } |
| 2413 | |
| 2414 | // SystemMemoryPoolReservedContext provides type-safe operations for System.MemoryPoolReserved context |
| 2415 | type SystemMemoryPoolReservedContext struct { |
| 2416 | framework.Context[EmptyLabels] |
| 2417 | } |
| 2418 | |
| 2419 | // Set provides type-safe dimension setting for System.MemoryPoolReserved context |
| 2420 | func (c SystemMemoryPoolReservedContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemMemoryPoolReservedValues) { |
| 2421 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 2422 | "machine": values.Machine, |
| 2423 | "base": values.Base, |
| 2424 | }) |
| 2425 | } |
| 2426 | |
| 2427 | // SetUpdateEvery sets the update interval for this instance |
| 2428 | func (c SystemMemoryPoolReservedContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 2429 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 2430 | } |
| 2431 | |
| 2432 | // SystemMemoryPoolThreadsValues defines the type-safe values for System.MemoryPoolThreads context |
| 2433 | type SystemMemoryPoolThreadsValues struct { |
| 2434 | Machine int64 |
| 2435 | Base int64 |
| 2436 | } |
| 2437 | |
| 2438 | // SystemMemoryPoolThreadsContext provides type-safe operations for System.MemoryPoolThreads context |
| 2439 | type SystemMemoryPoolThreadsContext struct { |
| 2440 | framework.Context[EmptyLabels] |
| 2441 | } |
| 2442 | |
| 2443 | // Set provides type-safe dimension setting for System.MemoryPoolThreads context |
| 2444 | func (c SystemMemoryPoolThreadsContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemMemoryPoolThreadsValues) { |
| 2445 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 2446 | "machine": values.Machine, |
| 2447 | "base": values.Base, |
| 2448 | }) |
| 2449 | } |
| 2450 | |
| 2451 | // SetUpdateEvery sets the update interval for this instance |
| 2452 | func (c SystemMemoryPoolThreadsContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 2453 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 2454 | } |
| 2455 | |
| 2456 | // SystemMemoryPoolMaxThreadsValues defines the type-safe values for System.MemoryPoolMaxThreads context |
| 2457 | type SystemMemoryPoolMaxThreadsValues struct { |
| 2458 | Machine int64 |
| 2459 | Base int64 |
| 2460 | } |
| 2461 | |
| 2462 | // SystemMemoryPoolMaxThreadsContext provides type-safe operations for System.MemoryPoolMaxThreads context |
| 2463 | type SystemMemoryPoolMaxThreadsContext struct { |
| 2464 | framework.Context[EmptyLabels] |
| 2465 | } |
| 2466 | |
| 2467 | // Set provides type-safe dimension setting for System.MemoryPoolMaxThreads context |
| 2468 | func (c SystemMemoryPoolMaxThreadsContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemMemoryPoolMaxThreadsValues) { |
| 2469 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 2470 | "machine": values.Machine, |
| 2471 | "base": values.Base, |
| 2472 | }) |
| 2473 | } |
| 2474 | |
| 2475 | // SetUpdateEvery sets the update interval for this instance |
| 2476 | func (c SystemMemoryPoolMaxThreadsContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 2477 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 2478 | } |
| 2479 | |
| 2480 | // SystemDiskBusyAverageValues defines the type-safe values for System.DiskBusyAverage context |
| 2481 | type SystemDiskBusyAverageValues struct { |
| 2482 | Busy int64 |
| 2483 | } |
| 2484 | |
| 2485 | // SystemDiskBusyAverageContext provides type-safe operations for System.DiskBusyAverage context |
| 2486 | type SystemDiskBusyAverageContext struct { |
| 2487 | framework.Context[EmptyLabels] |
| 2488 | } |
| 2489 | |
| 2490 | // Set provides type-safe dimension setting for System.DiskBusyAverage context |
| 2491 | func (c SystemDiskBusyAverageContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemDiskBusyAverageValues) { |
| 2492 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 2493 | "busy": values.Busy, |
| 2494 | }) |
| 2495 | } |
| 2496 | |
| 2497 | // SetUpdateEvery sets the update interval for this instance |
| 2498 | func (c SystemDiskBusyAverageContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 2499 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 2500 | } |
| 2501 | |
| 2502 | // SystemSystemASPUsageValues defines the type-safe values for System.SystemASPUsage context |
| 2503 | type SystemSystemASPUsageValues struct { |
| 2504 | Used int64 |
| 2505 | } |
| 2506 | |
| 2507 | // SystemSystemASPUsageContext provides type-safe operations for System.SystemASPUsage context |
| 2508 | type SystemSystemASPUsageContext struct { |
| 2509 | framework.Context[EmptyLabels] |
| 2510 | } |
| 2511 | |
| 2512 | // Set provides type-safe dimension setting for System.SystemASPUsage context |
| 2513 | func (c SystemSystemASPUsageContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemSystemASPUsageValues) { |
| 2514 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 2515 | "used": values.Used, |
| 2516 | }) |
| 2517 | } |
| 2518 | |
| 2519 | // SetUpdateEvery sets the update interval for this instance |
| 2520 | func (c SystemSystemASPUsageContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 2521 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 2522 | } |
| 2523 | |
| 2524 | // SystemSystemASPStorageValues defines the type-safe values for System.SystemASPStorage context |
| 2525 | type SystemSystemASPStorageValues struct { |
| 2526 | Total int64 |
| 2527 | } |
| 2528 | |
| 2529 | // SystemSystemASPStorageContext provides type-safe operations for System.SystemASPStorage context |
| 2530 | type SystemSystemASPStorageContext struct { |
| 2531 | framework.Context[EmptyLabels] |
| 2532 | } |
| 2533 | |
| 2534 | // Set provides type-safe dimension setting for System.SystemASPStorage context |
| 2535 | func (c SystemSystemASPStorageContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemSystemASPStorageValues) { |
| 2536 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 2537 | "total": values.Total, |
| 2538 | }) |
| 2539 | } |
| 2540 | |
| 2541 | // SetUpdateEvery sets the update interval for this instance |
| 2542 | func (c SystemSystemASPStorageContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 2543 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 2544 | } |
| 2545 | |
| 2546 | // SystemTotalAuxiliaryStorageValues defines the type-safe values for System.TotalAuxiliaryStorage context |
| 2547 | type SystemTotalAuxiliaryStorageValues struct { |
| 2548 | Total int64 |
| 2549 | } |
| 2550 | |
| 2551 | // SystemTotalAuxiliaryStorageContext provides type-safe operations for System.TotalAuxiliaryStorage context |
| 2552 | type SystemTotalAuxiliaryStorageContext struct { |
| 2553 | framework.Context[EmptyLabels] |
| 2554 | } |
| 2555 | |
| 2556 | // Set provides type-safe dimension setting for System.TotalAuxiliaryStorage context |
| 2557 | func (c SystemTotalAuxiliaryStorageContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemTotalAuxiliaryStorageValues) { |
| 2558 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 2559 | "total": values.Total, |
| 2560 | }) |
| 2561 | } |
| 2562 | |
| 2563 | // SetUpdateEvery sets the update interval for this instance |
| 2564 | func (c SystemTotalAuxiliaryStorageContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 2565 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 2566 | } |
| 2567 | |
| 2568 | // SystemSystemThreadsValues defines the type-safe values for System.SystemThreads context |
| 2569 | type SystemSystemThreadsValues struct { |
| 2570 | Active int64 |
| 2571 | Per_processor int64 |
| 2572 | } |
| 2573 | |
| 2574 | // SystemSystemThreadsContext provides type-safe operations for System.SystemThreads context |
| 2575 | type SystemSystemThreadsContext struct { |
| 2576 | framework.Context[EmptyLabels] |
| 2577 | } |
| 2578 | |
| 2579 | // Set provides type-safe dimension setting for System.SystemThreads context |
| 2580 | func (c SystemSystemThreadsContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemSystemThreadsValues) { |
| 2581 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 2582 | "active": values.Active, |
| 2583 | "per_processor": values.Per_processor, |
| 2584 | }) |
| 2585 | } |
| 2586 | |
| 2587 | // SetUpdateEvery sets the update interval for this instance |
| 2588 | func (c SystemSystemThreadsContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 2589 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 2590 | } |
| 2591 | |
| 2592 | // SystemNetworkConnectionsValues defines the type-safe values for System.NetworkConnections context |
| 2593 | type SystemNetworkConnectionsValues struct { |
| 2594 | Remote int64 |
| 2595 | Total int64 |
| 2596 | } |
| 2597 | |
| 2598 | // SystemNetworkConnectionsContext provides type-safe operations for System.NetworkConnections context |
| 2599 | type SystemNetworkConnectionsContext struct { |
| 2600 | framework.Context[EmptyLabels] |
| 2601 | } |
| 2602 | |
| 2603 | // Set provides type-safe dimension setting for System.NetworkConnections context |
| 2604 | func (c SystemNetworkConnectionsContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemNetworkConnectionsValues) { |
| 2605 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 2606 | "remote": values.Remote, |
| 2607 | "total": values.Total, |
| 2608 | }) |
| 2609 | } |
| 2610 | |
| 2611 | // SetUpdateEvery sets the update interval for this instance |
| 2612 | func (c SystemNetworkConnectionsContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 2613 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 2614 | } |
| 2615 | |
| 2616 | // SystemNetworkConnectionStatesValues defines the type-safe values for System.NetworkConnectionStates context |
| 2617 | type SystemNetworkConnectionStatesValues struct { |
| 2618 | Listen int64 |
| 2619 | Close_wait int64 |
| 2620 | } |
| 2621 | |
| 2622 | // SystemNetworkConnectionStatesContext provides type-safe operations for System.NetworkConnectionStates context |
| 2623 | type SystemNetworkConnectionStatesContext struct { |
| 2624 | framework.Context[EmptyLabels] |
| 2625 | } |
| 2626 | |
| 2627 | // Set provides type-safe dimension setting for System.NetworkConnectionStates context |
| 2628 | func (c SystemNetworkConnectionStatesContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemNetworkConnectionStatesValues) { |
| 2629 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 2630 | "listen": values.Listen, |
| 2631 | "close_wait": values.Close_wait, |
| 2632 | }) |
| 2633 | } |
| 2634 | |
| 2635 | // SetUpdateEvery sets the update interval for this instance |
| 2636 | func (c SystemNetworkConnectionStatesContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 2637 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 2638 | } |
| 2639 | |
| 2640 | // SystemTempStorageTotalValues defines the type-safe values for System.TempStorageTotal context |
| 2641 | type SystemTempStorageTotalValues struct { |
| 2642 | Current int64 |
| 2643 | Peak int64 |
| 2644 | } |
| 2645 | |
| 2646 | // SystemTempStorageTotalContext provides type-safe operations for System.TempStorageTotal context |
| 2647 | type SystemTempStorageTotalContext struct { |
| 2648 | framework.Context[EmptyLabels] |
| 2649 | } |
| 2650 | |
| 2651 | // Set provides type-safe dimension setting for System.TempStorageTotal context |
| 2652 | func (c SystemTempStorageTotalContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemTempStorageTotalValues) { |
| 2653 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 2654 | "current": values.Current, |
| 2655 | "peak": values.Peak, |
| 2656 | }) |
| 2657 | } |
| 2658 | |
| 2659 | // SetUpdateEvery sets the update interval for this instance |
| 2660 | func (c SystemTempStorageTotalContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 2661 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 2662 | } |
| 2663 | |
| 2664 | // SystemSystemActivityCPURateValues defines the type-safe values for System.SystemActivityCPURate context |
| 2665 | type SystemSystemActivityCPURateValues struct { |
| 2666 | Average int64 |
| 2667 | } |
| 2668 | |
| 2669 | // SystemSystemActivityCPURateContext provides type-safe operations for System.SystemActivityCPURate context |
| 2670 | type SystemSystemActivityCPURateContext struct { |
| 2671 | framework.Context[EmptyLabels] |
| 2672 | } |
| 2673 | |
| 2674 | // Set provides type-safe dimension setting for System.SystemActivityCPURate context |
| 2675 | func (c SystemSystemActivityCPURateContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemSystemActivityCPURateValues) { |
| 2676 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 2677 | "average": values.Average, |
| 2678 | }) |
| 2679 | } |
| 2680 | |
| 2681 | // SetUpdateEvery sets the update interval for this instance |
| 2682 | func (c SystemSystemActivityCPURateContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 2683 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 2684 | } |
| 2685 | |
| 2686 | // SystemSystemActivityCPUUtilizationValues defines the type-safe values for System.SystemActivityCPUUtilization context |
| 2687 | type SystemSystemActivityCPUUtilizationValues struct { |
| 2688 | Average int64 |
| 2689 | Minimum int64 |
| 2690 | Maximum int64 |
| 2691 | } |
| 2692 | |
| 2693 | // SystemSystemActivityCPUUtilizationContext provides type-safe operations for System.SystemActivityCPUUtilization context |
| 2694 | type SystemSystemActivityCPUUtilizationContext struct { |
| 2695 | framework.Context[EmptyLabels] |
| 2696 | } |
| 2697 | |
| 2698 | // Set provides type-safe dimension setting for System.SystemActivityCPUUtilization context |
| 2699 | func (c SystemSystemActivityCPUUtilizationContext) Set(state *framework.CollectorState, labels EmptyLabels, values SystemSystemActivityCPUUtilizationValues) { |
| 2700 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 2701 | "average": values.Average, |
| 2702 | "minimum": values.Minimum, |
| 2703 | "maximum": values.Maximum, |
| 2704 | }) |
| 2705 | } |
| 2706 | |
| 2707 | // SetUpdateEvery sets the update interval for this instance |
| 2708 | func (c SystemSystemActivityCPUUtilizationContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 2709 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 2710 | } |
| 2711 | |
| 2712 | // System contains all metric contexts for System |
| 2713 | var System = struct { |
| 2714 | CPUUtilization SystemCPUUtilizationContext |
| 2715 | CPUEntitledUtilization SystemCPUEntitledUtilizationContext |
| 2716 | CPUDetails SystemCPUDetailsContext |
| 2717 | CPUCapacity SystemCPUCapacityContext |
| 2718 | TotalJobs SystemTotalJobsContext |
| 2719 | ActiveJobsByType SystemActiveJobsByTypeContext |
| 2720 | JobQueueLength SystemJobQueueLengthContext |
| 2721 | MainStorageSize SystemMainStorageSizeContext |
| 2722 | TemporaryStorage SystemTemporaryStorageContext |
| 2723 | MemoryPoolUsage SystemMemoryPoolUsageContext |
| 2724 | MemoryPoolDefined SystemMemoryPoolDefinedContext |
| 2725 | MemoryPoolReserved SystemMemoryPoolReservedContext |
| 2726 | MemoryPoolThreads SystemMemoryPoolThreadsContext |
| 2727 | MemoryPoolMaxThreads SystemMemoryPoolMaxThreadsContext |
| 2728 | DiskBusyAverage SystemDiskBusyAverageContext |
| 2729 | SystemASPUsage SystemSystemASPUsageContext |
| 2730 | SystemASPStorage SystemSystemASPStorageContext |
| 2731 | TotalAuxiliaryStorage SystemTotalAuxiliaryStorageContext |
| 2732 | SystemThreads SystemSystemThreadsContext |
| 2733 | NetworkConnections SystemNetworkConnectionsContext |
| 2734 | NetworkConnectionStates SystemNetworkConnectionStatesContext |
| 2735 | TempStorageTotal SystemTempStorageTotalContext |
| 2736 | SystemActivityCPURate SystemSystemActivityCPURateContext |
| 2737 | SystemActivityCPUUtilization SystemSystemActivityCPUUtilizationContext |
| 2738 | }{ |
| 2739 | CPUUtilization: SystemCPUUtilizationContext{ |
| 2740 | Context: framework.Context[EmptyLabels]{ |
| 2741 | Name: "as400.cpu_utilization", |
| 2742 | Family: "compute/cpu", |
| 2743 | Title: "CPU Utilization (100% = 1 CPU core)", |
| 2744 | Units: "percentage", |
| 2745 | Type: module.Line, |
| 2746 | Priority: 101, |
| 2747 | UpdateEvery: 1, |
| 2748 | Dimensions: []framework.Dimension{ |
| 2749 | { |
| 2750 | Name: "utilization", |
| 2751 | Algorithm: module.Absolute, |
| 2752 | Mul: 1, |
| 2753 | Div: 1000, |
| 2754 | Precision: 1, |
| 2755 | }, |
| 2756 | }, |
| 2757 | LabelKeys: []string{}, |
| 2758 | }, |
| 2759 | }, |
| 2760 | CPUEntitledUtilization: SystemCPUEntitledUtilizationContext{ |
| 2761 | Context: framework.Context[EmptyLabels]{ |
| 2762 | Name: "as400.cpu_utilization_entitled", |
| 2763 | Family: "compute/cpu", |
| 2764 | Title: "CPU Utilization (as % of entitlement)", |
| 2765 | Units: "percentage", |
| 2766 | Type: module.Line, |
| 2767 | Priority: 102, |
| 2768 | UpdateEvery: 1, |
| 2769 | Dimensions: []framework.Dimension{ |
| 2770 | { |
| 2771 | Name: "utilization", |
| 2772 | Algorithm: module.Absolute, |
| 2773 | Mul: 1, |
| 2774 | Div: 1000, |
| 2775 | Precision: 1, |
| 2776 | }, |
| 2777 | }, |
| 2778 | LabelKeys: []string{}, |
| 2779 | }, |
| 2780 | }, |
| 2781 | CPUDetails: SystemCPUDetailsContext{ |
| 2782 | Context: framework.Context[EmptyLabels]{ |
| 2783 | Name: "as400.cpu_configuration", |
| 2784 | Family: "compute/cpu", |
| 2785 | Title: "CPU Configuration", |
| 2786 | Units: "cpus", |
| 2787 | Type: module.Line, |
| 2788 | Priority: 102, |
| 2789 | UpdateEvery: 1, |
| 2790 | Dimensions: []framework.Dimension{ |
| 2791 | { |
| 2792 | Name: "configured", |
| 2793 | Algorithm: module.Absolute, |
| 2794 | Mul: 1, |
| 2795 | Div: 1, |
| 2796 | Precision: 1, |
| 2797 | }, |
| 2798 | }, |
| 2799 | LabelKeys: []string{}, |
| 2800 | }, |
| 2801 | }, |
| 2802 | CPUCapacity: SystemCPUCapacityContext{ |
| 2803 | Context: framework.Context[EmptyLabels]{ |
| 2804 | Name: "as400.cpu_capacity", |
| 2805 | Family: "compute/cpu", |
| 2806 | Title: "Current CPU Capacity", |
| 2807 | Units: "percentage", |
| 2808 | Type: module.Line, |
| 2809 | Priority: 103, |
| 2810 | UpdateEvery: 1, |
| 2811 | Dimensions: []framework.Dimension{ |
| 2812 | { |
| 2813 | Name: "capacity", |
| 2814 | Algorithm: module.Absolute, |
| 2815 | Mul: 1, |
| 2816 | Div: 1000, |
| 2817 | Precision: 1, |
| 2818 | }, |
| 2819 | }, |
| 2820 | LabelKeys: []string{}, |
| 2821 | }, |
| 2822 | }, |
| 2823 | TotalJobs: SystemTotalJobsContext{ |
| 2824 | Context: framework.Context[EmptyLabels]{ |
| 2825 | Name: "as400.total_jobs", |
| 2826 | Family: "workloads/jobs", |
| 2827 | Title: "Total Jobs in System", |
| 2828 | Units: "jobs", |
| 2829 | Type: module.Line, |
| 2830 | Priority: 501, |
| 2831 | UpdateEvery: 1, |
| 2832 | Dimensions: []framework.Dimension{ |
| 2833 | { |
| 2834 | Name: "total", |
| 2835 | Algorithm: module.Absolute, |
| 2836 | Mul: 1, |
| 2837 | Div: 1, |
| 2838 | Precision: 1, |
| 2839 | }, |
| 2840 | }, |
| 2841 | LabelKeys: []string{}, |
| 2842 | }, |
| 2843 | }, |
| 2844 | ActiveJobsByType: SystemActiveJobsByTypeContext{ |
| 2845 | Context: framework.Context[EmptyLabels]{ |
| 2846 | Name: "as400.active_jobs_by_type", |
| 2847 | Family: "workloads/jobs", |
| 2848 | Title: "Active Jobs by Type", |
| 2849 | Units: "jobs", |
| 2850 | Type: module.Stacked, |
| 2851 | Priority: 502, |
| 2852 | UpdateEvery: 1, |
| 2853 | Dimensions: []framework.Dimension{ |
| 2854 | { |
| 2855 | Name: "batch", |
| 2856 | Algorithm: module.Absolute, |
| 2857 | Mul: 1, |
| 2858 | Div: 1, |
| 2859 | Precision: 1, |
| 2860 | }, |
| 2861 | { |
| 2862 | Name: "interactive", |
| 2863 | Algorithm: module.Absolute, |
| 2864 | Mul: 1, |
| 2865 | Div: 1, |
| 2866 | Precision: 1, |
| 2867 | }, |
| 2868 | { |
| 2869 | Name: "active", |
| 2870 | Algorithm: module.Absolute, |
| 2871 | Mul: 1, |
| 2872 | Div: 1, |
| 2873 | Precision: 1, |
| 2874 | }, |
| 2875 | }, |
| 2876 | LabelKeys: []string{}, |
| 2877 | }, |
| 2878 | }, |
| 2879 | JobQueueLength: SystemJobQueueLengthContext{ |
| 2880 | Context: framework.Context[EmptyLabels]{ |
| 2881 | Name: "as400.job_queue_length", |
| 2882 | Family: "workloads/jobs", |
| 2883 | Title: "Job Queue Length", |
| 2884 | Units: "jobs", |
| 2885 | Type: module.Line, |
| 2886 | Priority: 503, |
| 2887 | UpdateEvery: 1, |
| 2888 | Dimensions: []framework.Dimension{ |
| 2889 | { |
| 2890 | Name: "waiting", |
| 2891 | Algorithm: module.Absolute, |
| 2892 | Mul: 1, |
| 2893 | Div: 1, |
| 2894 | Precision: 1, |
| 2895 | }, |
| 2896 | }, |
| 2897 | LabelKeys: []string{}, |
| 2898 | }, |
| 2899 | }, |
| 2900 | MainStorageSize: SystemMainStorageSizeContext{ |
| 2901 | Context: framework.Context[EmptyLabels]{ |
| 2902 | Name: "as400.main_storage_size", |
| 2903 | Family: "memory/overview", |
| 2904 | Title: "Main Storage Size", |
| 2905 | Units: "bytes", |
| 2906 | Type: module.Line, |
| 2907 | Priority: 201, |
| 2908 | UpdateEvery: 1, |
| 2909 | Dimensions: []framework.Dimension{ |
| 2910 | { |
| 2911 | Name: "total", |
| 2912 | Algorithm: module.Absolute, |
| 2913 | Mul: 1, |
| 2914 | Div: 1, |
| 2915 | Precision: 1, |
| 2916 | }, |
| 2917 | }, |
| 2918 | LabelKeys: []string{}, |
| 2919 | }, |
| 2920 | }, |
| 2921 | TemporaryStorage: SystemTemporaryStorageContext{ |
| 2922 | Context: framework.Context[EmptyLabels]{ |
| 2923 | Name: "as400.temporary_storage", |
| 2924 | Family: "storage/temp/overview", |
| 2925 | Title: "Temporary Storage", |
| 2926 | Units: "MiB", |
| 2927 | Type: module.Line, |
| 2928 | Priority: 304, |
| 2929 | UpdateEvery: 1, |
| 2930 | Dimensions: []framework.Dimension{ |
| 2931 | { |
| 2932 | Name: "current", |
| 2933 | Algorithm: module.Absolute, |
| 2934 | Mul: 1, |
| 2935 | Div: 1, |
| 2936 | Precision: 1, |
| 2937 | }, |
| 2938 | { |
| 2939 | Name: "maximum", |
| 2940 | Algorithm: module.Absolute, |
| 2941 | Mul: 1, |
| 2942 | Div: 1, |
| 2943 | Precision: 1, |
| 2944 | }, |
| 2945 | }, |
| 2946 | LabelKeys: []string{}, |
| 2947 | }, |
| 2948 | }, |
| 2949 | MemoryPoolUsage: SystemMemoryPoolUsageContext{ |
| 2950 | Context: framework.Context[EmptyLabels]{ |
| 2951 | Name: "as400.memory_pool_usage", |
| 2952 | Family: "memory/pools", |
| 2953 | Title: "Memory Pool Usage", |
| 2954 | Units: "bytes", |
| 2955 | Type: module.Stacked, |
| 2956 | Priority: 203, |
| 2957 | UpdateEvery: 1, |
| 2958 | Dimensions: []framework.Dimension{ |
| 2959 | { |
| 2960 | Name: "machine", |
| 2961 | Algorithm: module.Absolute, |
| 2962 | Mul: 1, |
| 2963 | Div: 1, |
| 2964 | Precision: 1, |
| 2965 | }, |
| 2966 | { |
| 2967 | Name: "base", |
| 2968 | Algorithm: module.Absolute, |
| 2969 | Mul: 1, |
| 2970 | Div: 1, |
| 2971 | Precision: 1, |
| 2972 | }, |
| 2973 | { |
| 2974 | Name: "interactive", |
| 2975 | Algorithm: module.Absolute, |
| 2976 | Mul: 1, |
| 2977 | Div: 1, |
| 2978 | Precision: 1, |
| 2979 | }, |
| 2980 | { |
| 2981 | Name: "spool", |
| 2982 | Algorithm: module.Absolute, |
| 2983 | Mul: 1, |
| 2984 | Div: 1, |
| 2985 | Precision: 1, |
| 2986 | }, |
| 2987 | }, |
| 2988 | LabelKeys: []string{}, |
| 2989 | }, |
| 2990 | }, |
| 2991 | MemoryPoolDefined: SystemMemoryPoolDefinedContext{ |
| 2992 | Context: framework.Context[EmptyLabels]{ |
| 2993 | Name: "as400.memory_pool_defined", |
| 2994 | Family: "memory/pools", |
| 2995 | Title: "Memory Pool Defined Size", |
| 2996 | Units: "bytes", |
| 2997 | Type: module.Stacked, |
| 2998 | Priority: 204, |
| 2999 | UpdateEvery: 1, |
| 3000 | Dimensions: []framework.Dimension{ |
| 3001 | { |
| 3002 | Name: "machine", |
| 3003 | Algorithm: module.Absolute, |
| 3004 | Mul: 1, |
| 3005 | Div: 1, |
| 3006 | Precision: 1, |
| 3007 | }, |
| 3008 | { |
| 3009 | Name: "base", |
| 3010 | Algorithm: module.Absolute, |
| 3011 | Mul: 1, |
| 3012 | Div: 1, |
| 3013 | Precision: 1, |
| 3014 | }, |
| 3015 | }, |
| 3016 | LabelKeys: []string{}, |
| 3017 | }, |
| 3018 | }, |
| 3019 | MemoryPoolReserved: SystemMemoryPoolReservedContext{ |
| 3020 | Context: framework.Context[EmptyLabels]{ |
| 3021 | Name: "as400.memory_pool_reserved", |
| 3022 | Family: "memory/pools", |
| 3023 | Title: "Memory Pool Reserved Size", |
| 3024 | Units: "bytes", |
| 3025 | Type: module.Stacked, |
| 3026 | Priority: 205, |
| 3027 | UpdateEvery: 1, |
| 3028 | Dimensions: []framework.Dimension{ |
| 3029 | { |
| 3030 | Name: "machine", |
| 3031 | Algorithm: module.Absolute, |
| 3032 | Mul: 1, |
| 3033 | Div: 1, |
| 3034 | Precision: 1, |
| 3035 | }, |
| 3036 | { |
| 3037 | Name: "base", |
| 3038 | Algorithm: module.Absolute, |
| 3039 | Mul: 1, |
| 3040 | Div: 1, |
| 3041 | Precision: 1, |
| 3042 | }, |
| 3043 | }, |
| 3044 | LabelKeys: []string{}, |
| 3045 | }, |
| 3046 | }, |
| 3047 | MemoryPoolThreads: SystemMemoryPoolThreadsContext{ |
| 3048 | Context: framework.Context[EmptyLabels]{ |
| 3049 | Name: "as400.memory_pool_threads", |
| 3050 | Family: "memory/pools", |
| 3051 | Title: "Memory Pool Threads", |
| 3052 | Units: "threads", |
| 3053 | Type: module.Line, |
| 3054 | Priority: 206, |
| 3055 | UpdateEvery: 1, |
| 3056 | Dimensions: []framework.Dimension{ |
| 3057 | { |
| 3058 | Name: "machine", |
| 3059 | Algorithm: module.Absolute, |
| 3060 | Mul: 1, |
| 3061 | Div: 1, |
| 3062 | Precision: 1, |
| 3063 | }, |
| 3064 | { |
| 3065 | Name: "base", |
| 3066 | Algorithm: module.Absolute, |
| 3067 | Mul: 1, |
| 3068 | Div: 1, |
| 3069 | Precision: 1, |
| 3070 | }, |
| 3071 | }, |
| 3072 | LabelKeys: []string{}, |
| 3073 | }, |
| 3074 | }, |
| 3075 | MemoryPoolMaxThreads: SystemMemoryPoolMaxThreadsContext{ |
| 3076 | Context: framework.Context[EmptyLabels]{ |
| 3077 | Name: "as400.memory_pool_max_threads", |
| 3078 | Family: "memory/pools", |
| 3079 | Title: "Memory Pool Maximum Threads", |
| 3080 | Units: "threads", |
| 3081 | Type: module.Line, |
| 3082 | Priority: 207, |
| 3083 | UpdateEvery: 1, |
| 3084 | Dimensions: []framework.Dimension{ |
| 3085 | { |
| 3086 | Name: "machine", |
| 3087 | Algorithm: module.Absolute, |
| 3088 | Mul: 1, |
| 3089 | Div: 1, |
| 3090 | Precision: 1, |
| 3091 | }, |
| 3092 | { |
| 3093 | Name: "base", |
| 3094 | Algorithm: module.Absolute, |
| 3095 | Mul: 1, |
| 3096 | Div: 1, |
| 3097 | Precision: 1, |
| 3098 | }, |
| 3099 | }, |
| 3100 | LabelKeys: []string{}, |
| 3101 | }, |
| 3102 | }, |
| 3103 | DiskBusyAverage: SystemDiskBusyAverageContext{ |
| 3104 | Context: framework.Context[EmptyLabels]{ |
| 3105 | Name: "as400.disk_busy_average", |
| 3106 | Family: "storage/disk/summary", |
| 3107 | Title: "Average Disk Busy Percentage", |
| 3108 | Units: "percentage", |
| 3109 | Type: module.Line, |
| 3110 | Priority: 306, |
| 3111 | UpdateEvery: 1, |
| 3112 | Dimensions: []framework.Dimension{ |
| 3113 | { |
| 3114 | Name: "busy", |
| 3115 | Algorithm: module.Absolute, |
| 3116 | Mul: 1, |
| 3117 | Div: 1000, |
| 3118 | Precision: 1, |
| 3119 | }, |
| 3120 | }, |
| 3121 | LabelKeys: []string{}, |
| 3122 | }, |
| 3123 | }, |
| 3124 | SystemASPUsage: SystemSystemASPUsageContext{ |
| 3125 | Context: framework.Context[EmptyLabels]{ |
| 3126 | Name: "as400.system_asp_usage", |
| 3127 | Family: "storage/asp", |
| 3128 | Title: "System ASP Usage", |
| 3129 | Units: "percentage", |
| 3130 | Type: module.Line, |
| 3131 | Priority: 301, |
| 3132 | UpdateEvery: 1, |
| 3133 | Dimensions: []framework.Dimension{ |
| 3134 | { |
| 3135 | Name: "used", |
| 3136 | Algorithm: module.Absolute, |
| 3137 | Mul: 1, |
| 3138 | Div: 1000, |
| 3139 | Precision: 1, |
| 3140 | }, |
| 3141 | }, |
| 3142 | LabelKeys: []string{}, |
| 3143 | }, |
| 3144 | }, |
| 3145 | SystemASPStorage: SystemSystemASPStorageContext{ |
| 3146 | Context: framework.Context[EmptyLabels]{ |
| 3147 | Name: "as400.system_asp_storage", |
| 3148 | Family: "storage/asp", |
| 3149 | Title: "System ASP Storage", |
| 3150 | Units: "MiB", |
| 3151 | Type: module.Line, |
| 3152 | Priority: 302, |
| 3153 | UpdateEvery: 1, |
| 3154 | Dimensions: []framework.Dimension{ |
| 3155 | { |
| 3156 | Name: "total", |
| 3157 | Algorithm: module.Absolute, |
| 3158 | Mul: 1, |
| 3159 | Div: 1, |
| 3160 | Precision: 1, |
| 3161 | }, |
| 3162 | }, |
| 3163 | LabelKeys: []string{}, |
| 3164 | }, |
| 3165 | }, |
| 3166 | TotalAuxiliaryStorage: SystemTotalAuxiliaryStorageContext{ |
| 3167 | Context: framework.Context[EmptyLabels]{ |
| 3168 | Name: "as400.total_auxiliary_storage", |
| 3169 | Family: "storage/asp", |
| 3170 | Title: "Total Auxiliary Storage", |
| 3171 | Units: "MiB", |
| 3172 | Type: module.Line, |
| 3173 | Priority: 303, |
| 3174 | UpdateEvery: 1, |
| 3175 | Dimensions: []framework.Dimension{ |
| 3176 | { |
| 3177 | Name: "total", |
| 3178 | Algorithm: module.Absolute, |
| 3179 | Mul: 1, |
| 3180 | Div: 1, |
| 3181 | Precision: 1, |
| 3182 | }, |
| 3183 | }, |
| 3184 | LabelKeys: []string{}, |
| 3185 | }, |
| 3186 | }, |
| 3187 | SystemThreads: SystemSystemThreadsContext{ |
| 3188 | Context: framework.Context[EmptyLabels]{ |
| 3189 | Name: "as400.system_threads", |
| 3190 | Family: "compute/threads", |
| 3191 | Title: "System Threads", |
| 3192 | Units: "threads", |
| 3193 | Type: module.Line, |
| 3194 | Priority: 104, |
| 3195 | UpdateEvery: 1, |
| 3196 | Dimensions: []framework.Dimension{ |
| 3197 | { |
| 3198 | Name: "active", |
| 3199 | Algorithm: module.Absolute, |
| 3200 | Mul: 1, |
| 3201 | Div: 1, |
| 3202 | Precision: 1, |
| 3203 | }, |
| 3204 | { |
| 3205 | Name: "per_processor", |
| 3206 | Algorithm: module.Absolute, |
| 3207 | Mul: 1, |
| 3208 | Div: 1, |
| 3209 | Precision: 1, |
| 3210 | }, |
| 3211 | }, |
| 3212 | LabelKeys: []string{}, |
| 3213 | }, |
| 3214 | }, |
| 3215 | NetworkConnections: SystemNetworkConnectionsContext{ |
| 3216 | Context: framework.Context[EmptyLabels]{ |
| 3217 | Name: "as400.network_connections", |
| 3218 | Family: "network/summary", |
| 3219 | Title: "Network Connections", |
| 3220 | Units: "connections", |
| 3221 | Type: module.Line, |
| 3222 | Priority: 401, |
| 3223 | UpdateEvery: 1, |
| 3224 | Dimensions: []framework.Dimension{ |
| 3225 | { |
| 3226 | Name: "remote", |
| 3227 | Algorithm: module.Absolute, |
| 3228 | Mul: 1, |
| 3229 | Div: 1, |
| 3230 | Precision: 1, |
| 3231 | }, |
| 3232 | { |
| 3233 | Name: "total", |
| 3234 | Algorithm: module.Absolute, |
| 3235 | Mul: 1, |
| 3236 | Div: 1, |
| 3237 | Precision: 1, |
| 3238 | }, |
| 3239 | }, |
| 3240 | LabelKeys: []string{}, |
| 3241 | }, |
| 3242 | }, |
| 3243 | NetworkConnectionStates: SystemNetworkConnectionStatesContext{ |
| 3244 | Context: framework.Context[EmptyLabels]{ |
| 3245 | Name: "as400.network_connection_states", |
| 3246 | Family: "network/summary", |
| 3247 | Title: "Network Connection States", |
| 3248 | Units: "connections", |
| 3249 | Type: module.Line, |
| 3250 | Priority: 402, |
| 3251 | UpdateEvery: 1, |
| 3252 | Dimensions: []framework.Dimension{ |
| 3253 | { |
| 3254 | Name: "listen", |
| 3255 | Algorithm: module.Absolute, |
| 3256 | Mul: 1, |
| 3257 | Div: 1, |
| 3258 | Precision: 1, |
| 3259 | }, |
| 3260 | { |
| 3261 | Name: "close_wait", |
| 3262 | Algorithm: module.Absolute, |
| 3263 | Mul: 1, |
| 3264 | Div: 1, |
| 3265 | Precision: 1, |
| 3266 | }, |
| 3267 | }, |
| 3268 | LabelKeys: []string{}, |
| 3269 | }, |
| 3270 | }, |
| 3271 | TempStorageTotal: SystemTempStorageTotalContext{ |
| 3272 | Context: framework.Context[EmptyLabels]{ |
| 3273 | Name: "as400.temp_storage_total", |
| 3274 | Family: "storage/temp/overview", |
| 3275 | Title: "Temporary Storage Total", |
| 3276 | Units: "bytes", |
| 3277 | Type: module.Line, |
| 3278 | Priority: 304, |
| 3279 | UpdateEvery: 1, |
| 3280 | Dimensions: []framework.Dimension{ |
| 3281 | { |
| 3282 | Name: "current", |
| 3283 | Algorithm: module.Absolute, |
| 3284 | Mul: 1, |
| 3285 | Div: 1, |
| 3286 | Precision: 1, |
| 3287 | }, |
| 3288 | { |
| 3289 | Name: "peak", |
| 3290 | Algorithm: module.Absolute, |
| 3291 | Mul: 1, |
| 3292 | Div: 1, |
| 3293 | Precision: 1, |
| 3294 | }, |
| 3295 | }, |
| 3296 | LabelKeys: []string{}, |
| 3297 | }, |
| 3298 | }, |
| 3299 | SystemActivityCPURate: SystemSystemActivityCPURateContext{ |
| 3300 | Context: framework.Context[EmptyLabels]{ |
| 3301 | Name: "as400.system_activity_cpu_rate", |
| 3302 | Family: "compute/activity", |
| 3303 | Title: "System CPU Rate", |
| 3304 | Units: "percentage", |
| 3305 | Type: module.Line, |
| 3306 | Priority: 105, |
| 3307 | UpdateEvery: 1, |
| 3308 | Dimensions: []framework.Dimension{ |
| 3309 | { |
| 3310 | Name: "average", |
| 3311 | Algorithm: module.Absolute, |
| 3312 | Mul: 1, |
| 3313 | Div: 1000, |
| 3314 | Precision: 1, |
| 3315 | }, |
| 3316 | }, |
| 3317 | LabelKeys: []string{}, |
| 3318 | }, |
| 3319 | }, |
| 3320 | SystemActivityCPUUtilization: SystemSystemActivityCPUUtilizationContext{ |
| 3321 | Context: framework.Context[EmptyLabels]{ |
| 3322 | Name: "as400.system_activity_cpu_utilization", |
| 3323 | Family: "compute/activity", |
| 3324 | Title: "System CPU Utilization", |
| 3325 | Units: "percentage", |
| 3326 | Type: module.Line, |
| 3327 | Priority: 106, |
| 3328 | UpdateEvery: 1, |
| 3329 | Dimensions: []framework.Dimension{ |
| 3330 | { |
| 3331 | Name: "average", |
| 3332 | Algorithm: module.Absolute, |
| 3333 | Mul: 1, |
| 3334 | Div: 1000, |
| 3335 | Precision: 1, |
| 3336 | }, |
| 3337 | { |
| 3338 | Name: "minimum", |
| 3339 | Algorithm: module.Absolute, |
| 3340 | Mul: 1, |
| 3341 | Div: 1000, |
| 3342 | Precision: 1, |
| 3343 | }, |
| 3344 | { |
| 3345 | Name: "maximum", |
| 3346 | Algorithm: module.Absolute, |
| 3347 | Mul: 1, |
| 3348 | Div: 1000, |
| 3349 | Precision: 1, |
| 3350 | }, |
| 3351 | }, |
| 3352 | LabelKeys: []string{}, |
| 3353 | }, |
| 3354 | }, |
| 3355 | } |
| 3356 | |
| 3357 | // --- TempStorageBucket --- |
| 3358 | |
| 3359 | // TempStorageBucketUsageValues defines the type-safe values for TempStorageBucket.Usage context |
| 3360 | type TempStorageBucketUsageValues struct { |
| 3361 | Current int64 |
| 3362 | Peak int64 |
| 3363 | } |
| 3364 | |
| 3365 | // TempStorageBucketUsageContext provides type-safe operations for TempStorageBucket.Usage context |
| 3366 | type TempStorageBucketUsageContext struct { |
| 3367 | framework.Context[TempStorageBucketLabels] |
| 3368 | } |
| 3369 | |
| 3370 | // Set provides type-safe dimension setting for TempStorageBucket.Usage context |
| 3371 | func (c TempStorageBucketUsageContext) Set(state *framework.CollectorState, labels TempStorageBucketLabels, values TempStorageBucketUsageValues) { |
| 3372 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 3373 | "current": values.Current, |
| 3374 | "peak": values.Peak, |
| 3375 | }) |
| 3376 | } |
| 3377 | |
| 3378 | // SetUpdateEvery sets the update interval for this instance |
| 3379 | func (c TempStorageBucketUsageContext) SetUpdateEvery(state *framework.CollectorState, labels TempStorageBucketLabels, updateEvery int) { |
| 3380 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 3381 | } |
| 3382 | |
| 3383 | // TempStorageBucketLabels defines the required labels for TempStorageBucket contexts |
| 3384 | type TempStorageBucketLabels struct { |
| 3385 | Bucket string |
| 3386 | } |
| 3387 | |
| 3388 | // InstanceID generates a unique instance ID using the hardcoded label order from YAML |
| 3389 | func (l TempStorageBucketLabels) InstanceID(contextName string) string { |
| 3390 | // Label order from YAML: bucket |
| 3391 | return contextName + "." + cleanLabelValue(l.Bucket) |
| 3392 | } |
| 3393 | |
| 3394 | // TempStorageBucket contains all metric contexts for TempStorageBucket |
| 3395 | var TempStorageBucket = struct { |
| 3396 | Usage TempStorageBucketUsageContext |
| 3397 | }{ |
| 3398 | Usage: TempStorageBucketUsageContext{ |
| 3399 | Context: framework.Context[TempStorageBucketLabels]{ |
| 3400 | Name: "as400.temp_storage_bucket", |
| 3401 | Family: "storage/temp/buckets", |
| 3402 | Title: "Temporary Storage Bucket Usage", |
| 3403 | Units: "bytes", |
| 3404 | Type: module.Line, |
| 3405 | Priority: 305, |
| 3406 | UpdateEvery: 1, |
| 3407 | Dimensions: []framework.Dimension{ |
| 3408 | { |
| 3409 | Name: "current", |
| 3410 | Algorithm: module.Absolute, |
| 3411 | Mul: 1, |
| 3412 | Div: 1, |
| 3413 | Precision: 1, |
| 3414 | }, |
| 3415 | { |
| 3416 | Name: "peak", |
| 3417 | Algorithm: module.Absolute, |
| 3418 | Mul: 1, |
| 3419 | Div: 1, |
| 3420 | Precision: 1, |
| 3421 | }, |
| 3422 | }, |
| 3423 | LabelKeys: []string{ |
| 3424 | "bucket", |
| 3425 | }, |
| 3426 | }, |
| 3427 | }, |
| 3428 | } |
| 3429 | |
| 3430 | // GetAllContexts returns all contexts for framework registration |
| 3431 | func GetAllContexts() []interface{} { |
| 3432 | return []interface{}{ |
| 3433 | &ActiveJob.CPU.Context, |
| 3434 | &ActiveJob.Resources.Context, |
| 3435 | &ActiveJob.Time.Context, |
| 3436 | &ActiveJob.Activity.Context, |
| 3437 | &ActiveJob.Threads.Context, |
| 3438 | &Disk.Busy.Context, |
| 3439 | &Disk.IORequests.Context, |
| 3440 | &Disk.SpaceUsage.Context, |
| 3441 | &Disk.Capacity.Context, |
| 3442 | &Disk.Blocks.Context, |
| 3443 | &Disk.SSDHealth.Context, |
| 3444 | &Disk.SSDPowerOn.Context, |
| 3445 | &HTTPServer.Connections.Context, |
| 3446 | &HTTPServer.Threads.Context, |
| 3447 | &HTTPServer.Requests.Context, |
| 3448 | &HTTPServer.Bytes.Context, |
| 3449 | &JobQueue.Length.Context, |
| 3450 | &MessageQueue.Messages.Context, |
| 3451 | &MessageQueue.Severity.Context, |
| 3452 | &NetworkInterface.Status.Context, |
| 3453 | &NetworkInterface.MTU.Context, |
| 3454 | &Observability.QueryLatencyFast.Context, |
| 3455 | &Observability.QueryLatencySlow.Context, |
| 3456 | &Observability.QueryLatencyBatch.Context, |
| 3457 | &OutputQueue.Files.Context, |
| 3458 | &OutputQueue.Writers.Context, |
| 3459 | &OutputQueue.Status.Context, |
| 3460 | &PlanCache.Summary.Context, |
| 3461 | &QueueOverview.Count.Context, |
| 3462 | &QueueOverview.Items.Context, |
| 3463 | &Subsystem.Jobs.Context, |
| 3464 | &System.CPUUtilization.Context, |
| 3465 | &System.CPUEntitledUtilization.Context, |
| 3466 | &System.CPUDetails.Context, |
| 3467 | &System.CPUCapacity.Context, |
| 3468 | &System.TotalJobs.Context, |
| 3469 | &System.ActiveJobsByType.Context, |
| 3470 | &System.JobQueueLength.Context, |
| 3471 | &System.MainStorageSize.Context, |
| 3472 | &System.TemporaryStorage.Context, |
| 3473 | &System.MemoryPoolUsage.Context, |
| 3474 | &System.MemoryPoolDefined.Context, |
| 3475 | &System.MemoryPoolReserved.Context, |
| 3476 | &System.MemoryPoolThreads.Context, |
| 3477 | &System.MemoryPoolMaxThreads.Context, |
| 3478 | &System.DiskBusyAverage.Context, |
| 3479 | &System.SystemASPUsage.Context, |
| 3480 | &System.SystemASPStorage.Context, |
| 3481 | &System.TotalAuxiliaryStorage.Context, |
| 3482 | &System.SystemThreads.Context, |
| 3483 | &System.NetworkConnections.Context, |
| 3484 | &System.NetworkConnectionStates.Context, |
| 3485 | &System.TempStorageTotal.Context, |
| 3486 | &System.SystemActivityCPURate.Context, |
| 3487 | &System.SystemActivityCPUUtilization.Context, |
| 3488 | &TempStorageBucket.Usage.Context, |
| 3489 | } |
| 3490 | } |