| 92 | } |
| 93 | |
| 94 | type goCollector struct { |
| 95 | base baseGoCollector |
| 96 | |
| 97 | // mu protects updates to all fields ensuring a consistent |
| 98 | // snapshot is always produced by Collect. |
| 99 | mu sync.Mutex |
| 100 | |
| 101 | // Contains all samples that has to retrieved from runtime/metrics (not all of them will be exposed). |
| 102 | sampleBuf []metrics.Sample |
| 103 | // sampleMap allows lookup for MemStats metrics and runtime/metrics histograms for exact sums. |
| 104 | sampleMap map[string]*metrics.Sample |
| 105 | |
| 106 | // rmExposedMetrics represents all runtime/metrics package metrics |
| 107 | // that were configured to be exposed. |
| 108 | rmExposedMetrics []collectorMetric |
| 109 | rmExactSumMapForHist map[string]string |
| 110 | |
| 111 | // With Go 1.17, the runtime/metrics package was introduced. |
| 112 | // From that point on, metric names produced by the runtime/metrics |
| 113 | // package could be generated from runtime/metrics names. However, |
| 114 | // these differ from the old names for the same values. |
| 115 | // |
| 116 | // This field exists to export the same values under the old names |
| 117 | // as well. |
| 118 | msMetrics memStatsMetrics |
| 119 | msMetricsEnabled bool |
| 120 | } |
| 121 | |
| 122 | type rmMetricDesc struct { |
| 123 | metrics.Description |
nothing calls this directly
no outgoing calls
no test coverage detected