From e61e5a96b6a8e17cbd45ced19a480fafaaacb962 Mon Sep 17 00:00:00 2001 From: Matthias Petermann Date: Thu, 23 May 2024 05:09:07 +0200 Subject: [PATCH 1/2] Consistently use 64 bit integers in print functions, refs #1 --- netbsd_exporter.c | 6 +++--- netbsd_exporter.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/netbsd_exporter.c b/netbsd_exporter.c index 20aa67e..499f469 100644 --- a/netbsd_exporter.c +++ b/netbsd_exporter.c @@ -53,11 +53,11 @@ #include "netbsd_exporter.h" #include "version.h" -void print_filesystem_metric(const char* metric, const char* device, const char* mountpoint, long value) { - printf("netbsd_fs_%s_bytes{device=\"%s\",mountpoint=\"%s\"} %ld\n", metric, device, mountpoint, value); +void print_filesystem_metric(const char* metric, const char* device, const char* mountpoint, unsigned long long value) { + printf("netbsd_fs_%s_bytes{device=\"%s\",mountpoint=\"%s\"} %llu\n", metric, device, mountpoint, value); } -void print_disk_io_metric(const char* device, long long unsigned int rbytes, long long unsigned int wbytes) { +void print_disk_io_metric(const char* device, unsigned long long rbytes, unsigned long long wbytes) { printf("netbsd_dk_read_bytes{device=\"%s\"} %llu\n", device, rbytes); printf("netbsd_dk_write_bytes{device=\"%s\"} %llu\n", device, wbytes); } diff --git a/netbsd_exporter.h b/netbsd_exporter.h index 63c3007..fc4c7dc 100644 --- a/netbsd_exporter.h +++ b/netbsd_exporter.h @@ -31,13 +31,13 @@ const char *program_name = "netbsd_exporter"; int option_http_header = 1; int option_syslog = 1; -void print_filesystem_metric(const char*, const char*, const char*, long ); +void print_filesystem_metric(const char*, const char*, const char*, unsigned long long); -void print_disk_io_metric(const char*, long long unsigned int, long long unsigned int ); +void print_disk_io_metric(const char*, unsigned long long, unsigned long long); void print_load_metric(const char*, double ); -void print_network_metric(const char*, unsigned long long, unsigned long long, unsigned long long ); +void print_network_metric(const char*, unsigned long long, unsigned long long, unsigned long long); void print_memory_metric(const char*, long ); From a480833a3b888b5d233e2a9a4764308e33e8708e Mon Sep 17 00:00:00 2001 From: Matthias Petermann Date: Thu, 23 May 2024 05:13:27 +0200 Subject: [PATCH 2/2] Increment patch level --- Makefile | 1 + version.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3236d68..2e8f0f0 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ CC=cc CFLAGS=-Wall -Wextra TARGET=netbsd_exporter +VERSION=0.9.4 PACKAGE=$(TARGET)-$(VERSION).tar.gz diff --git a/version.h b/version.h index 41d172f..69065f8 100644 --- a/version.h +++ b/version.h @@ -28,6 +28,6 @@ #define MAJOR_VERSION 0 #define MINOR_VERSION 9 -#define PATCH_VERSION 3 +#define PATCH_VERSION 4 #endif