Is your feature request related to a problem? Please describe.
I would like to have a new column in my benchmark report presenting the number of operations per dollar. I have a constant value that I know, which is the cost per second. The calculation I want in that column is given by the formula:
I think I can obtain the number of iterations using the iterations() function in the state object, but I couldn't find a way to recover the total execution time. The only way I found to do that calculation is by adding a new counter with 1 / cost_per_second and tag it as benchmark::Counter::kIsIterationInvariantRate
This will multiply 1 / cost_per_second by number_of_iterations / total_execution_time_in_seconds and will give me the exact value I want. However, since I'm using a kIsRate variant, it will always append "/s" to that value when I print the report in the console. This is wrong. The unit, in this case, would be "OP/$".
Describe the solution you'd like
Implement a new element in the enum kHasNoUnit and don't append the "/s" in case it is in use.
Describe alternatives you've considered
Another option would be to simply enable the user to define a custom unit to the counter. In this case, I would set "OP/$".
Is your feature request related to a problem? Please describe. I would like to have a new column in my benchmark report presenting the number of operations per dollar. I have a constant value that I know, which is the cost per second. The calculation I want in that column is given by the formula:
I think I can obtain the number of iterations using the
iterations()
function in the state object, but I couldn't find a way to recover the total execution time. The only way I found to do that calculation is by adding a new counter with1 / cost_per_second
and tag it asbenchmark::Counter::kIsIterationInvariantRate
This will multiply
1 / cost_per_second
bynumber_of_iterations / total_execution_time_in_seconds
and will give me the exact value I want. However, since I'm using akIsRate
variant, it will always append "/s" to that value when I print the report in the console. This is wrong. The unit, in this case, would be "OP/$".Describe the solution you'd like Implement a new element in the enum
kHasNoUnit
and don't append the "/s" in case it is in use.Describe alternatives you've considered Another option would be to simply enable the user to define a custom unit to the counter. In this case, I would set "OP/$".