Projet

Général

Profil

Révision 17f78427

ID17f784270ae966ee9a13e9f5104a5b8f925b639e
Parent ef851f0c
Enfant d4320aea, 5b2396a9

Ajouté par Lars Kruse il y a plus de 7 ans

Whitespace cleanup

  • remove trailing whitespace
  • remove empty lines at the end of files

Voir les différences:

plugins/s3/s3_items
3 3
use strict;
4 4

  
5 5

  
6
my $s3_id = exists $ENV{'s3_id'} ? $ENV{'s3_id'} : "user";    
6
my $s3_id = exists $ENV{'s3_id'} ? $ENV{'s3_id'} : "user";
7 7
my $s3cmd = 's3curl.pl --id  ' . $s3_id . '  http://s3.amazonaws.com/';
8 8

  
9 9

  
......
29 29

  
30 30
    my @bucket_list = ();
31 31
    my $pos = 0;
32
    
32

  
33 33
    while ($str =~ /.<Name>([\w._-]+)<\/Name>/) {
34 34

  
35 35
        $bucket_list[$pos++] = $1;
36 36
        $str = $';
37
    } 
37
    }
38 38

  
39
    return @bucket_list; 
39
    return @bucket_list;
40 40
}
41 41

  
42 42

  
......
47 47
    my $stats = `$s3cmd_local`;
48 48

  
49 49
    my %res;
50
    
51
    $res{'size'}  = 0;        
52
    $res{'count'} = 0;        
53
        
50

  
51
    $res{'size'}  = 0;
52
    $res{'count'} = 0;
53

  
54 54
    while ($stats =~ /.<Size>([\w._-]+)<\/Size>/) {
55 55
        $stats = $';
56
        
56

  
57 57
        $res{'size'} += $1;
58 58
        $res{'count'}++;
59
    } 
59
    }
60 60
    return %res;
61 61
}
62 62

  
......
69 69
    print "graph_category cloud\n";
70 70
    print "graph_vlabel items\n";
71 71
    print 'graph_info Plugin available at <a href="http://www.ohardt.com/dev/munin/">http://www.ohardt.com/dev/munin/</a>' . "\n";
72
    
72

  
73 73
    my @bucket_list = get_bucket_list();
74
    
74

  
75 75
    my $bucket_name;
76
    
76

  
77 77
    foreach $bucket_name ( @bucket_list ) {
78
 
79
        print $bucket_name . ".label Bucket " . $bucket_name . "\n";   
80
    
81
    } 
78

  
79
        print $bucket_name . ".label Bucket " . $bucket_name . "\n";
80

  
81
    }
82 82

  
83 83
    exit;
84
    
85
    
84

  
85

  
86 86
}
87 87

  
88 88

  
89 89
my @bucket_list = get_bucket_list();
90 90

  
91 91
my $bucket_name;
92
    
92

  
93 93
foreach $bucket_name ( @bucket_list ) {
94
 
95
    my %stats = get_bucket_stats( $bucket_name );   
96
 
94

  
95
    my %stats = get_bucket_stats( $bucket_name );
96

  
97 97
    print $bucket_name . ".value " . $stats{'count'} . "\n";
98 98
}
99 99

  
100
   
100

  

Formats disponibles : Unified diff