chore(ur): add RSS to reported stats (#10002)

For easier comparison in the future.
This commit is contained in:
Jakob Borg
2025-03-27 10:17:10 +01:00
committed by GitHub
parent 3fd090bfa7
commit 4235b2c406
2 changed files with 9 additions and 0 deletions
+8
View File
@@ -14,12 +14,14 @@ import (
"math/rand"
"net"
"net/http"
"os"
"runtime"
"sort"
"strings"
"sync"
"time"
"github.com/shirou/gopsutil/v4/process"
"github.com/syncthing/syncthing/lib/build"
"github.com/syncthing/syncthing/lib/config"
"github.com/syncthing/syncthing/lib/connections"
@@ -119,6 +121,12 @@ func (s *Service) reportData(ctx context.Context, urVersion int, preview bool) (
report.MemorySize = int(memorySize() / 1024 / 1024)
report.NumCPU = runtime.NumCPU()
if proc, err := process.NewProcess(int32(os.Getpid())); err == nil {
if mem, err := proc.MemoryInfo(); err == nil {
report.ProcessRSSMiB = int(mem.RSS / 1024 / 1024)
}
}
for _, cfg := range s.cfg.Folders() {
report.RescanIntvs = append(report.RescanIntvs, cfg.RescanIntervalS)