File: 02-Fix_word_sizes.patch

package info (click to toggle)
prometheus-bind-exporter 0.2~git20161221%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,016 kB
  • sloc: xml: 4,163; sh: 63; makefile: 41
file content (55 lines) | stat: -rw-r--r-- 1,620 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Description: Fix integer sizes to 64 bits. Otherwise it fails to parse big
 numbers in 32bit architectures.
Forwarded: https://github.com/digitalocean/bind_exporter/issues/43
Author: Martín Ferrari <tincho@debian.org>
Last-Update: 2018-10-22

--- a/bind/bind.go
+++ b/bind/bind.go
@@ -109,28 +109,28 @@
 // Counter represents a single counter value.
 type Counter struct {
 	Name    string `xml:"name,attr"`
-	Counter uint   `xml:",chardata"`
+	Counter uint64 `xml:",chardata"`
 }
 
 // Gauge represents a single gauge value.
 type Gauge struct {
 	Name  string `xml:"name"`
-	Gauge int    `xml:"counter"`
+	Gauge int64  `xml:"counter"`
 }
 
 // Task represents a single running task.
 type Task struct {
 	ID         string `xml:"id"`
 	Name       string `xml:"name"`
-	Quantum    uint   `xml:"quantum"`
-	References uint   `xml:"references"`
+	Quantum    uint64 `xml:"quantum"`
+	References uint64 `xml:"references"`
 	State      string `xml:"state"`
 }
 
 // ThreadModel contains task and worker information.
 type ThreadModel struct {
 	Type           string `xml:"type"`
-	WorkerThreads  uint   `xml:"worker-threads"`
-	DefaultQuantum uint   `xml:"default-quantum"`
-	TasksRunning   uint   `xml:"tasks-running"`
+	WorkerThreads  uint64 `xml:"worker-threads"`
+	DefaultQuantum uint64 `xml:"default-quantum"`
+	TasksRunning   uint64 `xml:"tasks-running"`
 }
--- a/bind/v2/v2.go
+++ b/bind/v2/v2.go
@@ -51,7 +51,7 @@
 
 type Counter struct {
 	Name    string `xml:"name"`
-	Counter uint   `xml:"counter"`
+	Counter uint64 `xml:"counter"`
 }
 
 // Client implements bind.Client and can be used to query a BIND v2 API.