use orig version of go ipp lib
This commit is contained in:
parent
9c81fabc19
commit
86ea2a3389
2
go.mod
2
go.mod
|
@ -5,7 +5,7 @@ go 1.13
|
|||
require (
|
||||
github.com/go-logr/logr v0.3.0
|
||||
github.com/go-logr/zapr v0.3.0
|
||||
github.com/phin1x/go-ipp v1.5.0
|
||||
github.com/phin1x/go-ipp v1.2.1-0.20191226192803-6c9dee854ace
|
||||
github.com/prometheus/client_golang v1.9.0
|
||||
go.uber.org/multierr v1.6.0 // indirect
|
||||
go.uber.org/zap v1.16.0
|
||||
|
|
4
go.sum
4
go.sum
|
@ -204,8 +204,8 @@ github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIw
|
|||
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
||||
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
|
||||
github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac=
|
||||
github.com/phin1x/go-ipp v1.5.0 h1:3WLi0RLI3LbF93lHK7TBsK7h53u8tNXZNEokfFOurno=
|
||||
github.com/phin1x/go-ipp v1.5.0/go.mod h1:GZwyNds6grdLi2xRBX22Cvt7Dh7ITWsML0bjrqBF5uo=
|
||||
github.com/phin1x/go-ipp v1.2.1-0.20191226192803-6c9dee854ace h1:ELNodn+xPzMsqbwObNVFRt/OYlcCEw51IlRYdCtURcM=
|
||||
github.com/phin1x/go-ipp v1.2.1-0.20191226192803-6c9dee854ace/go.mod h1:GZwyNds6grdLi2xRBX22Cvt7Dh7ITWsML0bjrqBF5uo=
|
||||
github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc=
|
||||
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
|
||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
|
|
|
@ -18,12 +18,12 @@ func (e *Exporter) printerMetrics(ch chan<- prometheus.Metric) error {
|
|||
|
||||
printer := attr["printer-name"][0].Value.(string)
|
||||
|
||||
states := make(map[int8]int)
|
||||
states := make(map[ipp.PrinterState]int)
|
||||
states[ipp.PrinterStateIdle] = 0
|
||||
states[ipp.PrinterStateProcessing] = 0
|
||||
states[ipp.PrinterStateStopped] = 0
|
||||
|
||||
states[int8(attr["printer-state"][0].Value.(int))]++
|
||||
states[ipp.PrinterState(attr["printer-state"][0].Value.(int))]++
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(e.printerStateTotal, prometheus.GaugeValue, float64(states[ipp.PrinterStateIdle]), printer, "idle")
|
||||
ch <- prometheus.MustNewConstMetric(e.printerStateTotal, prometheus.GaugeValue, float64(states[ipp.PrinterStateProcessing]), printer, "processing")
|
||||
|
|
Loading…
Reference in New Issue