internal void RecordBlockingExtension(object extension)
        {
            if (extension == null)
            {
                return;
            }

            string extensionName;

            switch (extension)
            {
            case IAsyncCompletionSource source:
                extensionName = CompletionTelemetryHost.GetSourceName(source);
                break;

            case IAsyncCompletionItemManager itemManager:
                extensionName = CompletionTelemetryHost.GetItemManagerName(itemManager);
                break;

            case IAsyncCompletionCommitManager commitManager:
                extensionName = CompletionTelemetryHost.GetCommitManagerName(commitManager);
                break;

            default:
                extensionName = extension.GetType().ToString();
                break;
            }

            if (!BlockingExtensionCounter.ContainsKey(extensionName))
            {
                BlockingExtensionCounter[extensionName] = 0;
            }
            BlockingExtensionCounter[extensionName]++;
        }
Exemple #2
0
        internal void RecordObtainingSourceContext(IAsyncCompletionSource source, long elapsedMilliseconds)
        {
            var name = CompletionTelemetryHost.GetSourceName(source);

            if (Headless)
            {
                name = HeadlessCallNamePrefix + name;
            }
            ItemSourceGetContextDuration[name] = elapsedMilliseconds;
        }