/// <summary>
        /// Provides text statistics for pending <see cref="HttpContext"/> that wait for Redis commands.
        /// <para>Scans thread stacks for <see cref="HttpContext"/> instances, and <see cref="string"/>s that contain 'redis.call' text inside.</para>
        /// </summary>
        /// <param name="connection"></param>
        /// <param name="connectionFactory"></param>
        /// <param name="threadFilter"></param>
        /// <param name="threadStackObjectsFilter"></param>
        /// <param name="factory"></param>
        /// <returns></returns>
        public virtual StringBuilder ExtractRedisPendingCommandsForRequests(IMemoryDumpConnectionPath connection, IClrRuntimeFactory connectionFactory = null,
                                                                            IModelMapperFactory factory = null)
        {
            var runtime = (connectionFactory ?? MDClrRuntimeFactory.Instance).BuildClrRuntime(connection);


            return(ExtractRedisPendingCommandsForRequests(runtime, factory ?? ModelMapperManager.NewMapperFactory));
        }
        public static IEnumerable <ClrObject> EnumerateObjects(this IEnumerateClrObjectsFromClrRuntime objectEnumerator, IMemoryDumpConnectionPath connectionDetails, IClrRuntimeFactory factory)
        {
            var runtime = factory.BuildClrRuntime(connectionDetails);

            return(objectEnumerator.EnumerateObjectsFromSource(runtime));
        }
        public static IEnumerable <T> EnumerateObjectsFromHeap <T>(this IFilteredObjectsProvider filteredObjectProvider, IMemoryDumpConnectionPath connection, IModelMapperFactory factory, IClrRuntimeFactory runtimeFactory = null) where T : class, IClrObjMappingModel
        {
            runtimeFactory = runtimeFactory ?? MDClrRuntimeFactory.Instance;

            var runtime = MDClrRuntimeFactory.Instance.BuildClrRuntime(connection);

            var heapObjects = HeapBasedClrObjectEnumerator.Instance;

            var stream = filteredObjectProvider.ExtractFromRuntime(runtime, heapObjects);

            foreach (var matched in stream)
            {
                yield return(factory.BuildOfType <T>(matched));
            }
        }
示例#4
0
 public PrintStringBuilders(int minimumTimeMetToPrint = 3, IClrRuntimeFactory runtimeFactory = null, IModelMapperFactory modelMapperFactory = null)
 {
     _minimumTimeMetToPrint = minimumTimeMetToPrint;
     _runtimeFactory        = runtimeFactory ?? MDClrRuntimeFactory.Instance;
     _modelMapperFactory    = modelMapperFactory;
 }
        public static IEnumerable <ClrObject> EnumerateObjectsFromHeap(this IFilteredObjectsProvider filteredObjectProvider, IMemoryDumpConnectionPath connection, IClrRuntimeFactory runtimeFactory = null)
        {
            runtimeFactory = runtimeFactory ?? MDClrRuntimeFactory.Instance;

            var runtime = MDClrRuntimeFactory.Instance.BuildClrRuntime(connection);

            var heapObjects = HeapBasedClrObjectEnumerator.Instance;

            return(filteredObjectProvider.ExtractFromRuntime(runtime, heapObjects));
        }