Table of Contents

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

logger ILogger<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

kernelId string

Unique 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

kernelId string

Unique identifier for the kernel instance.

timestamp long

High-precision timestamp when execution completed.

success bool

True 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

kernelId string

Unique identifier for the kernel instance.

timestamp long

High-precision timestamp when execution started.

RecordMemoryAllocation(string, long)

Records memory allocation for a kernel.

public void RecordMemoryAllocation(string kernelId, long bytes)

Parameters

kernelId string

Unique identifier for the kernel instance.

bytes long

Number of bytes allocated.

RecordMemoryDeallocation(string, long)

Records memory deallocation for a kernel.

public void RecordMemoryDeallocation(string kernelId, long bytes)

Parameters

kernelId string

Unique identifier for the kernel instance.

bytes long

Number of bytes deallocated.

RecordMessageProcessed(string, int)

Records a message processed by a Ring Kernel.

public void RecordMessageProcessed(string kernelId, int messageSize)

Parameters

kernelId string

Unique identifier for the kernel instance.

messageSize int

Size 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

kernelId string

Unique identifier for the kernel instance.