]> granicus.if.org Git - pgbadger/commitdiff
Add tsung xml header sample to output file.
authorDarold Gilles <gilles@darold.net>
Sat, 5 Apr 2014 07:55:12 +0000 (09:55 +0200)
committerDarold Gilles <gilles@darold.net>
Sat, 5 Apr 2014 07:55:12 +0000 (09:55 +0200)
pgbadger

index 385d3f9307ebae6bbd28a6adf118f6491fbcd729..3a391313970cec741a25a1a17a6244b76a14c710 100755 (executable)
--- a/pgbadger
+++ b/pgbadger
@@ -415,7 +415,29 @@ if ($extension eq 'tsung') {
        if (not defined $fh) {
                die "FATAL: can't write to $outfile, $!\n";
        }
-       print $fh "<sessions>\n";
+       print $fh qq{
+<?xml version="1.0"?>
+<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd">
+<tsung loglevel="notice" version="1.0">
+
+    <!-- Configuration du client -->
+    <clients>
+        <client host="localhost" use_controller_vm="true"/>
+    </clients>
+
+    <!-- Configuration du serveur -->
+    <servers>
+        <server host="localhost" port="5432" type="tcp"></server>
+    </servers>
+
+    <load>
+        <arrivalphase phase="1" duration="1" unit="second">
+            <users maxnumber="1" arrivalrate="1" unit="second"></users>
+        </arrivalphase>
+    </load>
+
+<sessions>
+};
        $fh->close();
 
 } else {
@@ -962,7 +984,7 @@ if (!$incremental) {
                if (not defined $fh) {
                        die "FATAL: can't write to $outfile, $!\n";
                }
-               print $fh "</sessions>\n";
+               print $fh "</sessions>\n</tsung>\n";
                $fh->close();
        }