MCPcopy Create free account
hub / github.com/google/pprof / Scale

Method Scale

profile/profile.go:778–787  ·  view source on GitHub ↗

Scale multiplies all sample values in a profile by a constant and keeps only samples that have at least one non-zero value.

(ratio float64)

Source from the content-addressed store, hash-verified

776// Scale multiplies all sample values in a profile by a constant and keeps
777// only samples that have at least one non-zero value.
778func (p *Profile) Scale(ratio float64) {
779 if ratio == 1 {
780 return
781 }
782 ratios := make([]float64, len(p.SampleType))
783 for i := range p.SampleType {
784 ratios[i] = ratio
785 }
786 p.ScaleN(ratios)
787}
788
789// ScaleN multiplies each sample values in a sample by a different amount
790// and keeps only samples that have at least one non-zero value.

Callers 4

TestScaleFunction · 0.80
TestMergeFunction · 0.80
TestEmptyMappingMergeFunction · 0.80
fetchProfilesFunction · 0.80

Calls 1

ScaleNMethod · 0.95

Tested by 3

TestScaleFunction · 0.64
TestMergeFunction · 0.64
TestEmptyMappingMergeFunction · 0.64