aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common/Telemetry/TelemetrySettings.cs
blob: 7acf7e197b4a6ce07ce06483d089b753e282a010 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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=";

        /// <summary>
        /// Interval for checking and reprocessing failed/pending telemetry from local storage.
        /// </summary>
        public TimeSpan PendingStorageCheckInterval { get; set; } = TimeSpan.FromMinutes(1);

        /// <summary>
        /// Frequency at which historical sources are polled to request backlogged or missed telemetry.
        /// </summary>
        public TimeSpan HistorySourcesRequestInterval { get; set; } = TimeSpan.FromMinutes(1);

        /// <summary>
        /// Whether exponential backoff should be applied to retry logic per destination.
        /// </summary>
        public bool EnableBackoff { get; set; } = false;

        /// <summary>
        /// The maximum amount of time to delay retries during exponential backoff.
        /// </summary>
        public TimeSpan MaxExponentialBackoff { get; set; } = TimeSpan.FromHours(1);

        /// <summary>
        /// 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.
        /// </summary>
        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<LogCategory> LogCategories { get; set; } = new HashSet<LogCategory>() { LogCategory.Critical, LogCategory.Error, LogCategory.Warning };
    }
}