public static void OnAfterScriptExecute(HostedScriptEngine engine) { if (CodeStatisticsEnabled) { var codeStat = engine.GetCodeStatData(); CodeStatWriter statsWriter = new CodeStatWriter(CodeStatisticsFileName, CodeStatWriterType.JSON); statsWriter.Write(codeStat); } }