From a1d55aa060450b0a16b597794686b2aa41eea259 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sat, 30 Aug 2025 22:05:03 +0300 Subject: PPC Telemetry First Integration. --- .../Telemetry/TelemetrySettings.cs | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/Telemetry/TelemetrySettings.cs (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/Telemetry/TelemetrySettings.cs') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Telemetry/TelemetrySettings.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Telemetry/TelemetrySettings.cs new file mode 100644 index 000000000..7acf7e197 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Telemetry/TelemetrySettings.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Logging; +using Tango.Settings; + +namespace Tango.PPC.Common.Telemetry +{ + public class TelemetrySettings : SettingsBase + { + public bool Enable { get; set; } = true; + + public bool EnableIoTHub { get; set; } = true; + public bool EnableMqtt { get; set; } = false; + + public String IoTHubConnectionString { get; set; } = "HostName=iot-twine-dev-weu.azure-devices.net;DeviceId=telemetry-dev-01;SharedAccessKey=cZhCMhiVL+TF7p13fpX+lFmyxoy8ZqCkbxUwumWw18Q="; + + /// + /// Interval for checking and reprocessing failed/pending telemetry from local storage. + /// + public TimeSpan PendingStorageCheckInterval { get; set; } = TimeSpan.FromMinutes(1); + + /// + /// Frequency at which historical sources are polled to request backlogged or missed telemetry. + /// + public TimeSpan HistorySourcesRequestInterval { get; set; } = TimeSpan.FromMinutes(1); + + /// + /// Whether exponential backoff should be applied to retry logic per destination. + /// + public bool EnableBackoff { get; set; } = false; + + /// + /// The maximum amount of time to delay retries during exponential backoff. + /// + public TimeSpan MaxExponentialBackoff { get; set; } = TimeSpan.FromHours(1); + + /// + /// Gets or sets the interval at which the published telemetry cache cleanup process should occur. + /// This defines how frequently old published telemetry entries are eligible for pruning, + /// based on their publication timestamp. + /// + public TimeSpan PublishedTelemetriesCacheCleanupInterval { get; set; } = TimeSpan.FromHours(1); + + public bool SendDiagnostics { get; set; } = true; + public TimeSpan DiagnosticsSamplingInterval { get; set; } = TimeSpan.FromSeconds(60); + public bool SendEvents { get; set; } = true; + public bool SendJobRuns { get; set; } = true; + public bool SendJobRunsHistory { get; set; } = true; + public bool SendJobStatus { get; set; } = true; + public bool SendLogs { get; set; } = true; + public bool SendMachineStatus { get; set; } = true; + public bool SendMachineUpdates { get; set; } = true; + public bool SendMachineUpdatesHistory { get; set; } = true; + public bool SendWires { get; set; } = true; + + public HashSet LogCategories { get; set; } = new HashSet() { LogCategory.Critical, LogCategory.Error, LogCategory.Warning }; + } +} -- cgit v1.3.1