serialization of stats