Re: Data::Delta module proposal
by MidLifeXis (Monsignor) on Jul 31, 2013 at 12:52 UTC
|
From your description, it seems like something along the lines of Counter::Rolloverable would more accurately describe the module, but that name is awful. Perhaps SNMP::Counter::Delta? Or SNMP::Counter with a delta method? Another idea would be SNMP::DataType::Counter::Util. Not being versed in SNMP more than "what does SNMP stand for?", I would also ask if the term Counter is the correct term in the SNMP domain.
| [reply] [Watch: Dir/Any] [d/l] |
|
The fact is that the library can be used in other environments different to those where data comes from a SNMP agent, that why I avoid using SNMP in the name proposal.
For instance, imagine a access control system counting the number of visitors to a given building and storing it in a text file (for instance). You could use the library for easily calculating how many users per hour are accessing.
| [reply] [Watch: Dir/Any] |
Re: Data::Delta module proposal
by tobyink (Canon) on Jul 31, 2013 at 13:06 UTC
|
Almost every module that starts with "Data::" is poorly named.
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
| [reply] [Watch: Dir/Any] |
|
| [reply] [Watch: Dir/Any] |
|
Data::Dumper is a case in point. It's a dumper for Perl variables, not data more generally. Can it be used as a drop-in replacement for PostgreSQL's pg_dump command? Not without loading that data into Perl variables first. Calling it "Variable::Dumper" would have been more descriptive.
Data::Dumper isn't an absolutely awful name for what it does, but there are better names that could have been chosen. Virtually all modules deal with data in some way; that doesn't mean that virtually all modules should sit in the Data:: namespace.
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
| [reply] [Watch: Dir/Any] [d/l] |
|
| [reply] [Watch: Dir/Any] |
Re: Data::Delta module proposal
by DrHyde (Prior) on Aug 01, 2013 at 10:13 UTC
|
Data::Delta is a terrible name.
If we assume a 16 bit counter (because I can't remember off the top of my head what 2^32 or 2^64 are in denary), then you want the delta between 65535 and 0 to be 1. However, for most other people, they'd want the delta to be 65535 (or, perhaps depending on the order of the arguments, -65535). You need to include the word "Rollover" in the name.
| [reply] [Watch: Dir/Any] |
|
Yes, in fact it works as you define. Then... this is like choosing the name for a son, seems more difficult than creating the module itself... might it be named as Data::Delta::Rollover or Data::Counter::Rollover?
Personally Data::Delta::Rollover seems to match better for me since the module calculates deltas supporting the fact that they can rollover. On the other hand it does it from counters, so it's not foolish to reflect it in the name... Oh, seekers of supreme wisdom, I really need advice.
| [reply] [Watch: Dir/Any] |
Re: Data::Delta module proposal (prepan)
by Anonymous Monk on Aug 01, 2013 at 11:07 UTC
|
| [reply] [Watch: Dir/Any] |
Re: Data::Delta module proposal
by VGavara (Novice) on Aug 03, 2013 at 08:50 UTC
|
I've found Data::Perl::Counter where Matthew Phillips considers a counter as a value able of both incrementing and decrementing, what seem quite logical now (my initial point of view was that a counter always increased). I'm trying to contact with Mathew in order to know his opinion about of adding the new module to the current structure (something like Data::Perl::Counter::Delta) and make it compatible with his counter class.
| [reply] [Watch: Dir/Any] |