refactor: add timeout data in report data

This commit is contained in:
moonrailgun 2023-10-02 00:17:36 +08:00
parent 87af8ea07d
commit 044fd94e30

View File

@ -15,6 +15,7 @@ type ReportData struct {
WorkspaceId string `json:"workspaceId"` WorkspaceId string `json:"workspaceId"`
Name string `json:"name"` Name string `json:"name"`
Hostname string `json:"hostname"` Hostname string `json:"hostname"`
Timeout int `json:"timeout"` // if service receive after timeout second, its means client are offline
Payload utils.ReportDataPayload `json:"payload"` Payload utils.ReportDataPayload `json:"payload"`
} }
@ -62,6 +63,7 @@ func main() {
WorkspaceId: *WorkspaceId, WorkspaceId: *WorkspaceId,
Name: name, Name: name,
Hostname: hostname, Hostname: hostname,
Timeout: interval * 2,
Payload: utils.GetReportDataPaylod(interval, *IsVnstat), Payload: utils.GetReportDataPaylod(interval, *IsVnstat),
}) })
} }