Interface ITrendStore
Represents a store that persists trend metrics.
public interface ITrendStore
- Extension Methods
Remarks
A ITrendStore object can be obtained with the extension method ExtensionMethodsTrend.GetTrendStoreFromDirectory(IAbsoluteDirectoryPath) applied on the directory path returned by IProjectTrend.TrendStoreDirectory.
Methods (6)
GetDateOfMostRecentSave()
Returns the date of the most recently saved data in this store.
DateTime? GetDateOfMostRecentSave()
Returns
- DateTime?
null if no save occurred in this store.
Exceptions
- TrendStoreException
An error occurred while reading trend store.
GetYearsContainingValuesDescending()
Returns years for which trend metrics values are available in this store.
IEnumerable<uint> GetYearsContainingValuesDescending()
Returns
Load(IEnumerable<uint>)
Returns the complete history data for years in input.
IHistoryData Load(IEnumerable<uint> years)
Parameters
yearsIEnumerable<uint>The years for which you want to obtain trend metrics values.
Returns
Exceptions
- ArgumentException
yearscontains one or several years for which trend metrics values are not available, or contains doublons.
Use the method GetYearsContainingValuesDescending() to years for which trend metrics values are available.- TrendStoreException
An error occurred while reading trend store.
RemoveMetricValues(DateTime)
Remove all metrics values stored at date.
void RemoveMetricValues(DateTime date)
Parameters
dateDateTimeThe date of the metric values to remove.
Remarks
The date equality is defined by the same dated second, no matter the number of miliseconds.
Exceptions
- TrendStoreException
There is no metric values stored for
dateor an error occurred while persisting in the trend store.
SaveMetricValues(DateTime, IEnumerable<MetricValue>)
Save one or several dated metrics values.
void SaveMetricValues(DateTime date, IEnumerable<MetricValue> metricsValues)
Parameters
dateDateTimeThe date of the metric values to save.
metricsValuesIEnumerable<MetricValue>The metric values to save.
Remarks
If for one or several metrics in metricsValues, values defined at date already exist, they are overridden by the new values.
The date equality is defined if the two dates represent the same dated second, no matter the number of miliseconds.
Exceptions
- ArgumentException
metricsValuescontains some metrics with the same name.- TrendStoreException
An error occurred while persisting in the trend store.
SaveMetricValues(DateTime, IEnumerable<MetricValue>, string)
Save one or several dated metrics values, tagged with a label.
void SaveMetricValues(DateTime date, IEnumerable<MetricValue> metricsValues, string label)
Parameters
dateDateTimeThe date of the metric values to save.
metricsValuesIEnumerable<MetricValue>The metric values to save.
labelstringAn optional label applied to this particular date.
Typically, the label represents the version of the product.
An empty string means that there is no label to store for
Remarks
If for one or several metrics in metricsValues, values defined at date already exist, they are overridden by the new values.
The date equality is defined if the two dates represent the same dated second, no matter the number of miliseconds.
Exceptions
- ArgumentException
metricsValuescontains some metrics with the same name.- TrendStoreException
An error occurred while persisting in the trend store.