The Statistics project contains a CRXModule, which writes arbitrary statistical information into a tree structure.