b716b9cddcf2924b83c5ba2c21142cb4c626061fEvan Hunt#!/usr/bin/perl
b716b9cddcf2924b83c5ba2c21142cb4c626061fEvan Hunt#
5d52a1fe1b8ea396fb5ae7f6f1567c8383445113Tinderbox User# Copyright (C) 2015-2017 Internet Systems Consortium, Inc. ("ISC")
b716b9cddcf2924b83c5ba2c21142cb4c626061fEvan Hunt#
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# This Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# License, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# file, You can obtain one at http://mozilla.org/MPL/2.0/.
b716b9cddcf2924b83c5ba2c21142cb4c626061fEvan Hunt
b716b9cddcf2924b83c5ba2c21142cb4c626061fEvan Hunt# server-xml.pl:
b716b9cddcf2924b83c5ba2c21142cb4c626061fEvan Hunt# Parses the XML version of the server stats into a normalized format.
b716b9cddcf2924b83c5ba2c21142cb4c626061fEvan Hunt
b716b9cddcf2924b83c5ba2c21142cb4c626061fEvan Huntuse XML::Simple;
b716b9cddcf2924b83c5ba2c21142cb4c626061fEvan Hunt
b716b9cddcf2924b83c5ba2c21142cb4c626061fEvan Huntmy $ref = XMLin("xml.stats");
b716b9cddcf2924b83c5ba2c21142cb4c626061fEvan Huntmy $counters = $ref->{server}->{counters};
b716b9cddcf2924b83c5ba2c21142cb4c626061fEvan Huntforeach $group (@$counters) {
9689922a0d936b04feb418fbaf4c1420f745ea58Mark Andrews foreach $key (keys %{$group->{counter}}) {
b716b9cddcf2924b83c5ba2c21142cb4c626061fEvan Hunt print $group->{type} . " " . $key . ": ". $group->{counter}->{$key}->{content} . "\n";
b716b9cddcf2924b83c5ba2c21142cb4c626061fEvan Hunt }
b716b9cddcf2924b83c5ba2c21142cb4c626061fEvan Hunt}