Projet

Général

Profil

Révision 0cfcf2cc

ID0cfcf2ccbf2c54362cca60e1076de4e2371becb3
Parent 46f383f9
Enfant 3032db48

Ajouté par Romain MAZIERE il y a plus de 5 ans

Fix geowebcache-bandwidth

Voir les différences:

plugins/geowebcache/geowebcache-bandwidth
1 1
#!/usr/bin/perl
2 2
# -*- perl -*-
3 3

  
4
# Author Rodolphe Qui?deville <rodolphe@quiedeville.org>
4
# Author Rodolphe Quiédeville <rodolphe@quiedeville.org>
5 5
# Licence : GPLv2
6 6
# Code based on tomcat_volume plugin by
7
# Rune Nordb?e Skillingstad <runesk@linpro.no>
7
# Rune Nordbøe Skillingstad <runesk@linpro.no>
8 8

  
9 9
=head1 NAME
10 10

  
......
41 41

  
42 42
=head1 AUTHOR
43 43

  
44
Rodolphe Qui?deville <rodolphe@quiedeville.org>
44
Rodolphe Quiédeville <rodolphe@quiedeville.org>
45 45

  
46 46
=head1 USAGE
47 47

  
......
111 111
my $ua = LWP::UserAgent->new(timeout => $TIMEOUT);
112 112
my $response = $ua->request(HTTP::Request->new('GET',$url));
113 113

  
114
if ($response->content =~ '<tr><td>60 seconds</td><td>\d+</td><td>\d+.\d+ /s</td><td>\d+</td><td>(\d+\.\d+) ([km]?)bps') {
114
if ($response->content =~ '<tr><td>60 seconds</td><td>\d+</td><td>\d+.\d+ /s</td><td>\d+</td><td>(\d+\.\d+)&nbsp;([km]?)bps') {
115 115
    my $value = $1;
116 116
    $value = $value * 1024 if ($2 eq 'k');
117 117
    $value = $value * 1024 * 1024 if ($2 eq 'm');
118
    print "bandw.value " . $value;
118
    print "bandw.value " . $value . "\n";
119 119
} else {
120 120
    print "bandw.value U\n";
121 121
}

Formats disponibles : Unified diff