Expand XML docs across bridge and test code
This commit is contained in:
@@ -5,8 +5,14 @@ using ZB.MOM.WW.LmxOpcUa.Host.Metrics;
|
||||
|
||||
namespace ZB.MOM.WW.LmxOpcUa.Tests.Metrics
|
||||
{
|
||||
/// <summary>
|
||||
/// Verifies operation timing aggregation, rolling buffers, and success tracking used by the bridge metrics subsystem.
|
||||
/// </summary>
|
||||
public class PerformanceMetricsTests
|
||||
{
|
||||
/// <summary>
|
||||
/// Confirms that a fresh metrics collector reports no statistics.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void EmptyState_ReturnsZeroStatistics()
|
||||
{
|
||||
@@ -15,6 +21,9 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Metrics
|
||||
stats.ShouldBeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that repeated operation recordings update total and successful execution counts.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void RecordOperation_TracksCounts()
|
||||
{
|
||||
@@ -29,6 +38,9 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Metrics
|
||||
stats["Read"].SuccessRate.ShouldBe(0.5);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that min, max, and average timing values are calculated from recorded operations.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void RecordOperation_TracksMinMaxAverage()
|
||||
{
|
||||
@@ -43,6 +55,9 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Metrics
|
||||
stats.AverageMilliseconds.ShouldBe(20);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that the 95th percentile is calculated from the recorded timing sample.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void P95_CalculatedCorrectly()
|
||||
{
|
||||
@@ -54,6 +69,9 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Metrics
|
||||
stats.Percentile95Milliseconds.ShouldBe(95);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that the rolling buffer keeps the most recent operation durations for percentile calculations.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void RollingBuffer_EvictsOldEntries()
|
||||
{
|
||||
@@ -67,6 +85,9 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Metrics
|
||||
stats.Percentile95Milliseconds.ShouldBeGreaterThan(1000);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that a timing scope records an operation when disposed.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void BeginOperation_TimingScopeRecordsOnDispose()
|
||||
{
|
||||
@@ -85,6 +106,9 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Metrics
|
||||
stats["Test"].AverageMilliseconds.ShouldBeGreaterThan(0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that a timing scope can mark an operation as failed before disposal.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void BeginOperation_SetSuccessFalse()
|
||||
{
|
||||
@@ -100,6 +124,9 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Metrics
|
||||
stats.SuccessCount.ShouldBe(0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that looking up an unknown operation returns no metrics bucket.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GetMetrics_UnknownOperation_ReturnsNull()
|
||||
{
|
||||
@@ -107,6 +134,9 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Metrics
|
||||
metrics.GetMetrics("NonExistent").ShouldBeNull();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that operation names are tracked without case sensitivity.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void OperationNames_AreCaseInsensitive()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user