| 1 | package RRDTool::Creator::MonthPDP ; | ||
| 2 | |||
| 3 | # ============================================ | ||
| 4 | # | ||
| 5 | # Jacquelin Charbonnel - CNRS/LAREMA | ||
| 6 | # | ||
| 7 | # $Id: MonthBased.pm 154 2007-04-13 16:18:43Z jaclin $ | ||
| 8 | # | ||
| 9 | # ---- | ||
| 10 | # | ||
| 11 | # A specific creator for round robin databases (RRD) | ||
| 12 | # | ||
| 13 | # ---- | ||
| 14 | # $LastChangedDate: 2007-04-13 18:18:43 +0200 (Fri, 13 Apr 2007) $ | ||
| 15 | # $LastChangedRevision: 154 $ | ||
| 16 | # $LastChangedBy: jaclin $ | ||
| 17 | # $URL: https://svn.math.cnrs.fr/jaclin/src/pm/RRDTool-Creator/MonthBased.pm $ | ||
| 18 | # | ||
| 19 | # ============================================ | ||
| 20 | |||
| 21 | require Exporter ; | ||
| 22 | @ISA = qw(Exporter RRDTool::Creator); | ||
| 23 | @EXPORT=qw() ; | ||
| 24 | |||
| 25 | 1 | ▶ | use Carp ; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 26 | 0 | ▶ | use RRDTool::Creator ; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 27 | use strict ; | ||
| 28 | |||
| 29 | our $VERSION = "0.2" ; | ||
| 30 | |||
| 31 | #------------------------------- | ||
| 32 | sub new | ||
| 33 | { | ||
| 34 | my($type,%h) = @_ ; | ||
| 35 | my ($step) ; | ||
| 36 | |||
| 37 | |||
| 38 | my $this = _new RRDTool::Creator(["s","mn","h","d","w"],%h) ; | ||
| 39 | |||
| 40 | $this->{"rows"} = int(3600*24*30/$this->{"step"}) ; | ||
| 41 | $this->{"allowed_RRA_duration"} = { | ||
| 42 | "quarter" => 3 | ||
| 43 | , "year" => 12 | ||
| 44 | } ; | ||
| 45 | |||
| 46 | bless $this,$type ; | ||
| 47 | return $this ; | ||
| 48 | } | ||
| 49 | |||
| 50 | =head1 RRDTool::Creator::MonthPDP | ||
| 51 | |||
| 52 | The default RRA stores primary data points for a month. | ||
| 53 | More RRA can be added for a quarter and a year. | ||
| 54 | The created RRD is for an acquisition period much less than a month, typically about some hours or a few days. | ||
| 55 | |||
| 56 | =head2 new | ||
| 57 | |||
| 58 | This constructor neads an argument named C<step> which is the period of acquisition. | ||
| 59 | The natural step units are hour(h) and day(d), although second(s), minute(m) and week(w) are allowed. | ||
| 60 | |||
| 61 | $creator = RRDTool::Creator::MonthPDP(-step => "1d") ; | ||
| 62 | $creator->add_RRA(-duration => "quarter") ; | ||
| 63 | $creator->add_RRA(-duration => "year") ; | ||
| 64 | |||
| 65 | |||