refactor(kpi): K2/K6/K7 review fixups — empty-batch guard + sealed repo + uniform TryAddEnumerable + KPI-age doc fidelity + coverage
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Kpi;
|
||||
using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Delivery;
|
||||
using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Kpi;
|
||||
@@ -50,7 +51,9 @@ public static class ServiceCollectionExtensions
|
||||
|
||||
// KPI history (M6): the recorder singleton enumerates every IKpiSampleSource each
|
||||
// sampling pass to snapshot the outbox delivery KPIs into the central history store.
|
||||
services.AddScoped<IKpiSampleSource, NotificationOutboxKpiSampleSource>();
|
||||
// TryAddEnumerable is idempotent — no double-registration if AddNotificationOutbox
|
||||
// is ever called more than once, matching the AuditLog (K8) idiom.
|
||||
services.TryAddEnumerable(ServiceDescriptor.Scoped<IKpiSampleSource, NotificationOutboxKpiSampleSource>());
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user