basho / riak_dt

Convergent replicated datatypes in Erlang
Apache License 2.0
353 stars 70 forks source link

Add a stats/1 callback to all datatypes. #69

Closed seancribbs closed 10 years ago

seancribbs commented 10 years ago

The callback returns a proplist of atom/number pairs about internal statistics of the datatype. Examples include 'actor_count' (on any VV-based type), 'element_count' (sets), 'field_count' (maps), 'max_dot_length' (on dotted VV-based types).

Still undecided: whether to recurse into embedded values for internal stats.

lenary commented 10 years ago

:+1: On all of this.

Maybe if they call stats([recursion]) then we show recursive stats for the map, but that's going to be fairly expensive, so should be off by default. Getting the riak_object size should be cheap and give the user essentially as much information.

russelldb commented 10 years ago

Looks good. Does enough for 2.0 purposes. :+1:

seancribbs commented 10 years ago

Going to add some more -spec annotations and then merge.