Page MenuHomeFreeBSD

add option to invert data set so you can convert seconds into per seconds..
AbandonedPublic

Authored by jmg on Jul 15 2015, 12:17 AM.
Tags
None
Referenced Files
F82067798: D3084.diff
Thu, Apr 25, 5:16 AM
Unknown Object (File)
Mar 25 2024, 11:49 PM
Unknown Object (File)
Mar 25 2024, 11:11 PM
Unknown Object (File)
Dec 30 2023, 12:19 PM
Unknown Object (File)
Dec 19 2023, 10:29 PM
Unknown Object (File)
Nov 13 2023, 11:26 AM
Unknown Object (File)
Oct 25 2023, 5:48 AM
Unknown Object (File)
Oct 11 2023, 11:01 PM
Subscribers

Details

Reviewers
delphij
imp
darius-dons.net.au
Group Reviewers
manpages
Summary

Invert data set...

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage

Event Timeline

jmg retitled this revision from to add option to invert data set so you can convert seconds into per seconds...
jmg updated this object.
jmg edited the test plan for this revision. (Show Details)
This revision is now accepted and ready to land.Jul 15 2015, 12:27 AM
wblock added inline comments.
usr.bin/ministat/ministat.1
56

This is a little confusing. Maybe show the fractions?

...inverting a set of time per value measurements into a set of value per time measurements...

delphij requested changes to this revision.Jul 15 2015, 1:18 AM
delphij added a reviewer: delphij.
delphij added a subscriber: delphij.
delphij added inline comments.
usr.bin/ministat/ministat.c
491–495

Since we are going to divide by d later if invert, we should probably do:

if (invert && d == 0.)

err(2, "Invalid data on line %d: 0 is not allowed in inverted mode", line);
This revision now requires changes to proceed.Jul 15 2015, 1:18 AM
imp requested changes to this revision.Jul 15 2015, 3:26 AM
imp added a reviewer: imp.

Invert isn't the right terminology.
You are converting from the time domain to the frequency domain.
This is a fundamental conceptual faux pas.

In D3084#61045, @imp wrote:

Invert isn't the right terminology.
You are converting from the time domain to the frequency domain.
This is a fundamental conceptual faux pas.

Is there a specific terminology issue that you have or what? This patch only changes the values from x to 1/x, and as 1 is a constant, there is no issue with this conversion.

For example, I run a program that hashes 1 GB, and I measure the time it takes to do this operation. I compare it w/ another program that also hashes 1 GB. I now have two sets of data to compare. I can now calculate 1GB/xsec where x is the measured time which gives me the GB/sec that the program ran at. Since both sets have the 1GB constant, I can divide the constant out w/o effecting the results, resulting in 1/x, which is what this patch calculates.

I could also use the term reciprocal, but for me invert makes sense and is more common.

usr.bin/ministat/ministat.1
56

should I be more explicit in what x is? like:

All values are inverted, where x is a value, the value will be 1 / x, when they are added.

jmg edited edge metadata.

Update to add error when d == 0...

jmg marked an inline comment as done.Jul 15 2015, 6:18 AM

errx needed to be used instead of err as errno will not be set in this case.

In D3084#61102, @jmg wrote:
In D3084#61045, @imp wrote:

Invert isn't the right terminology.
You are converting from the time domain to the frequency domain.
This is a fundamental conceptual faux pas.

Is there a specific terminology issue that you have or what? This patch only changes the values from x to 1/x, and as 1 is a constant, there is no issue with this conversion.

For example, I run a program that hashes 1 GB, and I measure the time it takes to do this operation. I compare it w/ another program that also hashes 1 GB. I now have two sets of data to compare. I can now calculate 1GB/xsec where x is the measured time which gives me the GB/sec that the program ran at. Since both sets have the 1GB constant, I can divide the constant out w/o effecting the results, resulting in 1/x, which is what this patch calculates.

I understand how you are using it. You are converting the time domain (elapsed time per 1GB run) to a rate (something in the frequency domain how many X per unit time something can do). this is done via an inversion, true (which is how you make that conversion). I do suppose there are other domain shifts that could be accomplished this way....

usr.bin/ministat/ministat.1
56

Well, yes. More specific is usually better. "x becomes 1/x" is more clear.

As "more" correct term was never provided, and phk also didn't like this change, no point in keeping this open.