trace_processor: factor out metrics code into its own file

This prevents trace processor impl from filling up with code specific to
metrics. This also allows us to put everything to do with metrics into
its own namespace.

Moreover, add a sql_metrics namespace for the autogenerated SQL metrics
to ensure that they don't pollute the root namespace.

Context: go/perfetto-metrics
Bug: 129747127
Change-Id: I18b3ce3ca390b3599be6128d8a606a2727634b00
diff --git a/tools/gen_merged_sql_metrics b/tools/gen_merged_sql_metrics
index 6ad35ea..6149100 100755
--- a/tools/gen_merged_sql_metrics
+++ b/tools/gen_merged_sql_metrics
@@ -47,6 +47,7 @@
 namespace perfetto {
 namespace trace_processor {
 namespace metrics {
+namespace sql_metrics {
 '''
 
 FILE_TO_SQL_STRUCT = '''
@@ -57,6 +58,7 @@
 '''
 
 NAMESPACE_END = '''
+}  // namespace sql_metrics
 }  // namespace metrics
 }  // namespace trace_processor
 }  // namsepace perfetto