This commit is contained in:
Jakob Borg 2023-05-25 11:33:04 +02:00
parent 06f58812c3
commit 26eab5f5a6

View File

@ -1213,6 +1213,14 @@ func (s *service) getSupportBundle(w http.ResponseWriter, r *http.Request) {
}
}
// Connection data as JSON
connStats := s.model.ConnectionStats()
if connStatsJSON, err := json.MarshalIndent(connStats, "", " "); err != nil {
l.Warnln("Support bundle: failed to serialize connection-stats.json.txt", err)
} else {
files = append(files, fileEntry{name: "connection-stats.json.txt", data: connStatsJSON})
}
// Heap and CPU Proofs as a pprof extension
var heapBuffer, cpuBuffer bytes.Buffer
filename := fmt.Sprintf("syncthing-heap-%s-%s-%s-%s.pprof", runtime.GOOS, runtime.GOARCH, build.Version, time.Now().Format("150405")) // hhmmss