@@ -72,11 +72,15 @@ public async Task RunAsync(
72
72
var srcProj = ctx . SourceProject ;
73
73
var testProj = ctx . TestProject ;
74
74
75
+ var modPerf = new Dictionary < IMod , Stopwatch > ( ) ;
76
+
75
77
// Initialize the mods
76
78
foreach ( var jobMod in jobMods )
77
79
{
78
80
logger . LogDebug ( "Using mod {0} for {1}" , jobMod . GetType ( ) . Name , key ) ;
81
+ modPerf . Add ( jobMod , Stopwatch . StartNew ( ) ) ;
79
82
await jobMod . InitializeAsync ( ctx , ct ) ;
83
+ modPerf [ jobMod ] . Stop ( ) ;
80
84
if ( ctx . SourceProject != srcProj || ctx . TestProject != testProj )
81
85
{
82
86
throw new InvalidOperationException (
@@ -88,12 +92,17 @@ public async Task RunAsync(
88
92
foreach ( var jobMod in jobMods )
89
93
{
90
94
logger . LogInformation ( "Executing {} for {}..." , jobMod . GetType ( ) . Name , key ) ;
95
+ modPerf [ jobMod ] . Start ( ) ;
91
96
await jobMod . ExecuteAsync ( ctx , ct ) ;
97
+ modPerf [ jobMod ] . Stop ( ) ;
92
98
}
93
99
94
100
// Manually dispose so that we don't do this when generation fails (await using is too clever).
95
101
await ctx . DisposeAsync ( ) ;
96
102
103
+ logger . LogInformation ( "Job Mod Performance Data for {} \n {}" , key ,
104
+ string . Join ( "\n " , modPerf . Select ( kvp => $ "{ kvp . Key . GetType ( ) . Name } : { kvp . Value . Elapsed . TotalSeconds } seconds") ) ) ;
105
+
97
106
// Output the generated bindings
98
107
logger . LogInformation (
99
108
"Bindings generation for {} completed in {} seconds." ,
0 commit comments