Debian Codegraph @

internal/measurement/measurement.go

raw symbols SCIP
1 // Copyright 2014 Google Inc. All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 // Package measurement export utility functions to manipulate/format performance profile sample values.
16 package measurementscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/
17
18 import (
19 "fmtscip-go gomod github.com/golang/go/src go1.24.0 fmt/"
20 "mathscip-go gomod github.com/golang/go/src go1.24.0 math/"
21 "slicesscip-go gomod github.com/golang/go/src go1.24.0 slices/"
22 "stringsscip-go gomod github.com/golang/go/src go1.24.0 strings/"
23 "timescip-go gomod github.com/golang/go/src go1.24.0 time/"
24
25 "github.com/google/pprof/profilescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/"
26 )
27
28 // ScaleProfiles updates the units in a set of profiles to make them
29 // compatible. It scales the profiles to the smallest unit to preserve
30 // data.
31 func ScaleProfilesscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/ScaleProfiles().(profiles []*profilescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/.Profilescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/Profile#) error {
32 if len(profiles) == 0 {
33 return nil
34 }
35 periodTypes := make([]*profilescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/.ValueTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/ValueType#, 0, len(profiles))
36 for _, p := range profiles {
37 if p.PeriodTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/Profile#PeriodType. != nil {
38 periodTypes = append(periodTypes, p.PeriodTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/Profile#PeriodType.)
39 }
40 }
41 periodType, err := CommonValueTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/CommonValueType().(periodTypes)
42 if err != nil {
43 return fmtscip-go gomod github.com/golang/go/src go1.24.0 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.24.0 fmt/Errorf().("period type: %v", err)
44 }
45
46 // Identify common sample types
47 numSampleTypes := len(profiles[0].SampleTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/Profile#SampleType.)
48 for _, p := range profiles[1:] {
49 if numSampleTypes != len(p.SampleTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/Profile#SampleType.) {
50 return fmtscip-go gomod github.com/golang/go/src go1.24.0 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.24.0 fmt/Errorf().("inconsistent samples type count: %d != %d", numSampleTypes, len(p.SampleTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/Profile#SampleType.))
51 }
52 }
53 sampleType := make([]*profilescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/.ValueTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/ValueType#, numSampleTypes)
54 for i := 0; i < numSampleTypes; i++ {
55 sampleTypes := make([]*profilescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/.ValueTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/ValueType#, len(profiles))
56 for j, p := range profiles {
57 sampleTypes[j] = p.SampleTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/Profile#SampleType.[i]
58 }
59 sampleType[i], err = CommonValueTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/CommonValueType().(sampleTypes)
60 if err != nil {
61 return fmtscip-go gomod github.com/golang/go/src go1.24.0 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.24.0 fmt/Errorf().("sample types: %v", err)
62 }
63 }
64
65 for _, p := range profiles {
66 if p.PeriodTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/Profile#PeriodType. != nil && periodType != nil {
67 period, _ := Scalescip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Scale().(p.Periodscip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/Profile#Period., p.PeriodTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/Profile#PeriodType..Unitscip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/ValueType#Unit., periodType.Unitscip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/ValueType#Unit.)
68 p.Periodscip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/Profile#Period., p.PeriodTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/Profile#PeriodType..Unitscip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/ValueType#Unit. = int64(period), periodType.Unitscip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/ValueType#Unit.
69 }
70 ratios := make([]float64, len(p.SampleTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/Profile#SampleType.))
71 for i, st := range p.SampleTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/Profile#SampleType. {
72 if sampleType[i] == nil {
73 ratios[i] = 1
74 continue
75 }
76 ratios[i], _ = Scalescip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Scale().(1, st.Unitscip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/ValueType#Unit., sampleType[i].Unitscip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/ValueType#Unit.)
77 p.SampleTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/Profile#SampleType.[i].Unitscip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/ValueType#Unit. = sampleType[i].Unitscip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/ValueType#Unit.
78 }
79 if err := p.ScaleNscip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/Profile#ScaleN().(ratios); err != nil {
80 return fmtscip-go gomod github.com/golang/go/src go1.24.0 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.24.0 fmt/Errorf().("scale: %v", err)
81 }
82 }
83 return nil
84 }
85
86 // CommonValueType returns the finest type from a set of compatible
87 // types.
88 func CommonValueTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/CommonValueType().(ts []*profilescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/.ValueTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/ValueType#) (*profilescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/.ValueTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/ValueType#, error) {
89 if len(ts) <= 1 {
90 return nil, nil
91 }
92 minType := ts[0]
93 for _, t := range ts[1:] {
94 if !compatibleValueTypesscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/compatibleValueTypes().(minType, t) {
95 return nil, fmtscip-go gomod github.com/golang/go/src go1.24.0 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.24.0 fmt/Errorf().("incompatible types: %v %v", *minType, *t)
96 }
97 if ratio, _ := Scalescip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Scale().(1, t.Unitscip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/ValueType#Unit., minType.Unitscip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/ValueType#Unit.); ratio < 1 {
98 minType = t
99 }
100 }
101 rcopy := *minType
102 return &rcopy, nil
103 }
104
105 func compatibleValueTypesscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/compatibleValueTypes().(v1, v2 *profilescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/.ValueTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/ValueType#) bool {
106 if v1 == nil || v2 == nil {
107 return true // No grounds to disqualify.
108 }
109 // Remove trailing 's' to permit minor mismatches.
110 if t1, t2 := stringsscip-go gomod github.com/golang/go/src go1.24.0 strings/.TrimSuffixscip-go gomod github.com/golang/go/src go1.24.0 strings/TrimSuffix().(v1.Typescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/ValueType#Type., "s"), stringsscip-go gomod github.com/golang/go/src go1.24.0 strings/.TrimSuffixscip-go gomod github.com/golang/go/src go1.24.0 strings/TrimSuffix().(v2.Typescip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/ValueType#Type., "s"); t1 != t2 {
111 return false
112 }
113
114 if v1.Unitscip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/ValueType#Unit. == v2.Unitscip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/ValueType#Unit. {
115 return true
116 }
117 for _, ut := range UnitTypesscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitTypes. {
118 if ut.sniffUnitscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#sniffUnit().(v1.Unitscip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/ValueType#Unit.) != nil && ut.sniffUnitscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#sniffUnit().(v2.Unitscip-go gomod github.com/google/pprof . `github.com/google/pprof/profile`/ValueType#Unit.) != nil {
119 return true
120 }
121 }
122 return false
123 }
124
125 // Scale a measurement from a unit to a different unit and returns
126 // the scaled value and the target unit. The returned target unit
127 // will be empty if uninteresting (could be skipped).
128 func Scalescip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Scale().(value int64, fromUnit, toUnit string) (float64, string) {
129 // Avoid infinite recursion on overflow.
130 if value < 0 && -value > 0 {
131 v, u := Scalescip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Scale().(-value, fromUnit, toUnit)
132 return -v, u
133 }
134 for _, ut := range UnitTypesscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitTypes. {
135 if v, u, ok := ut.convertUnitscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#convertUnit().(value, fromUnit, toUnit); ok {
136 return v, u
137 }
138 }
139 // Skip non-interesting units.
140 switch toUnit {
141 case "count", "sample", "unit", "minimum", "auto":
142 return float64(value), ""
143 default:
144 return float64(value), toUnit
145 }
146 }
147
148 // Label returns the label used to describe a certain measurement.
149 func Labelscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Label().(value int64, unit string) string {
150 return ScaledLabelscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/ScaledLabel().(value, unit, "auto")
151 }
152
153 // ScaledLabel scales the passed-in measurement (if necessary) and
154 // returns the label used to describe a float measurement.
155 func ScaledLabelscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/ScaledLabel().(value int64, fromUnit, toUnit string) string {
156 v, u := Scalescip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Scale().(value, fromUnit, toUnit)
157 sv := stringsscip-go gomod github.com/golang/go/src go1.24.0 strings/.TrimSuffixscip-go gomod github.com/golang/go/src go1.24.0 strings/TrimSuffix().(fmtscip-go gomod github.com/golang/go/src go1.24.0 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.0 fmt/Sprintf().("%.2f", v), ".00")
158 if sv == "0" || sv == "-0" {
159 return "0"
160 }
161 return sv + u
162 }
163
164 // Percentage computes the percentage of total of a value, and encodes
165 // it as a string. At least two digits of precision are printed.
166 func Percentagescip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Percentage().(value, total int64) string {
167 var ratio float64
168 if total != 0 {
169 ratio = mathscip-go gomod github.com/golang/go/src go1.24.0 math/.Absscip-go gomod github.com/golang/go/src go1.24.0 math/Abs().(float64(value)/float64(total)) * 100
170 }
171 switch {
172 case mathscip-go gomod github.com/golang/go/src go1.24.0 math/.Absscip-go gomod github.com/golang/go/src go1.24.0 math/Abs().(ratio) >= 99.95 && mathscip-go gomod github.com/golang/go/src go1.24.0 math/.Absscip-go gomod github.com/golang/go/src go1.24.0 math/Abs().(ratio) <= 100.05:
173 return " 100%"
174 case mathscip-go gomod github.com/golang/go/src go1.24.0 math/.Absscip-go gomod github.com/golang/go/src go1.24.0 math/Abs().(ratio) >= 1.0:
175 return fmtscip-go gomod github.com/golang/go/src go1.24.0 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.0 fmt/Sprintf().("%5.2f%%", ratio)
176 default:
177 return fmtscip-go gomod github.com/golang/go/src go1.24.0 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.0 fmt/Sprintf().("%5.2g%%", ratio)
178 }
179 }
180
181 // Unit includes a list of aliases representing a specific unit and a factor
182 // which one can multiple a value in the specified unit by to get the value
183 // in terms of the base unit.
184 type Unitscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Unit# struct {
185 CanonicalNamescip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Unit#CanonicalName. string
186 aliasesscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Unit#aliases. []string
187 Factorscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Unit#Factor. float64
188 }
189
190 // UnitType includes a list of units that are within the same category (i.e.
191 // memory or time units) and a default unit to use for this type of unit.
192 type UnitTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType# struct {
193 DefaultUnitscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#DefaultUnit. Unitscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Unit#
194 Unitsscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#Units. []Unitscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Unit#
195 }
196
197 // findByAlias returns the unit associated with the specified alias. It returns
198 // nil if the unit with such alias is not found.
199 func (ut UnitTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#) findByAliasscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#findByAlias().(alias string) *Unitscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Unit# {
200 for _, u := range ut.Unitsscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#Units. {
201 if slicesscip-go gomod github.com/golang/go/src go1.24.0 slices/.Containsscip-go gomod github.com/golang/go/src go1.24.0 slices/Contains().(u.aliasesscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Unit#aliases., alias) {
202 return &u
203 }
204 }
205 return nil
206 }
207
208 // sniffUnit simplifies the input alias and returns the unit associated with the
209 // specified alias. It returns nil if the unit with such alias is not found.
210 func (ut UnitTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#) sniffUnitscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#sniffUnit().(unit string) *Unitscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Unit# {
211 unit = stringsscip-go gomod github.com/golang/go/src go1.24.0 strings/.ToLowerscip-go gomod github.com/golang/go/src go1.24.0 strings/ToLower().(unit)
212 if len(unit) > 2 {
213 unit = stringsscip-go gomod github.com/golang/go/src go1.24.0 strings/.TrimSuffixscip-go gomod github.com/golang/go/src go1.24.0 strings/TrimSuffix().(unit, "s")
214 }
215 return ut.findByAliasscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#findByAlias().(unit)
216 }
217
218 // autoScale takes in the value with units of the base unit and returns
219 // that value scaled to a reasonable unit if a reasonable unit is
220 // found.
221 func (ut UnitTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#) autoScalescip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#autoScale().(value float64) (float64, string, bool) {
222 var f float64
223 var unit string
224 for _, u := range ut.Unitsscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#Units. {
225 if u.Factorscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Unit#Factor. >= f && (value/u.Factorscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Unit#Factor.) >= 1.0 {
226 f = u.Factorscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Unit#Factor.
227 unit = u.CanonicalNamescip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Unit#CanonicalName.
228 }
229 }
230 if f == 0 {
231 return 0, "", false
232 }
233 return value / f, unit, true
234 }
235
236 // convertUnit converts a value from the fromUnit to the toUnit, autoscaling
237 // the value if the toUnit is "minimum" or "auto". If the fromUnit is not
238 // included in the unitType, then a false boolean will be returned. If the
239 // toUnit is not in the unitType, the value will be returned in terms of the
240 // default unitType.
241 func (ut UnitTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#) convertUnitscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#convertUnit().(value int64, fromUnitStr, toUnitStr string) (float64, string, bool) {
242 fromUnit := ut.sniffUnitscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#sniffUnit().(fromUnitStr)
243 if fromUnit == nil {
244 return 0, "", false
245 }
246 v := float64(value) * fromUnit.Factorscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Unit#Factor.
247 if toUnitStr == "minimum" || toUnitStr == "auto" {
248 if v, u, ok := ut.autoScalescip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#autoScale().(v); ok {
249 return v, u, true
250 }
251 return v / ut.DefaultUnitscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#DefaultUnit..Factorscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Unit#Factor., ut.DefaultUnitscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#DefaultUnit..CanonicalNamescip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Unit#CanonicalName., true
252 }
253 toUnit := ut.sniffUnitscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#sniffUnit().(toUnitStr)
254 if toUnit == nil {
255 return v / ut.DefaultUnitscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#DefaultUnit..Factorscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Unit#Factor., ut.DefaultUnitscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#DefaultUnit..CanonicalNamescip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Unit#CanonicalName., true
256 }
257 return v / toUnit.Factorscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Unit#Factor., toUnit.CanonicalNamescip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Unit#CanonicalName., true
258 }
259
260 // UnitTypes holds the definition of units known to pprof.
261 var UnitTypesscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitTypes. = []UnitTypescip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#{{
262 Unitsscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#Units.: []Unitscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Unit#{
263 {"B", []string{"b", "byte"}, 1},
264 {"kB", []string{"kb", "kbyte", "kilobyte"}, float64(1 << 10)},
265 {"MB", []string{"mb", "mbyte", "megabyte"}, float64(1 << 20)},
266 {"GB", []string{"gb", "gbyte", "gigabyte"}, float64(1 << 30)},
267 {"TB", []string{"tb", "tbyte", "terabyte"}, float64(1 << 40)},
268 {"PB", []string{"pb", "pbyte", "petabyte"}, float64(1 << 50)},
269 },
270 DefaultUnitscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#DefaultUnit.: Unitscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Unit#{"B", []string{"b", "byte"}, 1},
271 }, {
272 Unitsscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#Units.: []Unitscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Unit#{
273 {"ns", []string{"ns", "nanosecond"}, float64(timescip-go gomod github.com/golang/go/src go1.24.0 time/.Nanosecondscip-go gomod github.com/golang/go/src go1.24.0 time/Nanosecond.)},
274 {"us", []string{"μs", "us", "microsecond"}, float64(timescip-go gomod github.com/golang/go/src go1.24.0 time/.Microsecondscip-go gomod github.com/golang/go/src go1.24.0 time/Microsecond.)},
275 {"ms", []string{"ms", "millisecond"}, float64(timescip-go gomod github.com/golang/go/src go1.24.0 time/.Millisecondscip-go gomod github.com/golang/go/src go1.24.0 time/Millisecond.)},
276 {"s", []string{"s", "sec", "second"}, float64(timescip-go gomod github.com/golang/go/src go1.24.0 time/.Secondscip-go gomod github.com/golang/go/src go1.24.0 time/Second.)},
277 {"hrs", []string{"hour", "hr"}, float64(timescip-go gomod github.com/golang/go/src go1.24.0 time/.Hourscip-go gomod github.com/golang/go/src go1.24.0 time/Hour.)},
278 },
279 DefaultUnitscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#DefaultUnit.: Unitscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Unit#{"s", []string{}, float64(timescip-go gomod github.com/golang/go/src go1.24.0 time/.Secondscip-go gomod github.com/golang/go/src go1.24.0 time/Second.)},
280 }, {
281 Unitsscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#Units.: []Unitscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Unit#{
282 {"n*GCU", []string{"nanogcu"}, 1e-9},
283 {"u*GCU", []string{"microgcu"}, 1e-6},
284 {"m*GCU", []string{"milligcu"}, 1e-3},
285 {"GCU", []string{"gcu"}, 1},
286 {"k*GCU", []string{"kilogcu"}, 1e3},
287 {"M*GCU", []string{"megagcu"}, 1e6},
288 {"G*GCU", []string{"gigagcu"}, 1e9},
289 {"T*GCU", []string{"teragcu"}, 1e12},
290 {"P*GCU", []string{"petagcu"}, 1e15},
291 },
292 DefaultUnitscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/UnitType#DefaultUnit.: Unitscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/measurement`/Unit#{"GCU", []string{}, 1.0},
293 }}