进程监控空引用异常, 这里的Process为空
https://github.com/whuanle/CZGL.SystemInfo/blob/bce18ba6f495e81921d92c8d6e87027e5db9e90c/src/CZGL.ProcessMetrics/ProcessMetricsCore.cs#L178
[11:06:20 EROR] An unhandled exception has occurred while executing the request.
System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.)
---> System.NullReferenceException: Object reference not set to an instance of an object.
at System.Diagnostics.Process.get_HandleCount()
at CZGL.ProcessMetrics.ProcessMetricsCore.b15_0()
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
at CZGL.ProcessMetrics.ProcessMetricsCore.ProcessThreadsRecord()
at CZGL.ProcessMetrics.ProcessMetricsCore.GetPrometheus()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at CZGL.ProcessMetrics.Extensions.<>c.<b__0_0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Routing.EndpointMiddleware.gAwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
这个是偶发现象,不容易复现
网卡监控构造函数懒加载空引用异常
https://github.com/whuanle/CZGL.SystemInfo/blob/edaee60d28e0ac77b0d6f3ddef3770959df5553a/src/CZGL.SystemInfo/NetworkInfo.cs#L24
System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.)
---> System.NullReferenceException: Object reference not set to an instance of an object.
at CZGL.SystemInfo.NetworkInfo.<.ctor>b3_3()
at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy`1.CreateValue()
at CZGL.ProcessMetrics.ProcessMetricsCore.b__12_0()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b277_0(Object obj)
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
rumtime: aspnet:5.0-alpine nuget: CZGL.ProcessMetrics.ASPNETCore 1.0.0
进程监控空引用异常, 这里的Process为空 https://github.com/whuanle/CZGL.SystemInfo/blob/bce18ba6f495e81921d92c8d6e87027e5db9e90c/src/CZGL.ProcessMetrics/ProcessMetricsCore.cs#L178 [11:06:20 EROR] An unhandled exception has occurred while executing the request. System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.) ---> System.NullReferenceException: Object reference not set to an instance of an object. at System.Diagnostics.Process.get_HandleCount() at CZGL.ProcessMetrics.ProcessMetricsCore.b15_0()
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
at CZGL.ProcessMetrics.ProcessMetricsCore.ProcessThreadsRecord()
at CZGL.ProcessMetrics.ProcessMetricsCore.GetPrometheus()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at CZGL.ProcessMetrics.Extensions.<>c.<b__0_0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Routing.EndpointMiddleware.g AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
这个是偶发现象,不容易复现 网卡监控构造函数懒加载空引用异常 https://github.com/whuanle/CZGL.SystemInfo/blob/edaee60d28e0ac77b0d6f3ddef3770959df5553a/src/CZGL.SystemInfo/NetworkInfo.cs#L24 System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.) ---> System.NullReferenceException: Object reference not set to an instance of an object. at CZGL.SystemInfo.NetworkInfo.<.ctor>b3_3() at System.Lazyb__12_0()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b 277_0(Object obj)
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy
1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy`1.CreateValue() at CZGL.ProcessMetrics.ProcessMetricsCore.