Refactor package names and imports in InfrastructureAgent code files

This commit is contained in:
Simon Larsen
2024-05-13 20:37:27 +01:00
parent d0325f2d7d
commit 1f53ecb093
14 changed files with 16 additions and 14 deletions

View File

@@ -4,7 +4,7 @@ import (
"flag"
"fmt"
"log/slog"
agentgo "oneuptime-infrastructure-agent"
agentgo "oneuptime_infrastructure_agent"
"os"
"github.com/gookit/config/v2"

View File

@@ -1,4 +1,4 @@
package oneuptime_infrastructure_agent
package model
type CPUMetrics struct {
PercentUsed float64 `json:"percentUsed"`

View File

@@ -1,4 +1,4 @@
package oneuptime_infrastructure_agent
package model
type BasicDiskMetrics struct {
Total uint64 `json:"total"`

View File

@@ -1,4 +1,4 @@
package oneuptime_infrastructure_agent
package model
type BasicInfrastructureMetrics struct {
CpuMetrics *CPUMetrics `json:"cpuMetrics"`

View File

@@ -1,4 +1,4 @@
package oneuptime_infrastructure_agent
package model
type MemoryMetrics struct {
Total uint64 `json:"total"`

View File

@@ -1,4 +1,4 @@
package oneuptime_infrastructure_agent
package model
type ServerMonitorReport struct {
SecretKey string `json:"secretKey"`

View File

@@ -1,4 +1,4 @@
package oneuptime_infrastructure_agent
package model
type ServerProcess struct {
Pid int32 `json:"pid"`

View File

@@ -1,4 +1,4 @@
package oneuptime_infrastructure_agent
package main
import (
"os"

View File

@@ -1,4 +1,4 @@
package oneuptime_infrastructure_agent
package utils
import (
"encoding/json"

View File

@@ -1,4 +1,4 @@
package oneuptime_infrastructure_agent
package utils
import (
"fmt"

View File

@@ -1,4 +1,4 @@
package oneuptime_infrastructure_agent
package utils
import (
"log/slog"

View File

@@ -1,7 +1,8 @@
package oneuptime_infrastructure_agent
package utils
import (
"log/slog"
"github.com/shirou/gopsutil/v3/mem"
)

View File

@@ -1,8 +1,9 @@
package oneuptime_infrastructure_agent
package utils
import (
"github.com/shirou/gopsutil/v3/process"
"log/slog"
"github.com/shirou/gopsutil/v3/process"
)
// getServerProcesses retrieves the list of server processes