Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert Byte Size Unit Measure #128

Open
marlonpatrick opened this issue Mar 1, 2017 · 2 comments
Open

Convert Byte Size Unit Measure #128

marlonpatrick opened this issue Mar 1, 2017 · 2 comments

Comments

@marlonpatrick
Copy link
Contributor

Like statistics representing TIME, I suggest that statistics that symbolize BYTES SIZE can be converted based on a unit of measure.

So, code like this would be simplified:

image

The code would look like this:

image

In this way, all information about bytes would be available in the most varied units of measurement without the need to rewrite code when any of these units of measurement were needed.

All other features would need to be adjusted: gauges, charts, accumulators etc to add a unit of measurement to be used.

@dvayanu
Copy link
Member

dvayanu commented Mar 2, 2017

This is an interesting idea. However, if I understand you correctly it would mean to change the signature of net.anotheria.moskito.core.producers.IStats#getValueByNameAsString, right?
This will lead to signature change of nearly all Stats Implementations... I assume we will be able to help us out with a generic method in abstract stats however.

Than we will need to add the current byte size to the UI, so we can switch the byte representation in the UI, right?

This is an interesting idea, but we have to discuss the implications, cause the changes will be many... We are not refusing it, just staying that we need to think and talk about it a little bit longer.

I am not sure which positive effects you are expecting besides the implementation of the above methods?

@marlonpatrick
Copy link
Contributor Author

In fact it is a very big change. It does not only change the Stats but also Gauges, Accumulators, Charts would have to be adjusted to add this option.

The positive effect is that the end user can view the information in the way that best suits them without having to rewrite code.

Another day I had to override a Stat class to add a conversion to MB, because getValueByNameAsString returned only the value in bytes. The view of the information in bytes format was very bad due to the very large size (GB).

From a technical point of view, the implementation gets simpler too, I do not need to be doing hardcoded conversions. In short, it's the same effect as TimeUnit.

Anyway, I think it would be a big improvement on the Moskito.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants