NETWAYS / go-check

A Golang library to create monitoring plugins for Icinga
https://pkg.go.dev/github.com/NETWAYS/go-check
GNU General Public License v2.0
13 stars 4 forks source link

Prototype for a new way to handle performance data #119

Open RincewindsHat opened 5 months ago

RincewindsHat commented 5 months ago

This PR implements my current idea for a new interface for performance data handling. The main advantages are a reasonable sanity checks for special cases (Inf and Nan), almost having type safety and a reasonable interface for users.

Perfdata value must now be created with new initializer functions (NewPdvInt64, NewPdvUint64andNewPdvFloat64`), which, given a number, will create the corresponding Perfdata Value.

Sadly I could not find a good way to make this generic and with restricted types, so encoding a data type in the initializer it is.

Would be interested to get some feedback on this.

RincewindsHat commented 5 months ago

should close #118

RincewindsHat commented 2 months ago

@martialblog since we did not come up with a better solution until now, should we go down this way?