-/* $OpenBSD: extern.h,v 1.209 2024/02/22 21:00:26 tb Exp $ */
+/* $OpenBSD: extern.h,v 1.210 2024/02/26 15:40:33 job Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
uint32_t extra_files; /* number of superfluous files */
uint32_t del_extra_files;/* number of removed extra files */
uint32_t del_dirs; /* number of dirs removed in cleanup */
+ uint32_t new_files; /* moved from DIR_TEMP to DIR_VALID */
struct timespec sync_time; /* time to sync repo */
};
int repo_queued(struct repo *, struct entity *);
void repo_cleanup(struct filepath_tree *, int);
int repo_check_timeout(int);
+void repostats_new_files_inc(struct repo *, const char *);
void repo_stat_inc(struct repo *, int, enum rtype, enum stype);
void repo_tal_stats_collect(void (*)(const struct repo *,
const struct repotalstats *, void *), int, void *);
-/* $OpenBSD: main.c,v 1.251 2024/02/22 12:49:42 job Exp $ */
+/* $OpenBSD: main.c,v 1.252 2024/02/26 15:40:33 job Exp $ */
/*
* Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
rp = repo_byid(id);
repo_stat_inc(rp, talid, type, STYPE_OK);
+ repostats_new_files_inc(rp, file);
switch (type) {
case RTYPE_TAL:
st->tals++;
out->extra_files += in->extra_files;
out->del_extra_files += in->del_extra_files;
out->del_dirs += in->del_dirs;
+ out->new_files += in->new_files;
timespecadd(&in->sync_time, &out->sync_time, &out->sync_time);
}
printf("Ghostbuster records: %u\n", stats.repo_tal_stats.gbrs);
printf("Trust Anchor Keys: %u\n", stats.repo_tal_stats.taks);
printf("Repositories: %u\n", stats.repos);
+ printf("New files moved into validated cache: %u\n",
+ stats.repo_stats.new_files);
printf("Cleanup: removed %u files, %u directories\n"
"Repository cleanup: kept %u and removed %u superfluous files\n",
stats.repo_stats.del_files, stats.repo_stats.del_dirs,
-/* $OpenBSD: output-json.c,v 1.43 2024/02/22 12:49:42 job Exp $ */
+/* $OpenBSD: output-json.c,v 1.44 2024/02/26 15:40:33 job Exp $ */
/*
* Copyright (c) 2019 Claudio Jeker <claudio@openbsd.org>
*
json_do_int("uniquevsps", st->repo_tal_stats.vsps_uniqs);
json_do_int("vaps", st->repo_tal_stats.vaps);
json_do_int("uniquevaps", st->repo_tal_stats.vaps_uniqs);
+ json_do_int("cachedir_new_files", st->repo_stats.new_files);
json_do_int("cachedir_del_files", st->repo_stats.del_files);
json_do_int("cachedir_del_dirs", st->repo_stats.del_dirs);
json_do_int("cachedir_superfluous_files", st->repo_stats.extra_files);
-/* $OpenBSD: output-ometric.c,v 1.8 2024/02/22 12:49:42 job Exp $ */
+/* $OpenBSD: output-ometric.c,v 1.9 2024/02/26 15:40:33 job Exp $ */
/*
* Copyright (c) 2022 Claudio Jeker <claudio@openbsd.org>
*
ol = olabels_new(keys, values);
ometric_set_timespec(rpki_repo_duration, &in->sync_time, ol);
+ ometric_set_int_with_labels(rpki_repo_obj, in->new_files,
+ OKV("type", "state"), OKV("files", "new"), ol);
ometric_set_int_with_labels(rpki_repo_obj, in->del_files,
OKV("type", "state"), OKV("files", "deleted"), ol);
ometric_set_int_with_labels(rpki_repo_obj, in->extra_files,
-/* $OpenBSD: repo.c,v 1.53 2024/02/22 12:49:42 job Exp $ */
+/* $OpenBSD: repo.c,v 1.54 2024/02/26 15:40:33 job Exp $ */
/*
* Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
return timeout;
}
+/*
+ * Update repo-specific stats when files are going to be moved
+ * from DIR_TEMP to DIR_VALID.
+ */
+void
+repostats_new_files_inc(struct repo *rp, const char *file)
+{
+ if (strncmp(file, ".rsync/", strlen(".rsync/")) == 0 ||
+ strncmp(file, ".rrdp/", strlen(".rrdp/")) == 0)
+ rp->repostats.new_files++;
+}
+
/*
* Update stats object of repository depending on rtype and subtype.
*/