tcp: move metrics into a file