Skip to content

Commit

Permalink
Monitor Query XML docs edits (#22354)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottaddie authored Jul 1, 2021
1 parent 12a3d7f commit cbf6252
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 37 deletions.
16 changes: 8 additions & 8 deletions sdk/monitor/Azure.Monitor.Query/src/LogsQueryClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ protected LogsQueryClient()
/// </summary>
/// <param name="workspaceId">The workspace id to include in the query (<c>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</c>).</param>
/// <param name="query">The query text to execute.</param>
/// <param name="timeRange">The timespan over which to query data. Logs would be filtered to include entries produced starting at <c>Now - timeSpan</c>. </param>
/// <param name="timeRange">The timespan over which to query data. Logs will be filtered to include entries produced starting at <c>Now - timeSpan</c>. </param>
/// <param name="options">The <see cref="LogsQueryOptions"/> to configure the query.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to use.</param>
/// <returns>Query results mapped to a type <typeparamref name="T"/>.</returns>
Expand Down Expand Up @@ -131,7 +131,7 @@ public virtual Response<IReadOnlyList<T>> Query<T>(string workspaceId, string qu
/// </summary>
/// <param name="workspaceId">The workspace id to include in the query (<c>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</c>).</param>
/// <param name="query">The query text to execute.</param>
/// <param name="timeRange">The timespan over which to query data. Logs would be filtered to include entries produced starting at <c>Now - timeSpan</c>. </param>
/// <param name="timeRange">The timespan over which to query data. Logs will be filtered to include entries produced starting at <c>Now - timeSpan</c>. </param>
/// <param name="options">The <see cref="LogsQueryOptions"/> to configure the query.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to use.</param>
/// <returns>Query results mapped to a type <typeparamref name="T"/>.</returns>
Expand All @@ -147,7 +147,7 @@ public virtual async Task<Response<IReadOnlyList<T>>> QueryAsync<T>(string works
/// </summary>
/// <param name="workspaceId">The workspace id to include in the query (<c>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</c>).</param>
/// <param name="query">The query text to execute.</param>
/// <param name="timeRange">The timespan over which to query data. Logs would be filtered to include entries produced starting at <c>Now - timeSpan</c>. </param>
/// <param name="timeRange">The timespan over which to query data. Logs will be filtered to include entries produced starting at <c>Now - timeSpan</c>. </param>
/// <param name="options">The <see cref="LogsQueryOptions"/> to configure the query.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to use.</param>
/// <returns>The <see cref="LogsQueryResult"/> containing the query results.</returns>
Expand All @@ -171,7 +171,7 @@ public virtual Response<LogsQueryResult> Query(string workspaceId, string query,
/// </summary>
/// <param name="workspaceId">The workspace id to include in the query (<c>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</c>).</param>
/// <param name="query">The query text to execute.</param>
/// <param name="timeRange">The timespan over which to query data. Logs would be filtered to include entries produced starting at <c>Now - timeSpan</c>. </param>
/// <param name="timeRange">The timespan over which to query data. Logs will be filtered to include entries produced starting at <c>Now - timeSpan</c>. </param>
/// <param name="options">The <see cref="LogsQueryOptions"/> to configure the query.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to use.</param>
/// <returns>The <see cref="LogsQueryResult"/> with the query results.</returns>
Expand Down Expand Up @@ -299,7 +299,7 @@ public virtual async Task<Response<LogsBatchQueryResults>> QueryBatchAsync(LogsB
}

/// <summary>
/// Create a Kusto query from an interpolated string. The interpolated values will be quoted and escaped as necessary.
/// Create a Kusto query from an interpolated string. The interpolated values will be quoted and escaped as necessary.
/// </summary>
/// <param name="filter">An interpolated query string.</param>
/// <returns>A valid Kusto query.</returns>
Expand All @@ -314,8 +314,8 @@ public static string CreateQuery(FormattableString filter)
{
// Null
null => throw new ArgumentException(
$"Unable to convert argument {i} to an Kusto literal. " +
$"Unable to format an untyped null value, please use typed-null expression " +
$"Unable to convert argument {i} to a Kusto literal. " +
$"Unable to format an untyped null value. Please use typed-null expression " +
$"(bool(null), datetime(null), dynamic(null), guid(null), int(null), long(null), real(null), double(null), time(null))"),

// Boolean
Expand Down Expand Up @@ -353,7 +353,7 @@ public static string CreateQuery(FormattableString filter)

// Everything else
object x => throw new ArgumentException(
$"Unable to convert argument {i} from type {x.GetType()} to an Kusto literal.")
$"Unable to convert argument {i} from type {x.GetType()} to a Kusto literal.")
};
}

Expand Down
4 changes: 2 additions & 2 deletions sdk/monitor/Azure.Monitor.Query/src/LogsQueryClientOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public enum ServiceVersion
}

/// <summary>
/// Gets or sets the authentication scope to use for authentication with Azure Active Directory. The default scope would be used if the property is null.
/// Gets or sets the authentication scope to use for authentication with Azure Active Directory. The default scope will be used if the property is null.
/// </summary>
public string AuthenticationScope { get; set; }

Expand All @@ -58,4 +58,4 @@ internal string GetVersionString()
};
}
}
}
}
2 changes: 1 addition & 1 deletion sdk/monitor/Azure.Monitor.Query/src/MetricsQueryClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace Azure.Monitor.Query
{
/// <summary>
/// The <see cref="LogsQueryClient"/> allows to query the Azure Monitor Metrics service.
/// The <see cref="MetricsQueryClient"/> allows you to query the Azure Monitor Metrics service.
/// </summary>
public class MetricsQueryClient
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Collections;
using Azure.Core;

namespace Azure.Monitor.Query
Expand Down Expand Up @@ -44,4 +43,4 @@ public enum ServiceVersion
#pragma warning restore CA1707 // Identifiers should not contain underscores
}
}
}
}
4 changes: 2 additions & 2 deletions sdk/monitor/Azure.Monitor.Query/src/MetricsQueryOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ namespace Azure.Monitor.Query
public class MetricsQueryOptions
{
/// <summary>
/// Gets or sets the time span over which the metric would be queried.
/// Gets or sets the timespan over which the metric will be queried.
/// </summary>
public DateTimeRange? TimeSpan { get; set; }

/// <summary>
/// Gets ot sets the interval to sample metrics at.
/// Gets or sets the interval at which to sample metrics.
/// </summary>
public TimeSpan? Interval { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace Azure.Monitor.Query
{
/// <summary>
/// Represents a batch that consists out of multiple log queries.
/// Represents a batch that consists of multiple log queries.
/// </summary>
public class LogsBatchQuery
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public partial class LogsBatchQueryResults
/// <param name="queryId">The query identifier returned from the <see cref="LogsBatchQuery.AddQuery"/>.</param>
/// <returns>The <see cref="LogsBatchQueryResults"/> with the query results.</returns>
/// <exception cref="ArgumentException">When the query with <paramref name="queryId"/> was not part of the batch.</exception>
/// <exception cref="RequestFailedException">When the query <paramref name="queryId"/> failed.</exception>
/// <exception cref="RequestFailedException">When the query <paramref name="queryId"/> failed.</exception>
public LogsQueryResult GetResult(string queryId)
{
BatchQueryResponse result = Responses.SingleOrDefault(r => r.Id == queryId);
Expand Down
4 changes: 1 addition & 3 deletions sdk/monitor/Azure.Monitor.Query/src/Models/LogsColumnType.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Azure.Core;

namespace Azure.Monitor.Query.Models
{
public partial struct LogsColumnType
Expand All @@ -19,4 +17,4 @@ public partial struct LogsColumnType
internal const string BoolTypeValue = "bool";
internal const string DynamicValueTypeValue = "dynamic";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ internal LogsQueryResultRow(Dictionary<string, int> columnMap, IReadOnlyList<Log
public BinaryData GetDynamic(int index) => new BinaryData(_row[index].GetString());

/// <summary>
/// Returns true if the value of the column at the specified index is null, otherwise false.
/// Returns <c>true</c> if the value of the column at the specified index is <c>null</c>, otherwise <c>false</c>.
/// </summary>
/// <param name="index">The column index.</param>
/// <returns>True if the value is null, otherwise false.</returns>
/// <returns><c>true</c> if the value is <c>null</c>, otherwise <c>false</c>.</returns>
public bool IsNull(int index) => _row[index].ValueKind == JsonValueKind.Null;

/// <summary>
Expand Down Expand Up @@ -181,7 +181,7 @@ internal LogsQueryResultRow(Dictionary<string, int> columnMap, IReadOnlyList<Log
/// Returns true if the value of the column with the specified name is null, otherwise false.
/// </summary>
/// <param name="name">The column name.</param>
/// <returns>True if the value is null, otherwise false.</returns>
/// <returns><c>true</c> if the value is <c>null</c>, otherwise <c>false</c>.</returns>
public bool IsNull(string name) => IsNull(_columnMap[name]);

/// <summary>
Expand Down Expand Up @@ -278,4 +278,4 @@ public override string ToString()
return _row.ToString();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ public partial class LogsQueryResult
public LogsQueryResultTable PrimaryTable => Tables.Single(t => t.Name == "PrimaryResult");

/// <summary>
/// Returns the query statistics if the <see cref="LogsQueryOptions.IncludeStatistics"/> is set to <c>true</c>. Null otherwise.
/// Returns the query statistics if the <see cref="LogsQueryOptions.IncludeStatistics"/> is set to <c>true</c>. <c>null</c> otherwise.
/// </summary>
public BinaryData GetStatistics() => _statistics.ValueKind == JsonValueKind.Undefined ? null : new BinaryData(_statistics.ToString());

/// <summary>
/// Returns the query visualization if the <see cref="LogsQueryOptions.IncludeVisualization"/> is set to <c>true</c>. Null otherwise.
/// Returns the query visualization if the <see cref="LogsQueryOptions.IncludeVisualization"/> is set to <c>true</c>. <c>null</c> otherwise.
/// </summary>
public BinaryData GetVisualization() => _visualization.ValueKind == JsonValueKind.Undefined ? null : new BinaryData(_visualization.ToString());

/// <summary>
/// Get's the error that occured during query processing. The value would be <c>null</c> if the query succeeds.
/// Gets the error that occurred during query processing. The value is <c>null</c> if the query succeeds.
/// </summary>
public ResponseError Error => _error.ValueKind == JsonValueKind.Undefined ? null : JsonSerializer.Deserialize<ResponseError>(_error.GetRawText());
}
}
}
6 changes: 3 additions & 3 deletions sdk/monitor/Azure.Monitor.Query/src/Models/Metric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ public partial class Metric
/// <summary> The name of the metric. </summary>
public string Name => LocalizedName.Value;

/// <summary> the time series returned when a data query is performed. </summary>
/// <summary> The time series returned when a data query is performed. </summary>
[CodeGenMember("Timeseries")]
public IReadOnlyList<TimeSeriesElement> TimeSeries { get; }

/// <summary>
/// Gets the error that occured while querying the metric.
/// Gets the error that occurred while querying the metric.
/// </summary>
public ResponseError Error => ErrorCode == SuccessErrorCode ? null : new ResponseError(ErrorCode, ErrorMessage, null, null, null);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Azure.Monitor.Query.Models
{
/// <summary> the aggregation type of the metric. </summary>
/// <summary> The aggregation type of the metric. </summary>
[CodeGenModel("AggregationType")]
public enum MetricAggregationType
{
Expand All @@ -22,4 +22,4 @@ public enum MetricAggregationType
/// <summary> Total. </summary>
Total
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public partial class MetricQueryResult
/// </summary>
public DateTimeRange TimeSpan => DateTimeRange.Parse(_timespan);

/// <summary> The region of the resource been queried for metrics. </summary>
/// <summary> The region of the resource being queried for metrics. </summary>
[CodeGenMember("Resourceregion")]
public string ResourceRegion { get; }
}
}
}
4 changes: 2 additions & 2 deletions sdk/monitor/Azure.Monitor.Query/src/Models/MetricUnit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

namespace Azure.Monitor.Query.Models
{
/// <summary> the unit of the metric. </summary>
/// <summary> The unit of the metric. </summary>
[CodeGenModel("Unit")]
public partial struct MetricUnit
{
}
}
}

0 comments on commit cbf6252

Please sign in to comment.