Beispiel #1
0
 public void TimeStampGenerator00()
 {
     var scheduler = new DynamoScheduler(new SampleSchedulerThread());
     Assert.AreEqual(1024, scheduler.NextTimeStamp.Identifier);
     Assert.AreEqual(1025, scheduler.NextTimeStamp.Identifier);
     Assert.AreEqual(1026, scheduler.NextTimeStamp.Identifier);
 }
Beispiel #2
0
        /// <summary>
        /// Constructs an instance of AsyncTask object.
        /// </summary>
        /// <param name="scheduler">A reference to the DynamoScheduler, this 
        /// parameter cannot be null.</param>
        /// 
        protected AsyncTask(DynamoScheduler scheduler)
        {
            if (scheduler == null)
                throw new ArgumentNullException("scheduler");

            this.scheduler = scheduler;
            CreationTime = scheduler.NextTimeStamp;
        }
Beispiel #3
0
        /// <summary>
        /// Constructs an instance of AsyncTask object.
        /// </summary>
        /// <param name="scheduler">A reference to the DynamoScheduler, this 
        /// parameter cannot be null.</param>
        /// <param name="callback">A delegate to be invoked when the AsyncTask 
        /// completes asynchronously. This parameter is optional.</param>
        /// 
        protected AsyncTask(DynamoScheduler scheduler, Action<AsyncTask> callback)
        {
            if (scheduler == null)
                throw new ArgumentNullException("scheduler");

            this.scheduler = scheduler;
            this.callback = callback;
            CreationTime = scheduler.NextTimeStamp;
        }
Beispiel #4
0
        public void Initialize(DynamoScheduler owningScheduler)
        {
            scheduler = owningScheduler;
            internalThread = new Thread(ThreadProc)
            {
                IsBackground = true,
                Name = "DynamoSchedulerThread"
            };

            internalThread.Start();
        }
Beispiel #5
0
        public HomeWorkspaceModel(
            EngineController engine, 
            DynamoScheduler scheduler, 
            NodeFactory factory,
            IEnumerable<KeyValuePair<Guid, List<string>>> traceData, 
            IEnumerable<NodeModel> e, 
            IEnumerable<NoteModel> n, 
            IEnumerable<AnnotationModel> a,
            IEnumerable<PresetModel> presets,
            ElementResolver resolver,
            WorkspaceInfo info, 
            bool verboseLogging,
            bool isTestMode)
            : base(e, n,a, info, factory,presets, resolver)
        {
            EvaluationCount = 0;

            // This protects the user from a file that might have crashed during
            // its last run.  As a side effect, this also causes all files set to
            // run auto but lacking the HasRunWithoutCrash flag to run manually.
            if (info.RunType == RunType.Automatic && !info.HasRunWithoutCrash)
            {
                info.RunType = RunType.Manual;
            }

            RunSettings = new RunSettings(info.RunType, info.RunPeriod);

            PreloadedTraceData = traceData;

            this.scheduler = scheduler;
            this.verboseLogging = verboseLogging;
            IsTestMode = isTestMode;
            EngineController = engine;

            // The first time the preloaded trace data is set, we cache
            // the data as historical. This will be used after the initial
            // run of this workspace, when the PreloadedTraceData has been
            // nulled, to check for node deletions and reconcile the trace data.
            // We do a deep copy of this data because the PreloadedTraceData is
            // later set to null before the graph update.
            var copiedData = new List<KeyValuePair<Guid, List<string>>>();
            foreach (var kvp in PreloadedTraceData)
            {
                var strings = kvp.Value.Select(string.Copy).ToList();
                copiedData.Add(new KeyValuePair<Guid, List<string>>(kvp.Key, strings));
            }
            historicalTraceData = copiedData;

        }
Beispiel #6
0
        public virtual void ShutDown(bool shutDownHost)
        {
            ShutdownRequested = true;

            CleanWorkbench();

            EngineController.Dispose();
            EngineController = null;

            PreferenceSettings.Save();

            OnCleanup();

            Logger.Dispose();

            InstrumentationLogger.End();

#if ENABLE_DYNAMO_SCHEDULER
            if (scheduler != null)
            {
                scheduler.Shutdown();
                scheduler = null;
            }
#endif
        }
 internal UpdateRenderPackageAsyncTask(DynamoScheduler scheduler)
     : base(scheduler)
 {
     nodeGuid = Guid.Empty;
     renderPackages = new List<IRenderPackage>();
 }
Beispiel #8
0
 internal UpdateGraphAsyncTask(DynamoScheduler scheduler)
     : base(scheduler)
 {
 }
 internal SetTraceDataAsyncTask(DynamoScheduler scheduler)
     : base(scheduler)
 {
 }
Beispiel #10
0
        protected virtual void ShutDownCore(bool shutdownHost)
        {
            CleanWorkbench();

            EngineController.Dispose();
            EngineController = null;

            PreferenceSettings.Save();
            PreferenceSettings.PropertyChanged -= PreferenceSettings_PropertyChanged;

            OnCleanup();

            Logger.Dispose();

            DynamoSelection.DestroyInstance();
            UsageReportingManager.DestroyInstance();

            InstrumentationLogger.End();

#if ENABLE_DYNAMO_SCHEDULER
            if (scheduler != null)
            {
                scheduler.Shutdown();
                scheduler.TaskStateChanged -= OnAsyncTaskStateChanged;
                scheduler = null;
            }
#endif
        }
Beispiel #11
0
        public void TestTaskQueuePreProcessing06()
        {
            var schedulerThread = new SampleSchedulerThread();
            var scheduler = new DynamoScheduler(schedulerThread, false);

            schedulerThread.GetSchedulerToProcessTasks();
            Assert.Pass("Scheduler thread successfully exits");
        }
 internal DelegateBasedAsyncTask(DynamoScheduler scheduler, Action<AsyncTask> callback)
     : base(scheduler, callback)
 {
 }
Beispiel #13
0
 internal DelegateBasedAsyncTask(DynamoScheduler scheduler)
     : base(scheduler)
 {
 }
Beispiel #14
0
 internal UpdateGraphAsyncTask(DynamoScheduler scheduler)
     : base(scheduler)
 {
 }
Beispiel #15
0
 internal SetTraceDataAsyncTask(DynamoScheduler scheduler)
     : base(scheduler)
 {
 }
Beispiel #16
0
        protected DynamoModel(IStartConfiguration config)
        {
            ClipBoard = new ObservableCollection<ModelBase>();

            pathManager = new PathManager(new PathManagerParams
            {
                CorePath = config.DynamoCorePath,
                PathResolver = config.PathResolver
            });

            // Ensure we have all directories in place.
            var exceptions = new List<Exception>();
            pathManager.EnsureDirectoryExistence(exceptions);

            Context = config.Context;
            IsTestMode = config.StartInTestMode;
            DebugSettings = new DebugSettings();
            Logger = new DynamoLogger(DebugSettings, pathManager.LogDirectory);

            foreach (var exception in exceptions)
            {
                Logger.Log(exception); // Log all exceptions.
            }

            MigrationManager = new MigrationManager(DisplayFutureFileMessage, DisplayObsoleteFileMessage);
            MigrationManager.MessageLogged += LogMessage;
            MigrationManager.MigrationTargets.Add(typeof(WorkspaceMigrations));

            var thread = config.SchedulerThread ?? new DynamoSchedulerThread();
            Scheduler = new DynamoScheduler(thread, IsTestMode ? TaskProcessMode.Synchronous : TaskProcessMode.Asynchronous);
            Scheduler.TaskStateChanged += OnAsyncTaskStateChanged;

            geometryFactoryPath = config.GeometryFactoryPath;

            IPreferences preferences = CreateOrLoadPreferences(config.Preferences);
            var settings = preferences as PreferenceSettings;
            if (settings != null)
            {
                PreferenceSettings = settings;
                PreferenceSettings.PropertyChanged += PreferenceSettings_PropertyChanged;
            }

            InitializePreferences(preferences);
            InitializeInstrumentationLogger();

            if (!isTestMode && this.PreferenceSettings.IsFirstRun)
            {
                DynamoMigratorBase migrator = null;

                try
                {
                    migrator = DynamoMigratorBase.MigrateBetweenDynamoVersions(pathManager, config.PathResolver);
                }
                catch (Exception e)
                {
                    Logger.Log(e.Message);
                }

                if (migrator != null)
                {
                    var isFirstRun = this.PreferenceSettings.IsFirstRun;
                    this.PreferenceSettings = migrator.PreferenceSettings;

                    // Preserve the preference settings for IsFirstRun as this needs to be set 
                    // only by UsageReportingManager
                    this.PreferenceSettings.IsFirstRun = isFirstRun;
                }
            }

            // At this point, pathManager.PackageDirectories only has 1 element which is the directory
            // in AppData. If list of PackageFolders is empty, add the folder in AppData to the list since there
            // is no additional location specified. Otherwise, update pathManager.PackageDirectories to include
            // PackageFolders
            if (PreferenceSettings.CustomPackageFolders.Count == 0)
                PreferenceSettings.CustomPackageFolders = new List<string> {pathManager.UserDataDirectory};
            else
                pathManager.LoadCustomPackageFolders(PreferenceSettings.CustomPackageFolders);


            SearchModel = new NodeSearchModel();
            SearchModel.ItemProduced +=
                node => ExecuteCommand(new CreateNodeCommand(node, 0, 0, true, true));

            NodeFactory = new NodeFactory();
            NodeFactory.MessageLogged += LogMessage;

            CustomNodeManager = new CustomNodeManager(NodeFactory, MigrationManager);
            InitializeCustomNodeManager();

            extensionManager = new ExtensionManager();
            extensionManager.MessageLogged += LogMessage;
            var extensions = config.Extensions ?? ExtensionManager.ExtensionLoader.LoadDirectory(pathManager.ExtensionsDirectory);

            Loader = new NodeModelAssemblyLoader();
            Loader.MessageLogged += LogMessage;

            // Create a core which is used for parsing code and loading libraries
            var libraryCore =
                new ProtoCore.Core(new Options { RootCustomPropertyFilterPathName = string.Empty });

            libraryCore.Compilers.Add(Language.kAssociative, new Compiler(libraryCore));
            libraryCore.Compilers.Add(Language.kImperative, new ProtoImperative.Compiler(libraryCore));
            libraryCore.ParsingMode = ParseMode.AllowNonAssignment;

            LibraryServices = new LibraryServices(libraryCore, pathManager);
            LibraryServices.MessageLogged += LogMessage;
            LibraryServices.LibraryLoaded += LibraryLoaded;

            ResetEngineInternal();

            AddHomeWorkspace();

            AuthenticationManager = new AuthenticationManager(config.AuthProvider);

            UpdateManager = config.UpdateManager ?? new DefaultUpdateManager(null);
            UpdateManager.Log += UpdateManager_Log;
            if (!IsTestMode)
            {
                DefaultUpdateManager.CheckForProductUpdate(UpdateManager);
            }
            
            Logger.Log(string.Format("Dynamo -- Build {0}", 
                                        Assembly.GetExecutingAssembly().GetName().Version));

            InitializeNodeLibrary(preferences);

            if (extensions.Any())
            {
                var startupParams = new StartupParams(config.AuthProvider,
                    pathManager, new ExtensionLibraryLoader(this), CustomNodeManager,
                    GetType().Assembly.GetName().Version, preferences);

                foreach (var ext in extensions)
                {
                    var logSource = ext as ILogSource;
                    if (logSource != null)
                        logSource.MessageLogged += LogMessage;

                    try
                    {
                        ext.Startup(startupParams);
                    }
                    catch (Exception ex)
                    {
                        Logger.Log(ex.Message);                       
                    }

                    ExtensionManager.Add(ext);
                }
            }

            LogWarningMessageEvents.LogWarningMessage += LogWarningMessage;

            StartBackupFilesTimer();

            TraceReconciliationProcessor = this; 
            
            foreach (var ext in ExtensionManager.Extensions)
            {
                try
                {
                    ext.Ready(new ReadyParams(this));
                }
                catch (Exception ex)
                {
                    Logger.Log(ex.Message);
                }
            }
        }
Beispiel #17
0
 internal PrioritizedAsyncTask(DynamoScheduler scheduler, int priority)
     : base(scheduler)
 {
     CurrPriority = priority; // Assign task priority.
 }
Beispiel #18
0
 internal InconsequentialAsyncTask(DynamoScheduler scheduler, int punch)
     : base(scheduler)
 {
     Punch = punch;
 }
Beispiel #19
0
        public void TestTaskStateChangedEventHandling()
        {
            var observer = new TaskEventObserver();
            var schedulerThread = new SampleSchedulerThread();
            var scheduler = new DynamoScheduler(schedulerThread, false);
            scheduler.TaskStateChanged += observer.OnTaskStateChanged;

            // Start scheduling a bunch of tasks.
            var asyncTasks = new AsyncTask[]
            {
                new ErrorProneAsyncTask(scheduler, 7), 
                new InconsequentialAsyncTask(scheduler, 100),
                new PrioritizedAsyncTask(scheduler, 1),
                new PrioritizedAsyncTask(scheduler, 5),
                new ErrorProneAsyncTask(scheduler, 3), 
                new InconsequentialAsyncTask(scheduler, 500),
                new InconsequentialAsyncTask(scheduler, 300),
                new PrioritizedAsyncTask(scheduler, 3), 
                new ErrorProneAsyncTask(scheduler, 5), 
            };

            foreach (SampleAsyncTask asyncTask in asyncTasks)
                scheduler.ScheduleForExecution(asyncTask);

            schedulerThread.GetSchedulerToProcessTasks();

            // Drops all InconsequentialAsyncTask and leave behind one.
            // Kept all PrioritizedAsyncTask instances and sorted them.
            var expected = new List<string>
            {
                // Scheduling notifications...

                "Scheduled: ErrorProneAsyncTask: 7",
                "Scheduled: InconsequentialAsyncTask: 100",
                "Scheduled: PrioritizedAsyncTask: 1",
                "Scheduled: PrioritizedAsyncTask: 5",
                "Scheduled: ErrorProneAsyncTask: 3",
                "Scheduled: InconsequentialAsyncTask: 500",
                "Scheduled: InconsequentialAsyncTask: 300",
                "Scheduled: PrioritizedAsyncTask: 3",
                "Scheduled: ErrorProneAsyncTask: 5",

                // Task discarded notifications...

                "Discarded: InconsequentialAsyncTask: 100",
                "Discarded: InconsequentialAsyncTask: 300",

                // Execution of remaining tasks...

                "ExecutionStarting: ErrorProneAsyncTask: 7",
                "ExecutionFailed: ErrorProneAsyncTask: 7",
                "CompletionHandled: ErrorProneAsyncTask: 7",

                "ExecutionStarting: PrioritizedAsyncTask: 1",
                "ExecutionCompleted: PrioritizedAsyncTask: 1",
                "CompletionHandled: PrioritizedAsyncTask: 1",

                "ExecutionStarting: PrioritizedAsyncTask: 5",
                "ExecutionCompleted: PrioritizedAsyncTask: 5",
                "CompletionHandled: PrioritizedAsyncTask: 5",

                "ExecutionStarting: ErrorProneAsyncTask: 3",
                "ExecutionFailed: ErrorProneAsyncTask: 3",
                "CompletionHandled: ErrorProneAsyncTask: 3",

                "ExecutionStarting: PrioritizedAsyncTask: 3",
                "ExecutionCompleted: PrioritizedAsyncTask: 3",
                "CompletionHandled: PrioritizedAsyncTask: 3",

                "ExecutionStarting: ErrorProneAsyncTask: 5",
                "ExecutionFailed: ErrorProneAsyncTask: 5",
                "CompletionHandled: ErrorProneAsyncTask: 5",

                // Execution of InconsequentialAsyncTask last...

                "ExecutionStarting: InconsequentialAsyncTask: 500",
                "ExecutionCompleted: InconsequentialAsyncTask: 500",
                "CompletionHandled: InconsequentialAsyncTask: 500"
            };

            Assert.AreEqual(expected.Count, observer.Results.Count());

            int index = 0;
            foreach (var actual in observer.Results)
            {
                Assert.AreEqual(expected[index++], actual);
            }
        }
Beispiel #20
0
 internal ErrorProneAsyncTask(DynamoScheduler scheduler, int value)
     : base(scheduler)
 {
     Value = value;
 }
 internal CompileCustomNodeAsyncTask(DynamoScheduler scheduler)
     : base(scheduler)
 {
 }
Beispiel #22
0
 internal void GrabTimeStamp(DynamoScheduler scheduler)
 {
     // Get the time-stamp value from the scheduler.
     this.TimeStampValue = scheduler.NextTimeStamp;
     this.doneEvent.Set(); // Done with grabbing.
 }
Beispiel #23
0
        /// <summary>
        /// DynamoModel calls this method prior to scheduling a graph update for
        /// the home workspace. This method is called to schedule custom node 
        /// compilation since the home workspace update may depend on it. Any 
        /// updates to a CustomNodeDefinition will cause GraphSyncData to be added 
        /// to "pendingCustomNodeSyncData" queue.
        /// </summary>
        /// <param name="scheduler">The scheduler on which custom node compilation 
        /// task can be scheduled.</param>
        /// 
        internal void ProcessPendingCustomNodeSyncData(DynamoScheduler scheduler)
        {
            while (pendingCustomNodeSyncData.Count > 0)
            {
                var initParams = new CompileCustomNodeParams()
                {
                    SyncData = pendingCustomNodeSyncData.Dequeue(),
                    EngineController = this
                };

                var compileTask = new CompileCustomNodeAsyncTask(scheduler);
                if (compileTask.Initialize(initParams))
                    scheduler.ScheduleForExecution(compileTask);
            }
        }
Beispiel #24
0
 internal void OnTaskStateChanged(
     DynamoScheduler scheduler,
     TaskStateChangedEventArgs e)
 {
     AddToResultList(e.Task.ToString(), e.CurrentState);
 }
 internal SetTraceDataAsyncTask(DynamoScheduler scheduler, Action<AsyncTask> callback)
     : base(scheduler, callback)
 {
 }
Beispiel #26
0
        public void TimeStampGenerator01()
        {
            const int EventCount = 16;
            var events = new ManualResetEvent[EventCount];
            var grabbers = new TimeStampGrabber[EventCount];

            // Initialize events and time stamp grabbers.
            for (int index = 0; index < EventCount; ++index)
            {
                events[index] = new ManualResetEvent(false);
                grabbers[index] = new TimeStampGrabber(events[index]);
            }

            // Start all time-stamp grabbers "at one go".
            var scheduler = new DynamoScheduler(new SampleSchedulerThread(), true);
            Parallel.For(0, EventCount, ((index) =>
            {
                grabbers[index].GrabTimeStamp(scheduler);
            }));

            WaitHandle.WaitAll(events);
            var values = new List<TimeStamp>();
            for (int index = 0; index < EventCount; ++index)
                values.Add(grabbers[index].TimeStampValue);

            // Ensure we get a list of time stamps, and that these numbers are 
            // all unique (i.e. the distinct set of numbers returned should have
            // the same count as the original list).
            // 
            Assert.AreEqual(EventCount, values.Count);
            var distinct = values.Distinct();
            Assert.AreEqual(values.Count, distinct.Count());
        }
Beispiel #27
0
        protected DynamoModel(StartConfiguration configuration)
        {
            string context = configuration.Context;
            IPreferences preferences = configuration.Preferences;
            string corePath = configuration.DynamoCorePath;
            DynamoRunner runner = configuration.Runner;
            bool isTestMode = configuration.StartInTestMode;

            DynamoPathManager.Instance.InitializeCore(corePath);
            UsageReportingManager.Instance.InitializeCore(this);

            Runner = runner;
            Context = context;
            IsTestMode = isTestMode;
            Logger = new DynamoLogger(this, DynamoPathManager.Instance.Logs);
            DebugSettings = new DebugSettings();

#if ENABLE_DYNAMO_SCHEDULER
            var thread = configuration.SchedulerThread ?? new DynamoSchedulerThread();
            scheduler = new DynamoScheduler(thread);
#endif

            if (preferences is PreferenceSettings)
            {
                this.PreferenceSettings = preferences as PreferenceSettings;
                PreferenceSettings.PropertyChanged += PreferenceSettings_PropertyChanged;
            }

            InitializePreferences(preferences);
            InitializeInstrumentationLogger();

            UpdateManager.UpdateManager.Instance.CheckForProductUpdate(new UpdateRequest(new Uri(Configurations.UpdateDownloadLocation)));

            SearchModel = new SearchModel(this);

            InitializeCurrentWorkspace();

            this.CustomNodeManager = new CustomNodeManager(this, DynamoPathManager.Instance.UserDefinitions);
            this.Loader = new DynamoLoader(this);

            this.Loader.PackageLoader.DoCachedPackageUninstalls();
            this.Loader.PackageLoader.LoadPackages();

            DisposeLogic.IsShuttingDown = false;

            this.EngineController = new EngineController(this, DynamoPathManager.Instance.GeometryFactory);
            this.CustomNodeManager.RecompileAllNodes(EngineController);

            // Reset virtual machine to avoid a race condition by causing a 
            // thread join inside the vm exec. Since DynamoModel is being called 
            // on the main/idle thread, it is safe to call ResetEngineInternal 
            // directly (we cannot call virtual method ResetEngine here).
            // 
            ResetEngineInternal();
            Nodes.ForEach(n => n.RequiresRecalc = true);

            Logger.Log(String.Format(
                "Dynamo -- Build {0}",
                Assembly.GetExecutingAssembly().GetName().Version));

            this.Loader.ClearCachedAssemblies();
            this.Loader.LoadNodeModels();

            MigrationManager.Instance.MigrationTargets.Add(typeof(WorkspaceMigrations));

            PackageManagerClient = new PackageManagerClient(this);
        }
Beispiel #28
0
        public void TestSchedulerCreationDestruction()
        {
            var schedulerThread = new SampleSchedulerThread();
            Assert.IsFalse(schedulerThread.Initialized);
            Assert.IsFalse(schedulerThread.Destroyed);

            var scheduler = new DynamoScheduler(schedulerThread, false);
            Assert.IsTrue(schedulerThread.Initialized);
            Assert.IsFalse(schedulerThread.Destroyed);

            scheduler.Shutdown();
            Assert.IsTrue(schedulerThread.Initialized);
            Assert.IsTrue(schedulerThread.Destroyed);
        }
Beispiel #29
0
 public HomeWorkspaceModel(EngineController engine, DynamoScheduler scheduler, 
     NodeFactory factory, bool verboseLogging, bool isTestMode, string fileName="")
     : this(
         engine,
         scheduler,
         factory,
         Enumerable.Empty<KeyValuePair<Guid, List<string>>>(),
         Enumerable.Empty<NodeModel>(),
         Enumerable.Empty<NoteModel>(),
         Enumerable.Empty<AnnotationModel>(),
         Enumerable.Empty<PresetModel>(),
         new ElementResolver(),
         new WorkspaceInfo(){FileName = fileName, Name = "Home"},
         verboseLogging, 
         isTestMode) { }
Beispiel #30
0
        public void TestTaskQueuePreProcessing05()
        {
            var schedulerThread = new SampleSchedulerThread();
            var scheduler = new DynamoScheduler(schedulerThread, false);

            // Start scheduling a bunch of tasks.
            var asyncTasks = new AsyncTask[]
            {
                new PrioritizedAsyncTask(scheduler, 1), 
                new InconsequentialAsyncTask(scheduler, 100),
            };

            var results = new List<string>();
            foreach (SampleAsyncTask asyncTask in asyncTasks)
            {
                asyncTask.InitializeWithResultList(results);
                scheduler.ScheduleForExecution(asyncTask);
            }

            schedulerThread.GetSchedulerToProcessTasks();

            // Drops all InconsequentialAsyncTask and leave behind one.
            // Kept all PrioritizedAsyncTask instances and sorted them.
            Assert.AreEqual(2, results.Count);
            Assert.AreEqual("PrioritizedAsyncTask: 1", results[0]);
            Assert.AreEqual("InconsequentialAsyncTask: 100", results[1]);
        }
 internal DelegateBasedAsyncTask(DynamoScheduler scheduler)
     : base(scheduler)
 {
 }
Beispiel #32
0
 internal SampleAsyncTask(DynamoScheduler scheduler)
     : base(scheduler)
 {
 }
Beispiel #33
0
        /// <summary>
        /// This event handler is invoked when DynamoScheduler changes the state 
        /// of an AsyncTask object. See TaskStateChangedEventArgs.State for more 
        /// details of these state changes.
        /// </summary>
        /// <param name="sender">The scheduler which raised the event.</param>
        /// <param name="e">Task state changed event argument.</param>
        /// 
        private void OnAsyncTaskStateChanged(DynamoScheduler sender, TaskStateChangedEventArgs e)
        {
            switch (e.CurrentState)
            {
                case TaskStateChangedEventArgs.State.ExecutionStarting:
                    if (e.Task is UpdateGraphAsyncTask)
                        ExecutionEvents.OnGraphPreExecution();
                    break;

                case TaskStateChangedEventArgs.State.ExecutionCompleted:
                    if (e.Task is UpdateGraphAsyncTask)
                    {
                        // Record execution time for update graph task.
                        long start = e.Task.ExecutionStartTime.TickCount;
                        long end = e.Task.ExecutionEndTime.TickCount;
                        var executionTimeSpan = new TimeSpan(end - start);

                        InstrumentationLogger.LogAnonymousTimedEvent(
                            "Perf",
                            e.Task.GetType().Name,
                            executionTimeSpan);

                        Debug.WriteLine(String.Format(Resources.EvaluationCompleted, executionTimeSpan));

                        ExecutionEvents.OnGraphPostExecution();
                    }
                    break;
            }
        }
Beispiel #34
0
 internal CompileCustomNodeAsyncTask(DynamoScheduler scheduler)
     : base(scheduler)
 {
 }