built-in agent

This commit is contained in:
Henry Dollman
2024-10-07 18:58:57 -04:00
parent 7a82571921
commit 8de2dee4e9
5 changed files with 80 additions and 33 deletions

View File

@@ -70,13 +70,15 @@ func (a *Agent) Run(pubKey []byte, addr string) {
// if debugging, print stats
if a.debug {
slog.Debug("Stats", "data", a.gatherStats())
slog.Debug("Stats", "data", a.GatherStats())
}
a.startServer(pubKey, addr)
if pubKey != nil {
a.startServer(pubKey, addr)
}
}
func (a *Agent) gatherStats() system.CombinedData {
func (a *Agent) GatherStats() system.CombinedData {
systemData := system.CombinedData{
Stats: a.getSystemStats(),
Info: a.systemInfo,