author | collectd bot <32910397+collectd-bot@users.noreply.github.com> | |
Tue, 14 Nov 2017 22:08:48 +0000 (23:08 +0100) | ||
committer | GitHub <noreply@github.com> | |
Tue, 14 Nov 2017 22:08:48 +0000 (23:08 +0100) |
Automatically merged due to "Automerge" label
src/mcelog.c | patch | blob | history | |
src/postgresql_default.conf | patch | blob | history | |
src/target_notification.c | patch | blob | history | |
src/utils_tail_match.c | patch | blob | history |
diff --git a/src/mcelog.c b/src/mcelog.c
index ae5a7f549646b85bf72dfa25d3c9ead7e55e687e..6fd4623dbf4026b504d43dcc1fe8fd84d637efb9 100644 (file)
--- a/src/mcelog.c
+++ b/src/mcelog.c
#define MCELOG_UNCORRECTED_ERR_TYPE_INS "uncorrected_memory_errors"
typedef struct mcelog_config_s {
- char logfile[PATH_MAX]; /* mcelog logfile */
- pthread_t tid; /* poll thread id */
- llist_t *dimms_list; /* DIMMs list */
+ char logfile[PATH_MAX]; /* mcelog logfile */
+ pthread_t tid; /* poll thread id */
+ llist_t *dimms_list; /* DIMMs list */
pthread_mutex_t dimms_lock; /* lock for dimms cache */
_Bool persist;
} mcelog_config_t;
typedef struct mcelog_memory_rec_s {
int corrected_err_total; /* x total*/
int corrected_err_timed; /* x in 24h*/
- char corrected_err_timed_period[DATA_MAX_NAME_LEN];
+ char corrected_err_timed_period[DATA_MAX_NAME_LEN / 2];
int uncorrected_err_total; /* x total*/
int uncorrected_err_timed; /* x in 24h*/
- char uncorrected_err_timed_period[DATA_MAX_NAME_LEN];
- char location[DATA_MAX_NAME_LEN]; /* SOCKET x CHANNEL x DIMM x*/
- char dimm_name[DATA_MAX_NAME_LEN]; /* DMI_NAME "DIMM_F1" */
+ char uncorrected_err_timed_period[DATA_MAX_NAME_LEN / 2];
+ char location[DATA_MAX_NAME_LEN / 2]; /* SOCKET x CHANNEL x DIMM x*/
+ char dimm_name[DATA_MAX_NAME_LEN / 2]; /* DMI_NAME "DIMM_F1" */
} mcelog_memory_rec_t;
static int socket_close(socket_adapter_t *self);
index 0aac41e296cb5c87681e3ce41372afbaeea9617d..507990136200b1a02774eae614e1b6ab31fd0f50 100644 (file)
</Query>
<Query queries>
- Statement "SELECT sum(n_tup_ins) AS ins, \
- sum(n_tup_upd) AS upd, \
- sum(n_tup_del) AS del \
+ Statement "SELECT coalesce(sum(n_tup_ins), 0) AS ins, \
+ coalesce(sum(n_tup_upd), 0) AS upd, \
+ coalesce(sum(n_tup_del), 0) AS del \
FROM pg_stat_user_tables;"
<Result>
</Query>
<Query queries>
- Statement "SELECT sum(n_tup_ins) AS ins, \
- sum(n_tup_upd) AS upd, \
- sum(n_tup_del) AS del, \
- sum(n_tup_hot_upd) AS hot_upd \
+ Statement "SELECT coalesce(sum(n_tup_ins), 0) AS ins, \
+ coalesce(sum(n_tup_upd), 0) AS upd, \
+ coalesce(sum(n_tup_del), 0) AS del, \
+ coalesce(sum(n_tup_hot_upd), 0) AS hot_upd \
FROM pg_stat_user_tables;"
<Result>
</Query>
<Query table_states>
- Statement "SELECT sum(n_live_tup) AS live, sum(n_dead_tup) AS dead \
+ Statement "SELECT coalesce(sum(n_live_tup), 0) AS live, \
+ coalesce(sum(n_dead_tup), 0) AS dead \
FROM pg_stat_user_tables;"
<Result>
index 429e256dbf32369e57c4a2cb668807c5757de794..f83a904ac07f6f73d9d7530e2d01e3dfa3c07178 100644 (file)
char template[DATA_MAX_NAME_LEN];
char value_str[DATA_MAX_NAME_LEN];
- snprintf(template, sizeof(template), "%%{ds:%s}", ds->ds[i].name);
+ const char *format = "%%{ds:%.*s}";
+ snprintf(template, sizeof(template), format,
+ DATA_MAX_NAME_LEN - strlen(format), ds->ds[i].name);
if (ds->ds[i].type != DS_TYPE_GAUGE) {
if ((rates == NULL) && (rates_failed == 0)) {
diff --git a/src/utils_tail_match.c b/src/utils_tail_match.c
index 65655dcd12b7b57aefb9070a87c242a394ecc898..79868fcdf9a09cdd5670e0d1e22c0f35421a653e 100644 (file)
--- a/src/utils_tail_match.c
+++ b/src/utils_tail_match.c
sstrncpy(vl.type, data->type, sizeof(vl.type));
for (size_t i = 0; i < data->latency_config.percentile_num; i++) {
if (strlen(data->type_instance) != 0)
- snprintf(vl.type_instance, sizeof(vl.type_instance), "%s-%.0f",
+ snprintf(vl.type_instance, sizeof(vl.type_instance), "%.117s-%.2f",
data->type_instance, data->latency_config.percentile[i]);
else
snprintf(vl.type_instance, sizeof(vl.type_instance), "%.0f",
bucket.upper_bound ? CDTIME_T_TO_DOUBLE(bucket.upper_bound) : INFINITY;
if (strlen(data->type_instance) != 0)
- snprintf(vl.type_instance, sizeof(vl.type_instance), "%s-%s-%g_%g",
- data->type, data->type_instance, lower_bound, upper_bound);
+ snprintf(vl.type_instance, sizeof(vl.type_instance),
+ "%.54s-%.54s-%.2g_%.2g", data->type, data->type_instance,
+ lower_bound, upper_bound);
else
- snprintf(vl.type_instance, sizeof(vl.type_instance), "%s-%g_%g",
+ snprintf(vl.type_instance, sizeof(vl.type_instance), "%.107s-%.2g_%.2g",
data->type, lower_bound, upper_bound);
vl.values = &(value_t){