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

[Feature Request] Add function to return object size [JIRA: CLIENTS-362] #403

Open
mbbroberg opened this issue Apr 20, 2015 · 0 comments
Open

Comments

@mbbroberg
Copy link

A community conversation started on the riak-user list. The full conversation is here.

I'm using the python client (by the way).

obj = RIAK.bucket('my_bucket').get('my_key')

Is there any way to know the actual size of an object stored in Riak? to make sure something mutable > (like a set) didn't added up to more than 1MB in storage size.

It appears running getsizeof() is not a reliable measurement:

Map object:
curl -I

1058 bytes
print sys.getsizeof(obj.value)
3352 bytes

Standard object:
curl -I

9718 bytes
print sys.getsizeof(obj.encoded_data)
9755 bytes

The standard object seems pretty accurate in both approaches even >the image binary data was only 5kbs (I assume some overhead here)

The map object is about 3x the difference between curl and getting >the object via Python.

Not so sure if this is a realistic way to measure their growth (>moreover because the objects i would need this monitorization are >Maps, not unaltered binary data that I can know the size before >storing it).

Would it be possible in some way that the Python get() function would return something like "obj.content-lenght" returning the size is currently taking? that would be a pretty nice feature.

@Basho-JIRA Basho-JIRA changed the title [Feature Request] Add function to return object size [Feature Request] Add function to return object size [JIRA: CLIENTS-362] Apr 20, 2015
@lukebakken lukebakken modified the milestone: riak-python-client-2.7.1 Dec 16, 2016
@lukebakken lukebakken modified the milestones: riak-python-client-2.7.1, riak-python-client-3.0.0 Feb 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants