From ef9ebc82c4109cd249654e7b087dcbfc7f8f60a2 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Mon, 12 Nov 2018 17:02:04 +0100 Subject: [PATCH] ixfrdist: add help to stats --- pdns/Makefile.am | 2 +- pdns/ixfrdist-stats.cc | 108 +++++++++++++++++++++++++++++++++++++++++ pdns/ixfrdist-stats.hh | 48 +----------------- 3 files changed, 110 insertions(+), 48 deletions(-) create mode 100644 pdns/ixfrdist-stats.cc diff --git a/pdns/Makefile.am b/pdns/Makefile.am index bf73f19876..153dcc9bda 100644 --- a/pdns/Makefile.am +++ b/pdns/Makefile.am @@ -622,7 +622,7 @@ ixfrdist_SOURCES = \ ixfr.cc ixfr.hh \ ixfrdist.cc \ ixfrutils.cc ixfrutils.hh \ - ixfrdist-stats.hh \ + ixfrdist-stats.hh ixfrdist-stats.cc \ ixfrdist-web.hh ixfrdist-web.cc \ logger.cc logger.hh\ misc.cc misc.hh \ diff --git a/pdns/ixfrdist-stats.cc b/pdns/ixfrdist-stats.cc new file mode 100644 index 0000000000..3aa9720568 --- /dev/null +++ b/pdns/ixfrdist-stats.cc @@ -0,0 +1,108 @@ +/* + * This file is part of PowerDNS or dnsdist. + * Copyright -- PowerDNS.COM B.V. and its contributors + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * In addition, for the avoidance of any doubt, permission is granted to + * link this program with OpenSSL and to (re)distribute the binaries + * produced as the result of such linking. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "ixfrdist-stats.hh" + +std::string ixfrdistStats::getStats() { + std::stringstream stats; + const std::string prefix = "ixfrdist_"; + + stats<<"# HELP "<