-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MetricsAdvisor] Updated DimensionKey implementation #21972
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using Azure.Core; | ||
|
||
namespace Azure.AI.MetricsAdvisor.Models | ||
|
@@ -16,16 +17,20 @@ public partial class MetricSeriesGroupDetectionCondition : MetricWholeSeriesDete | |
/// <summary> | ||
/// Initializes a new instance of the <see cref="MetricSeriesGroupDetectionCondition"/> class. | ||
/// </summary> | ||
public MetricSeriesGroupDetectionCondition() | ||
/// <param name="seriesGroupKey">The key that identifies the group of time series to which these conditions apply within a metric. A subset of the possible dimensions of the associated data feed must be set.</param> | ||
/// <exception cref="ArgumentNullException"><paramref name="seriesGroupKey"/> is <c>null</c>.</exception> | ||
public MetricSeriesGroupDetectionCondition(DimensionKey seriesGroupKey) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: do you have tests to check that we correctly assert when null? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't, but I think it's common to not add constructor assertion tests to every single model, right? We don't do it in FR either. Let me know if you think otherwise. |
||
{ | ||
SeriesGroupKey = new DimensionKey(); | ||
Argument.AssertNotNull(seriesGroupKey, nameof(seriesGroupKey)); | ||
|
||
SeriesGroupKey = seriesGroupKey; | ||
} | ||
|
||
/// <summary> | ||
/// The key that identifies the group of time series to which these conditions apply within a metric. | ||
/// A subset of the possible dimensions of the associated data feed must be set. | ||
/// </summary> | ||
[CodeGenMember("Group")] | ||
public DimensionKey SeriesGroupKey { get; } | ||
public DimensionKey SeriesGroupKey { get; set; } | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it is worth showing this in any sample? or the use of the
TryGetValue
? The names and docstrings are clear enough that I don't think it is needed, but asking just in caseThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To tell you the truth, I don't think these methods will be used that much. In general, customers will need to go through every element anyway, so they'll use the enumerator (kudos to KC who suggested making it an IEnumerable). I added these methods just in case someone wants to check a specific element without going through the whole set.