sysmetrics

package
v1.7.4-0...-96f37d8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package sysmetrics Golang bindings: collect and report system and hardware metrics from your system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collect

func Collect() ([]byte, error)

Collect system info and return a pretty printed version of collected data

func CollectAndSend

func CollectAndSend(r ReportType, alwaysReport bool, baseURL string) error

CollectAndSend gather system info and send them The report will not be sent if a report has already been sent for this version unless "alwaysReport" is true. If "baseURL" is not an empty string, this overrides the server the report is sent to.

func CollectAndSendOnUpgrade

func CollectAndSendOnUpgrade(alwaysReport bool, baseURL string) error

CollectAndSendOnUpgrade gather system info and send them The report will not be sent if a report has already been sent for this version unless "alwaysReport" is true. It will only send if a previous report has been found, collect latest report answer (opt-in or opt-out) and decides what to send on that new version based on those facts. If "baseURL" is not an empty string, this overrides the server the report is sent to.

func SendDecline

func SendDecline(alwaysReport bool, baseURL string) error

SendDecline POST to the baseURL server data denial report message. The denial message will not be sent if a report has already been sent for this version unless "alwaysReport" is true. If "baseURL" is not an empty string, this overrides the server the report is sent to.

func SendPendingReport

func SendPendingReport(baseURL string) error

SendPendingReport will try to send any pending report which didn't succeed previously due to network issues. It will try sending and exponentially back off until a send is successful.

func SendReport

func SendReport(data []byte, alwaysReport bool, baseURL string) error

SendReport POST to the baseURL server data coming from a previous collect. The report will not be sent if a report has already been sent for this version unless "alwaysReport" is true. If "baseURL" is not an empty string, this overrides the server the report is sent to.

Types

type ReportType

type ReportType int

ReportType define the desired kind of interaction in CollectAndSend()

const (
	// ReportInteractive will show report content on stdout and read anwser on stdin
	ReportInteractive ReportType = iota
	// ReportAuto will send a report without printing report
	ReportAuto
	// ReportOptOut will send opt-out message without printing report
	ReportOptOut
)

Directories

Path Synopsis
C
Package sysmetrics C bindings: collect and report system and hardware metrics from your system.
Package sysmetrics C bindings: collect and report system and hardware metrics from your system.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL