-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
MetricsQueryResourcesOptions.cs
76 lines (68 loc) · 3.38 KB
/
MetricsQueryResourcesOptions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using Azure.Core;
using Azure.Monitor.Query.Models;
namespace Azure.Monitor.Query
{
/// <summary>
/// Options for the <see cref="MetricsClient.QueryResourcesAsync"/> and <see cref="MetricsClient.QueryResources"/> methods.
/// </summary>
public class MetricsQueryResourcesOptions
{
/// <summary>
/// Gets or sets the timespan over which the metric will be queried.
/// </summary>
[CodeGenMember("TimeSpan")]
public QueryTimeRange? TimeRange { get; set; }
/// <summary>
/// <para>
/// Gets the list of metric aggregations to retrieve.
/// </para>
/// <para>
/// Although this collection cannot be set, it can be modified.
/// See <see href="https://learn.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/object-and-collection-initializers#object-initializers-with-collection-read-only-property-initialization">Object initializers with collection read-only property initialization</see>.
/// </para>
/// </summary>
public IList<string> Aggregations { get; } = new List<string>();
/// <summary>
/// Gets or sets the maximum number of records to retrieve. Valid only when <see cref="Filter"/> is specified. Defaults to <c>null</c>.
/// </summary>
[CodeGenMember("Top")]
public int? Size { get; set; }
/// <summary>
/// Gets or sets the filter that is used to refine the set of metric data returned.
/// <example>
/// <see cref="MetricResult"/> contains metadata A, B, and C.<br/>
/// <br/>
/// - Return all time series of C where A = a1 and B = b1 or b2:<br/>
/// <c>A eq 'a1' and B eq 'b1' or B eq 'b2' and C eq '*'</c><br/>
/// - Invalid variant:<br/>
/// <c>A eq 'a1' and B eq 'b1' and C eq '*' or B = 'b2'</c><br/>
/// This is invalid because the logical or operator cannot separate two different metadata names.<br/>
/// - Return all time series where A = a1, B = b1 and C = c1:<br/>
/// <c>A eq 'a1' and B eq 'b1' and C eq 'c1'</c><br/>
/// - Return all time series where A = a1<br/>
/// <c>A eq 'a1' and B eq '*' and C eq '*'.</c><br/>
/// </example>
/// </summary>
public string Filter { get; set; }
/// <summary>
/// Gets or sets the aggregation to use for sorting results and the direction of the sort.
/// Only one order can be specified.
/// Examples: sum asc.
/// </summary>
public string OrderBy { get; set; }
/// <summary>
/// Dimension name(s) to rollup results by.
/// Examples: If you only want to see metric values with a filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries.
/// </summary>
public IList<string> RollUpBy { get; } = new List<string>();
/// <summary>
/// Gets or sets the interval at which to sample metrics.
/// </summary>
[CodeGenMember("Interval")]
public TimeSpan? Granularity { get; set; }
}
}