104
# get a hashref of statistics on how the MogileFS server is doing. there are several
105
# sections of statistics, in this form:
107
# replication => { "domain-name" => { "class-name" => { devcount => filecount }, ... }, ... },
110
my MogileFS::Admin $self = shift;
113
# do the request, default to request all stats if they didn't specify any
114
push @_, 'all' unless @_;
115
my $res = $self->{backend}->do_request("stats", { map { $_ => 1 } @_ })
118
# get replication statistics
119
foreach my $i (1..$res->{"replicationcount"}) {
120
$ret->{replication}->{$res->{"replication${i}domain"}}->{$res->{"replication${i}class"}}->{$res->{"replication${i}devcount"}} = $res->{"replication${i}files"};
123
# get file statistics
124
foreach my $i (1..$res->{"filescount"}) {
125
$ret->{files}->{$res->{"files${i}domain"}}->{$res->{"files${i}class"}} = $res->{"files${i}files"};
128
# get device statistics
129
foreach my $i (1..$res->{"devicescount"}) {
130
$ret->{devices}->{$res->{"devices${i}id"}} = {
131
host => $res->{"devices${i}host"},
132
status => $res->{"devices${i}status"},
133
files => $res->{"devices${i}files"},
137
# get fid statistics if they're provided
138
if ($res->{fidmax}) {
140
max => $res->{fidmax},
144
# return the created response
148
104
# get a hashref of the domains we know about in the format of
149
105
# { domain_name => { class_name => mindevcount, class_name => mindevcount, ... }, ... }
150
106
sub get_domains {