Skip Menu |

This queue is for tickets about the RRD-Simple CPAN distribution.

Report information
The Basics
Id: 46624
Status: new
Priority: 0/
Queue: RRD-Simple

Owner: Nobody in particular
Requestors: olivier.jacques [...]

Bug Information
Severity: Important
Broken in: 1.44
Fixed in: (no value)

Subject: default_dstype not used when auto-create new DS - patch included
Download (untitled) / with headers
text/plain 618b
When executing an "update" for a data source that is not part of the RRD file, the source is auto-added (which is great :-). However, this new added source is not using default_dstype as set at the rrd level or any other level. In the "update" document section: "If you try to update a value for a data source that does not exist, it will automatically be added for you. The data source type will be set to whatever is contained in the $RRD::Simple::DEFAULT_DSTYPE variable. (See the VARIABLES section below)." I have attached a patch that fixes the issue for me. Thanks for the wonderful RRD::Simple module!
Subject: dstype_on_update.diff
--- 2009-05-27 19:08:31.056090500 +0200 +++ 2009-06-02 18:43:43.914256200 +0200 @@ -323,16 +323,9 @@ my $error = RRDs::error(); croak($error) if $error; - my %dsTypes; - for my $key (grep(/^ds\[.+?\]\.type$/,keys %{$info})) { - $dsTypes{$info->{$key}}++; - } - DUMP('%dsTypes',\%dsTypes); - my $dstype = (sort { $dsTypes{$b} <=> $dsTypes{$a} } - keys %dsTypes)[0]; - TRACE("\$dstype = $dstype"); + TRACE("\$dstype = $stor->{default_dstype}"); - $self->add_source($rrdfile,$ds,$dstype); + $self->add_source($rrdfile,$ds,$stor->{default_dstype}); } } }

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to