XiHan.Framework.Observability.Host
5.0.0-preview.1
Prefix Reserved
This is a prerelease version of XiHan.Framework.Observability.Host.
There is a newer prerelease version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package XiHan.Framework.Observability.Host --version 5.0.0-preview.1
NuGet\Install-Package XiHan.Framework.Observability.Host -Version 5.0.0-preview.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="XiHan.Framework.Observability.Host" Version="5.0.0-preview.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="XiHan.Framework.Observability.Host" Version="5.0.0-preview.1" />
<PackageReference Include="XiHan.Framework.Observability.Host" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add XiHan.Framework.Observability.Host --version 5.0.0-preview.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: XiHan.Framework.Observability.Host, 5.0.0-preview.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package XiHan.Framework.Observability.Host@5.0.0-preview.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=XiHan.Framework.Observability.Host&version=5.0.0-preview.1&prerelease
#tool nuget:?package=XiHan.Framework.Observability.Host&version=5.0.0-preview.1&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
XiHan.Framework.Observability.Host
运行信息(Ring 3,role: default,RFC-0023)。提供 observability.host@1:单例 IHostMonitor 读进程与所在主机的 CPU、内存、磁盘、网卡、GPU、主板与运行时长,供管理界面的服务监控使用。
builder.AddXiHan(xihan => xihan.UseStandardProfile().UseFeature<HostObservabilityFeature>());
{ "XiHan": { "Observability": { "Host": { "SampleIntervalSeconds": 5 } } } }
规则
- 不启动外部命令:只读 BCL、
/proc与/sys、pci.ids、注册表与 kernel32(GetSystemTimes、GetLogicalProcessorInformation、K32GetPerformanceInfo),不用 WMI、PowerShell、dmidecode、lspci、nvidia-smi、top。 - 读不到的项为
null;单项失败不影响其他项,读取不抛出。 - CPU 型号与核心、GPU、主板首次读取后缓存;内存、磁盘、网卡、运行时每次当场读。
- 使用率与速率由后台采样器求两次采样之差:启动时同步采一次,之后每
SampleIntervalSeconds(默认 5,取值 (0, 3600])采一次;读取只返回最近的值,不睡眠、不等待,启动后第一个间隔内为null。 - 平台:Linux 与 Windows 读全部项(各自的读取路径见 RFC-0023);macOS 等只有 BCL 读得到的部分,CPU 型号与使用率、内存、GPU、主板为
null。 - 已知限制:不启动外部命令就读不到的项(NVIDIA 显存与温度、GPU 使用率与显示模式、Windows 主板序列号等)列在 RFC-0023。
测试
Linux 的读取路径以根目录为参数,夹具用例在任何系统上运行;真实机器上的用例分 Windows 与 Linux,只在对应系统上运行。
依赖方向
依赖 XiHan.Framework.Kernel 与 XiHan.Framework.Observability.Abstractions,没有第三方包。
状态
P5:可用。
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.14)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Diagnostics.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Options (>= 10.0.14)
- System.Threading.RateLimiting (>= 10.0.14)
- XiHan.Framework.Kernel (>= 5.0.0-preview.1)
- XiHan.Framework.Observability.Abstractions (>= 5.0.0-preview.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on XiHan.Framework.Observability.Host:
| Package | Downloads |
|---|---|
|
XiHan.Framework.Profiles.Full
曦寒框架 Full 组合包 |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 5.0.0-preview.2 | 77 | 11/6/2026 |
| 5.0.0-preview.1 | 58 | 11/4/2026 |