rename statistics to analyzer.

add some missing write_record()'s