From 26eab5f5a6bcd930bfc280e2f47a8584746f1f1a Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Thu, 25 May 2023 11:33:04 +0200 Subject: [PATCH] wip --- lib/api/api.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/api/api.go b/lib/api/api.go index 38b5d2c92..5030dc237 100644 --- a/lib/api/api.go +++ b/lib/api/api.go @@ -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