public TelemetryCollection(TelemetryIdentifiers telemetryIdentifiers, int dailyNumTelPushes) { this.DailyNumberOfTelemetryPushes = dailyNumTelPushes; this.telemetryAggregationCollection = new Dictionary <TraceAggregationKey, TraceAggregator>(); this.TelemetryIds = telemetryIdentifiers; this.Clear(); }
// tries to read the persisted serialization. If fails returns a new instance (empty) public static TelemetryCollection LoadOrCreateTelemetryCollection(string filePath, TelemetryIdentifiers telemetryIdentifier, int dailyNumberOfTelemetryPushes, out bool telCollectionloadedFromDisk, LogErrorDelegate logErrorDelegate) { TelemetryCollection telemetryCollection = TelemetryCollection.LoadTelemetryCollection(filePath, logErrorDelegate); // if loaded from file and configuration on the push rate not changed add telemetryIdentifier, otherwise create a new one if (telemetryCollection != null && telemetryCollection.DailyNumberOfTelemetryPushes == dailyNumberOfTelemetryPushes) { telemetryCollection.TelemetryIds = telemetryIdentifier; telCollectionloadedFromDisk = true; } else { telemetryCollection = new TelemetryCollection(telemetryIdentifier, dailyNumberOfTelemetryPushes); telCollectionloadedFromDisk = false; } return(telemetryCollection); }