Initial project snapshot

This commit is contained in:
2026-04-28 22:29:50 +03:00
commit 8ba0561f4f
365 changed files with 91832 additions and 0 deletions
@@ -0,0 +1,33 @@
package agent
import (
"runtime"
"time"
"github.com/example/remote-access-platform/agents/rap-node-agent/internal/client"
"github.com/example/remote-access-platform/agents/rap-node-agent/internal/state"
)
func TelemetryPayload(identity state.Identity, startedAt time.Time) client.TelemetryRequest {
var mem runtime.MemStats
runtime.ReadMemStats(&mem)
used := int64(mem.Alloc)
total := int64(mem.Sys)
processCount := runtime.NumGoroutine()
return client.TelemetryRequest{
MemoryUsedBytes: &used,
MemoryTotalBytes: &total,
ProcessCount: &processCount,
Payload: map[string]any{
"agent": "rap-node-agent",
"agent_version": Version,
"node_name": identity.NodeName,
"os": runtime.GOOS,
"arch": runtime.GOARCH,
"goroutines": runtime.NumGoroutine(),
"uptime_seconds": int64(time.Since(startedAt).Seconds()),
"telemetry_source": "testing_flag",
},
ObservedAt: time.Now().UTC(),
}
}