|
7 | 7 | "reflect" |
8 | 8 | "runtime" |
9 | 9 |
|
| 10 | + "github.com/klauspost/compress/gzip" |
10 | 11 | "github.com/stretchr/testify/assert" |
11 | 12 |
|
12 | 13 | "github.com/grafana/pyroscope-go/godeltaprof/internal/pprof" |
@@ -320,15 +321,17 @@ func (h *heapTestHelper) mutate(nmutations int, fs []runtime.MemProfileRecord) { |
320 | 321 | func WriteHeapProto(dp *pprof.DeltaHeapProfiler, opt *pprof.ProfileBuilderOptions, w io.Writer, |
321 | 322 | p []runtime.MemProfileRecord, rate int64) error { |
322 | 323 | stc := pprof.HeapProfileConfig(rate) |
323 | | - b := pprof.NewProfileBuilder(w, opt, stc) |
| 324 | + zw, _ := gzip.NewWriterLevel(w, gzip.BestSpeed) |
| 325 | + b := pprof.NewProfileBuilder(w, zw, opt, stc) |
324 | 326 |
|
325 | 327 | return dp.WriteHeapProto(b, p, rate) |
326 | 328 | } |
327 | 329 |
|
328 | 330 | func PrintCountCycleProfile(d *pprof.DeltaMutexProfiler, opt *pprof.ProfileBuilderOptions, w io.Writer, |
329 | 331 | scaler pprof.MutexProfileScaler, records []runtime.BlockProfileRecord) error { |
330 | 332 | stc := pprof.MutexProfileConfig() |
331 | | - b := pprof.NewProfileBuilder(w, opt, stc) |
| 333 | + zw, _ := gzip.NewWriterLevel(w, gzip.BestSpeed) |
| 334 | + b := pprof.NewProfileBuilder(w, zw, opt, stc) |
332 | 335 |
|
333 | 336 | return d.PrintCountCycleProfile(b, scaler, records) |
334 | 337 | } |
|
0 commit comments