Class KernelTelemetryCollector
- Namespace
- DotCompute.Core.Telemetry
- Assembly
- DotCompute.Core.dll
Thread-safe production implementation of kernel telemetry collection.
public sealed class KernelTelemetryCollector : IKernelTelemetryProvider, IDisposable
- Inheritance
-
KernelTelemetryCollector
- Implements
- Inherited Members
- Extension Methods
Remarks
Uses lock-free concurrent data structures for minimal contention during high-throughput kernel execution. Maintains per-kernel metrics with automatic aggregation and statistical analysis.
Constructors
KernelTelemetryCollector(ILogger<KernelTelemetryCollector>)
Initializes a new instance of the KernelTelemetryCollector class.
public KernelTelemetryCollector(ILogger<KernelTelemetryCollector> logger)
Parameters
loggerILogger<KernelTelemetryCollector>Logger instance for diagnostic output.
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
GetAggregatedMetrics()
Gets aggregated metrics for all kernels.
public TelemetryMetrics GetAggregatedMetrics()
Returns
- TelemetryMetrics
Aggregated telemetry metrics across all kernels.
GetMetrics(string)
Gets the current metrics for a specific kernel.
public TelemetryMetrics GetMetrics(string kernelId)
Parameters
kernelIdstringUnique identifier for the kernel instance.
Returns
- TelemetryMetrics
Current telemetry metrics for the kernel.
RecordExecutionEnd(string, long, bool)
Records the completion of a kernel execution.
public void RecordExecutionEnd(string kernelId, long timestamp, bool success)
Parameters
kernelIdstringUnique identifier for the kernel instance.
timestamplongHigh-precision timestamp when execution completed.
successboolTrue if execution succeeded, false if it failed.
RecordExecutionStart(string, long)
Records the start of a kernel execution.
public void RecordExecutionStart(string kernelId, long timestamp)
Parameters
kernelIdstringUnique identifier for the kernel instance.
timestamplongHigh-precision timestamp when execution started.
RecordMemoryAllocation(string, long)
Records memory allocation for a kernel.
public void RecordMemoryAllocation(string kernelId, long bytes)
Parameters
RecordMemoryDeallocation(string, long)
Records memory deallocation for a kernel.
public void RecordMemoryDeallocation(string kernelId, long bytes)
Parameters
RecordMessageProcessed(string, int)
Records a message processed by a Ring Kernel.
public void RecordMessageProcessed(string kernelId, int messageSize)
Parameters
kernelIdstringUnique identifier for the kernel instance.
messageSizeintSize of the message in bytes.
ResetAllMetrics()
Resets all telemetry data for all kernels.
public void ResetAllMetrics()
ResetMetrics(string)
Resets all telemetry data for a specific kernel.
public void ResetMetrics(string kernelId)
Parameters
kernelIdstringUnique identifier for the kernel instance.