| 1 | //go:build cgo |
| 2 | |
| 3 | package db2 |
| 4 | |
| 5 | import "github.com/netdata/netdata/go/plugins/plugin/ibm.d/modules/db2/contexts" |
| 6 | |
| 7 | func (c *Collector) exportPrefetcherMetrics() { |
| 8 | for pool, metrics := range c.prefetchers { |
| 9 | if metrics == nil { |
| 10 | continue |
| 11 | } |
| 12 | |
| 13 | labels := contexts.PrefetcherLabels{ |
| 14 | Bufferpool: pool, |
| 15 | } |
| 16 | |
| 17 | contexts.Prefetcher.PrefetchRatio.Set(c.State, labels, contexts.PrefetcherPrefetchRatioValues{ |
| 18 | Ratio: metrics.PrefetchRatio, |
| 19 | }) |
| 20 | |
| 21 | contexts.Prefetcher.CleanerRatio.Set(c.State, labels, contexts.PrefetcherCleanerRatioValues{ |
| 22 | Ratio: metrics.CleanerRatio, |
| 23 | }) |
| 24 | |
| 25 | contexts.Prefetcher.PhysicalReads.Set(c.State, labels, contexts.PrefetcherPhysicalReadsValues{ |
| 26 | Reads: metrics.PhysicalReads, |
| 27 | }) |
| 28 | |
| 29 | contexts.Prefetcher.AsyncReads.Set(c.State, labels, contexts.PrefetcherAsyncReadsValues{ |
| 30 | Reads: metrics.AsyncReads, |
| 31 | }) |
| 32 | |
| 33 | contexts.Prefetcher.WaitTime.Set(c.State, labels, contexts.PrefetcherWaitTimeValues{ |
| 34 | Wait_time: metrics.AvgWaitTime, |
| 35 | }) |
| 36 | |
| 37 | contexts.Prefetcher.UnreadPages.Set(c.State, labels, contexts.PrefetcherUnreadPagesValues{ |
| 38 | Unread: metrics.UnreadPages, |
| 39 | }) |
| 40 | } |
| 41 | } |