public AnomalyFeedbackValue(AnomalyValue anomalyValue)
 {
     AnomalyValue = anomalyValue;
 }
Beispiel #2
0
        /// <summary> Initializes a new instance of <see cref="MetricAnomalyFeedback"/>. </summary>
        /// <param name="metricId"> The metric unique id. </param>
        /// <param name="dimensionFilter"> The dimension filter. </param>
        /// <param name="startTime"> The start timestamp of feedback timerange. </param>
        /// <param name="endTime"> The end timestamp of feedback timerange. When this is equal to <paramref name="startTime"/> it indicates a single timestamp. </param>
        /// <param name="value"> The <see cref="Models.AnomalyValue"/> for the feedback. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="dimensionFilter"/> or <paramref name="value"/> is null. </exception>
        public MetricAnomalyFeedback(string metricId, FeedbackDimensionFilter dimensionFilter, DateTimeOffset startTime, DateTimeOffset endTime, AnomalyValue value) : base(metricId, dimensionFilter)
        {
            if (value == default)
            {
                throw new ArgumentNullException(nameof(value));
            }

            DimensionFilter = dimensionFilter;
            StartTime       = startTime;
            EndTime         = endTime;
            ValueInternal   = new AnomalyFeedbackValue(value);
            Type            = FeedbackType.Anomaly;
        }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MetricAnomalyFeedback"/> class.
 /// </summary>
 /// <param name="metricId">The identifier of the metric to which the <see cref="MetricAnomalyFeedback"/> applies.</param>
 /// <param name="dimensionKey">
 /// A key that identifies a set of time series to which the <see cref="MetricAnomalyFeedback"/> applies.
 /// If all possible dimensions are set, this key uniquely identifies a single time series
 /// for the specified <paramref name="metricId"/>. If only a subset of dimensions are set, this
 /// key uniquely identifies a group of time series.
 /// </param>
 /// <param name="startsOn">The start timestamp of feedback time range.</param>
 /// <param name="endsOn">The end timestamp of feedback time range. When this is equal to <paramref name="startsOn"/> it indicates a single timestamp.</param>
 /// <param name="value">Indicates whether or not the data points should have been labeled as anomalies by the service.</param>
 /// <exception cref="ArgumentNullException"><paramref name="metricId"/> or <paramref name="dimensionKey"/> is <c>null</c>.</exception>
 /// <exception cref="ArgumentException"><paramref name="metricId"/> is empty.</exception>
 public MetricAnomalyFeedback(string metricId, DimensionKey dimensionKey, DateTimeOffset startsOn, DateTimeOffset endsOn, AnomalyValue value)
     : base(metricId, dimensionKey)
 {
     StartsOn      = startsOn;
     EndsOn        = endsOn;
     ValueInternal = new AnomalyFeedbackValue(value);
     FeedbackKind  = MetricFeedbackKind.Anomaly;
 }
 public static AnomalyState AnomalyState(DateTimeOffset timestamp = default, AnomalyValue value = default, IReadOnlyList <ErrorResponse> errors = default)
 {
     errors ??= new List <ErrorResponse>();
     return(new AnomalyState(timestamp, value, errors));
 }