@@ -52,7 +52,7 @@ public class PerfettoGenericEventTable
5252 new UIHints {
5353 Width = 70 ,
5454 AggregationMode = AggregationMode . Max ,
55- SortPriority = 0 ,
55+ SortPriority = 1 ,
5656 SortOrder = SortOrder . Descending ,
5757 CellFormat = TimestampFormatter . FormatMillisecondsGrouped ,
5858 } ) ;
@@ -78,6 +78,23 @@ public class PerfettoGenericEventTable
7878 new ColumnMetadata ( new Guid ( "{e7d08f97-f52c-4686-bc49-737f7a6a8bbb}" ) , "Provider" , "Provider name of the event" ) ,
7979 new UIHints { Width = 240 } ) ;
8080
81+ private static readonly ColumnConfiguration TrackNameIdColumn = new ColumnConfiguration (
82+ new ColumnMetadata ( new Guid ( "{111094F9-BEB4-486F-AD60-3F53CFF702EA}" ) , "TrackNameId" , "Track Name (Id)" ) ,
83+ new UIHints { Width = 240 } ) ;
84+
85+ private static readonly ColumnConfiguration ParentIdColumn = new ColumnConfiguration (
86+ new ColumnMetadata ( new Guid ( "{A77736C3-AC5C-4100-B246-3821A2E73B15}" ) , "Parent Id" , "Parent Id" ) ,
87+ new UIHints { Width = 240 } ) ;
88+
89+ private static readonly ColumnConfiguration ParentDepthLevelColumn = new ColumnConfiguration (
90+ new ColumnMetadata ( new Guid ( "{89572E6E-86D5-4CBA-B0D4-4F9D2147BF50}" ) , "Parent Depth Level" , "Parent Depth Level (0 is at Top of Tree)" ) ,
91+ new UIHints
92+ {
93+ Width = 70 ,
94+ SortPriority = 0 ,
95+ SortOrder = SortOrder . Ascending ,
96+ } ) ;
97+
8198 // Need 2 of these with different sorting
8299 const string CountColumnGuid = "{99192cbf-5888-4873-a3b3-4faf5beaea15}" ;
83100 private static readonly ColumnConfiguration CountColumn = new ColumnConfiguration (
@@ -161,6 +178,23 @@ public static void BuildTable(ITableBuilder tableBuilder, IDataExtensionRetrieva
161178 genericEventProjection . Compose ( ( genericEvent ) => genericEvent . Provider ) ) ;
162179 tableGenerator . AddColumn ( providerColumn ) ;
163180
181+ var trackNameIdColumn = new BaseDataColumn < string > (
182+ TrackNameIdColumn ,
183+ genericEventProjection . Compose ( ( genericEvent ) => genericEvent . ThreadTrack != null ?
184+ ( ! String . IsNullOrWhiteSpace ( genericEvent . ThreadTrack . Name ) ? $ "{ genericEvent . ThreadTrack . Name } ({ genericEvent . ThreadTrack . Id } )" : genericEvent . ThreadTrack . Id . ToString ( ) )
185+ : String . Empty ) ) ;
186+ tableGenerator . AddColumn ( trackNameIdColumn ) ;
187+
188+ var parentIdColumn = new BaseDataColumn < long > (
189+ ParentIdColumn ,
190+ genericEventProjection . Compose ( ( genericEvent ) => genericEvent . ParentId . HasValue ? genericEvent . ParentId . Value : - 1 ) ) ;
191+ tableGenerator . AddColumn ( parentIdColumn ) ;
192+
193+ var parentDepthLevelColumn = new BaseDataColumn < int > (
194+ ParentDepthLevelColumn ,
195+ genericEventProjection . Compose ( ( genericEvent ) => genericEvent . ParentTreeDepthLevel ) ) ;
196+ tableGenerator . AddColumn ( parentDepthLevelColumn ) ;
197+
164198 tableGenerator . AddColumn ( CountColumn , Projection . Constant < int > ( 1 ) ) ;
165199
166200 // The provider column is optionally populated depending on whether or not the user specified a ProviderGUID mapping file
@@ -240,8 +274,9 @@ public static void BuildTable(ITableBuilder tableBuilder, IDataExtensionRetrieva
240274 SetGraphTableConfig ( processThreadActivityConfig ) ;
241275
242276 var processThreadNameColumns = new List < ColumnConfiguration > ( defaultColumns ) ;
277+ processThreadNameColumns . Insert ( 3 , ParentDepthLevelColumn ) ;
243278 processThreadNameColumns . Remove ( EventNameColumn ) ;
244- processThreadNameColumns . Insert ( 3 , EventNameColumn ) ;
279+ processThreadNameColumns . Insert ( 4 , EventNameColumn ) ;
245280 var processThreadNameConfig = new TableConfiguration ( "Perfetto Trace Events - Process-Thread-Name" )
246281 {
247282 Columns = processThreadNameColumns ,
0 commit comments