File Coverage

blib/lib/Audio/MPD/Common/Stats.pm
Criterion Covered Total %
statement 17 17 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod n/a
total 23 23 100.0


line stmt bran cond sub pod time code
1             #
2             # This file is part of Audio-MPD-Common
3             #
4             # This software is copyright (c) 2007 by Jerome Quelin.
5             #
6             # This is free software; you can redistribute it and/or modify it under
7             # the same terms as the Perl 5 programming language system itself.
8             #
9 1     1   655 use 5.008;
  1         4  
10 1     1   5 use strict;
  1         1  
  1         20  
11 1     1   5 use warnings;
  1         2  
  1         53  
12              
13             package Audio::MPD::Common::Stats;
14             # ABSTRACT: class representing MPD stats
15             $Audio::MPD::Common::Stats::VERSION = '2.003';
16 1     1   809 use Moose;
  1         482429  
  1         7  
17 1     1   7963 use MooseX::Has::Sugar;
  1         719  
  1         5  
18 1     1   804 use MooseX::Types::Moose qw{ Int };
  1         63762  
  1         10  
19              
20              
21             # -- public attributes
22              
23              
24             has artists => ( ro, isa=>Int, required );
25             has albums => ( ro, isa=>Int, required );
26             has songs => ( ro, isa=>Int, required );
27             has uptime => ( ro, isa=>Int, required );
28             has playtime => ( ro, isa=>Int, required );
29             has db_playtime => ( ro, isa=>Int, required );
30             has db_update => ( ro, isa=>Int, required );
31              
32              
33             1;
34              
35             __END__
36              
37             =pod
38              
39             =encoding UTF-8
40              
41             =head1 NAME
42              
43             Audio::MPD::Common::Stats - class representing MPD stats
44              
45             =head1 VERSION
46              
47             version 2.003
48              
49             =head1 DESCRIPTION
50              
51             The MPD server maintains some general information. Those information can
52             be queried with the mpd modules. Some of those information are served to
53             you as an L<Audio::MPD::Common::Stats> object.
54              
55             An L<Audio::MPD::Common::Stats> object does B<not> update itself
56             regularly, and thus should be used immediately.
57              
58             Note: one should B<never> ever instantiate an L<Audio::MPD::Common::Stats>
59             object directly - use the mpd modules instead.
60              
61             =head1 ATTRIBUTES
62              
63             =head2 $stats->artists;
64              
65             Number of artists in the music database.
66              
67             =head2 $stats->albums;
68              
69             Number of albums in the music database.
70              
71             =head2 $stats->songs;
72              
73             Number of songs in the music database.
74              
75             =head2 $stats->uptime;
76              
77             Daemon uptime (time since last startup) in seconds.
78              
79             =head2 $stats->playtime;
80              
81             Time length of music played.
82              
83             =head2 $stats->db_playtime;
84              
85             Sum of all song times in the music database.
86              
87             =head2 $stats->db_update;
88              
89             Last database update in UNIX time.
90              
91             =head1 AUTHOR
92              
93             Jerome Quelin
94              
95             =head1 COPYRIGHT AND LICENSE
96              
97             This software is copyright (c) 2007 by Jerome Quelin.
98              
99             This is free software; you can redistribute it and/or modify it under
100             the same terms as the Perl 5 programming language system itself.
101              
102             =cut