diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.Telemetry/TelemetryPublisherConfiguration.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Telemetry/TelemetryPublisherConfiguration.cs | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/Software/Visual_Studio/Tango.Telemetry/TelemetryPublisherConfiguration.cs b/Software/Visual_Studio/Tango.Telemetry/TelemetryPublisherConfiguration.cs index da5856848..424249f7d 100644 --- a/Software/Visual_Studio/Tango.Telemetry/TelemetryPublisherConfiguration.cs +++ b/Software/Visual_Studio/Tango.Telemetry/TelemetryPublisherConfiguration.cs @@ -12,16 +12,17 @@ namespace Tango.Telemetry public String MachineID { get; set; } public MachineTypes MachineType { get; set; } public String Environment { get; set; } - public TimeSpan DiagnosticsSamplingInterval { get; set; } public TimeSpan PendingStorageCheckInterval { get; set; } - public List<ITelemetryDestination> TelemetryDestinations { get; private set; } + public int MaxPendingStorageTelemetriesPerCycle { get; set; } + public TimeSpan HistoryModulesRequestInterval { get; set; } + public int MaxPendingTelemetries { get; set; } public TelemetryPublisherConfiguration() { - TelemetryDestinations = new List<ITelemetryDestination>(); - - DiagnosticsSamplingInterval = TimeSpan.FromSeconds(10); PendingStorageCheckInterval = TimeSpan.FromMinutes(1); + MaxPendingStorageTelemetriesPerCycle = 100; + HistoryModulesRequestInterval = TimeSpan.FromMinutes(1); + MaxPendingTelemetries = 200; } public void Validate() @@ -35,23 +36,8 @@ namespace Tango.Telemetry if (!Enum.IsDefined(typeof(MachineTypes), MachineType)) throw new ArgumentOutOfRangeException(nameof(MachineType), "MachineType is not a valid enum value."); - if (DiagnosticsSamplingInterval.TotalSeconds < 1) - throw new ArgumentOutOfRangeException(nameof(DiagnosticsSamplingInterval), "DiagnosticsSamplingInterval must be at least 1 second."); - if (PendingStorageCheckInterval.TotalSeconds < 5) throw new ArgumentOutOfRangeException(nameof(PendingStorageCheckInterval), "PendingStorageCheckInterval must be at least 5 seconds."); - - if (TelemetryDestinations == null || TelemetryDestinations.Count == 0) - throw new InvalidOperationException("At least one telemetry destination must be provided."); - - foreach (var destination in TelemetryDestinations) - { - if (destination == null) - throw new InvalidOperationException("Telemetry destination list contains a null entry."); - - if (destination.SupportedSources == null || destination.SupportedSources.Count == 0) - throw new InvalidOperationException($"Telemetry destination '{destination.Name}' has no supported sources defined."); - } } } } |
