(data []byte)
| 781 | } |
| 782 | |
| 783 | func compressData(data []byte) []byte { |
| 784 | if len(data) == 0 { |
| 785 | return data |
| 786 | } |
| 787 | |
| 788 | var buf bytes.Buffer |
| 789 | gz := gzip.NewWriter(&buf) |
| 790 | if _, err := gz.Write(data); err != nil { |
| 791 | return data // Return uncompressed if compression fails |
| 792 | } |
| 793 | if err := gz.Close(); err != nil { |
| 794 | return data |
| 795 | } |
| 796 | |
| 797 | return buf.Bytes() |
| 798 | } |
| 799 | |
| 800 | // PprofInfoFromArchive uses the consolidated /api/v2/debug/profile endpoint |
| 801 | // to collect pprof data in a single request. The server temporarily enables |
no test coverage detected