| | | 1 | | using Microsoft.Azure.ApplicationInsights.Query.Models; |
| | | 2 | | using System.Collections.Generic; |
| | | 3 | | using System.Threading; |
| | | 4 | | using System.Threading.Tasks; |
| | | 5 | | |
| | | 6 | | namespace Microsoft.Azure.ApplicationInsights.Query |
| | | 7 | | { |
| | | 8 | | public partial class MetricsExtensions |
| | | 9 | | { |
| | | 10 | | |
| | | 11 | | #region Metric Extensions |
| | | 12 | | |
| | | 13 | | /// <summary> |
| | | 14 | | /// Retrieve summary metric data |
| | | 15 | | /// </summary> |
| | | 16 | | /// <remarks> |
| | | 17 | | /// Gets summary metric values for a single metric |
| | | 18 | | /// </remarks> |
| | | 19 | | /// <param name='operations'> |
| | | 20 | | /// The operations group for this extension method. |
| | | 21 | | /// </param> |
| | | 22 | | /// <param name='appId'> |
| | | 23 | | /// ID of the application. This is Application ID from the API Access settings |
| | | 24 | | /// blade in the Azure portal. |
| | | 25 | | /// </param> |
| | | 26 | | /// <param name='metricId'> |
| | | 27 | | /// ID of the metric. This is either a standard AI metric, or an |
| | | 28 | | /// application-specific custom metric. Possible values include: |
| | | 29 | | /// 'requests/count', 'requests/duration', 'requests/failed', |
| | | 30 | | /// 'users/count', 'users/authenticated', 'pageViews/count', |
| | | 31 | | /// 'pageViews/duration', 'client/processingDuration', |
| | | 32 | | /// 'client/receiveDuration', 'client/networkDuration', |
| | | 33 | | /// 'client/sendDuration', 'client/totalDuration', |
| | | 34 | | /// 'dependencies/count', 'dependencies/failed', |
| | | 35 | | /// 'dependencies/duration', 'exceptions/count', 'exceptions/browser', |
| | | 36 | | /// 'exceptions/server', 'sessions/count', |
| | | 37 | | /// 'performanceCounters/requestExecutionTime', |
| | | 38 | | /// 'performanceCounters/requestsPerSecond', |
| | | 39 | | /// 'performanceCounters/requestsInQueue', |
| | | 40 | | /// 'performanceCounters/memoryAvailableBytes', |
| | | 41 | | /// 'performanceCounters/exceptionsPerSecond', |
| | | 42 | | /// 'performanceCounters/processCpuPercentage', |
| | | 43 | | /// 'performanceCounters/processIOBytesPerSecond', |
| | | 44 | | /// 'performanceCounters/processPrivateBytes', |
| | | 45 | | /// 'performanceCounters/processorCpuPercentage', |
| | | 46 | | /// 'availabilityResults/availabilityPercentage', |
| | | 47 | | /// 'availabilityResults/duration', 'billing/telemetryCount', |
| | | 48 | | /// 'customEvents/count' |
| | | 49 | | /// </param> |
| | | 50 | | /// <param name='timespan'> |
| | | 51 | | /// The timespan over which to retrieve metric values. This is an |
| | | 52 | | /// ISO8601 time period value. If timespan is omitted, a default time |
| | | 53 | | /// range of `PT12H` ("last 12 hours") is used. The actual timespan |
| | | 54 | | /// that is queried may be adjusted by the server based. In all cases, |
| | | 55 | | /// the actual time span used for the query is included in the |
| | | 56 | | /// response. |
| | | 57 | | /// </param> |
| | | 58 | | /// <param name='aggregation'> |
| | | 59 | | /// The aggregation to use when computing the metric values. To |
| | | 60 | | /// retrieve more than one aggregation at a time, separate them with a |
| | | 61 | | /// comma. If no aggregation is specified, then the default aggregation |
| | | 62 | | /// for the metric is used. |
| | | 63 | | /// </param> |
| | | 64 | | /// <param name='top'> |
| | | 65 | | /// The number of segments to return. This value is only valid when |
| | | 66 | | /// segment is specified. |
| | | 67 | | /// </param> |
| | | 68 | | /// <param name='orderby'> |
| | | 69 | | /// The aggregation function and direction to sort the segments by. |
| | | 70 | | /// This value is only valid when segment is specified. |
| | | 71 | | /// </param> |
| | | 72 | | /// <param name='filter'> |
| | | 73 | | /// An expression used to filter the results. This value should be a |
| | | 74 | | /// valid OData filter expression where the keys of each clause should |
| | | 75 | | /// be applicable dimensions for the metric you are retrieving. |
| | | 76 | | /// </param> |
| | | 77 | | public static MetricsSummaryResult GetMetricSummary(this IMetrics operations, string appId, string metricId, str |
| | | 78 | | IList<string> aggregation = default(IList<string>), int? top = default(int?), |
| | | 79 | | string orderby = default(string), string filter = default(string)) |
| | | 80 | | { |
| | 0 | 81 | | return operations.GetMetricSummaryAsync(appId, metricId, timespan, aggregation, top, orderby, filter).GetAwa |
| | | 82 | | } |
| | | 83 | | |
| | | 84 | | /// <summary> |
| | | 85 | | /// Retrieve summary metric data |
| | | 86 | | /// </summary> |
| | | 87 | | /// <remarks> |
| | | 88 | | /// Gets summary metric values for a single metric |
| | | 89 | | /// </remarks> |
| | | 90 | | /// <param name='operations'> |
| | | 91 | | /// The operations group for this extension method. |
| | | 92 | | /// </param> |
| | | 93 | | /// <param name='appId'> |
| | | 94 | | /// ID of the application. This is Application ID from the API Access settings |
| | | 95 | | /// blade in the Azure portal. |
| | | 96 | | /// </param> |
| | | 97 | | /// <param name='metricId'> |
| | | 98 | | /// ID of the metric. This is either a standard AI metric, or an |
| | | 99 | | /// application-specific custom metric. Possible values include: |
| | | 100 | | /// 'requests/count', 'requests/duration', 'requests/failed', |
| | | 101 | | /// 'users/count', 'users/authenticated', 'pageViews/count', |
| | | 102 | | /// 'pageViews/duration', 'client/processingDuration', |
| | | 103 | | /// 'client/receiveDuration', 'client/networkDuration', |
| | | 104 | | /// 'client/sendDuration', 'client/totalDuration', |
| | | 105 | | /// 'dependencies/count', 'dependencies/failed', |
| | | 106 | | /// 'dependencies/duration', 'exceptions/count', 'exceptions/browser', |
| | | 107 | | /// 'exceptions/server', 'sessions/count', |
| | | 108 | | /// 'performanceCounters/requestExecutionTime', |
| | | 109 | | /// 'performanceCounters/requestsPerSecond', |
| | | 110 | | /// 'performanceCounters/requestsInQueue', |
| | | 111 | | /// 'performanceCounters/memoryAvailableBytes', |
| | | 112 | | /// 'performanceCounters/exceptionsPerSecond', |
| | | 113 | | /// 'performanceCounters/processCpuPercentage', |
| | | 114 | | /// 'performanceCounters/processIOBytesPerSecond', |
| | | 115 | | /// 'performanceCounters/processPrivateBytes', |
| | | 116 | | /// 'performanceCounters/processorCpuPercentage', |
| | | 117 | | /// 'availabilityResults/availabilityPercentage', |
| | | 118 | | /// 'availabilityResults/duration', 'billing/telemetryCount', |
| | | 119 | | /// 'customEvents/count' |
| | | 120 | | /// </param> |
| | | 121 | | /// <param name='timespan'> |
| | | 122 | | /// The timespan over which to retrieve metric values. This is an |
| | | 123 | | /// ISO8601 time period value. If timespan is omitted, a default time |
| | | 124 | | /// range of `PT12H` ("last 12 hours") is used. The actual timespan |
| | | 125 | | /// that is queried may be adjusted by the server based. In all cases, |
| | | 126 | | /// the actual time span used for the query is included in the |
| | | 127 | | /// response. |
| | | 128 | | /// </param> |
| | | 129 | | /// <param name='aggregation'> |
| | | 130 | | /// The aggregation to use when computing the metric values. To |
| | | 131 | | /// retrieve more than one aggregation at a time, separate them with a |
| | | 132 | | /// comma. If no aggregation is specified, then the default aggregation |
| | | 133 | | /// for the metric is used. |
| | | 134 | | /// </param> |
| | | 135 | | /// <param name='top'> |
| | | 136 | | /// The number of segments to return. This value is only valid when |
| | | 137 | | /// segment is specified. |
| | | 138 | | /// </param> |
| | | 139 | | /// <param name='orderby'> |
| | | 140 | | /// The aggregation function and direction to sort the segments by. |
| | | 141 | | /// This value is only valid when segment is specified. |
| | | 142 | | /// </param> |
| | | 143 | | /// <param name='filter'> |
| | | 144 | | /// An expression used to filter the results. This value should be a |
| | | 145 | | /// valid OData filter expression where the keys of each clause should |
| | | 146 | | /// be applicable dimensions for the metric you are retrieving. |
| | | 147 | | /// </param> |
| | | 148 | | /// <param name='cancellationToken'> |
| | | 149 | | /// The cancellation token. |
| | | 150 | | /// </param> |
| | | 151 | | public static async Task<MetricsSummaryResult> GetMetricSummaryAsync(this IMetrics operations, string appId, str |
| | | 152 | | IList<string> aggregation = default(IList<string>), int? top = default(int?), |
| | | 153 | | string orderby = default(string), string filter = default(string), |
| | | 154 | | CancellationToken cancellationToken = default(CancellationToken)) |
| | | 155 | | { |
| | 0 | 156 | | using (var result = await operations.GetMetricSummaryWithHttpMessagesAsync(appId, metricId, timespan, aggreg |
| | | 157 | | { |
| | 0 | 158 | | return result.Body; |
| | | 159 | | } |
| | 0 | 160 | | } |
| | | 161 | | |
| | | 162 | | /// <summary> |
| | | 163 | | /// Retrieve metric data |
| | | 164 | | /// </summary> |
| | | 165 | | /// <remarks> |
| | | 166 | | /// Gets metric values for a single metric |
| | | 167 | | /// </remarks> |
| | | 168 | | /// <param name='operations'> |
| | | 169 | | /// The operations group for this extension method. |
| | | 170 | | /// </param> |
| | | 171 | | /// <param name='appId'> |
| | | 172 | | /// ID of the application. This is Application ID from the API Access settings |
| | | 173 | | /// blade in the Azure portal. |
| | | 174 | | /// </param> |
| | | 175 | | /// <param name='metricId'> |
| | | 176 | | /// ID of the metric. This is either a standard AI metric, or an |
| | | 177 | | /// application-specific custom metric. Possible values include: |
| | | 178 | | /// 'requests/count', 'requests/duration', 'requests/failed', |
| | | 179 | | /// 'users/count', 'users/authenticated', 'pageViews/count', |
| | | 180 | | /// 'pageViews/duration', 'client/processingDuration', |
| | | 181 | | /// 'client/receiveDuration', 'client/networkDuration', |
| | | 182 | | /// 'client/sendDuration', 'client/totalDuration', |
| | | 183 | | /// 'dependencies/count', 'dependencies/failed', |
| | | 184 | | /// 'dependencies/duration', 'exceptions/count', 'exceptions/browser', |
| | | 185 | | /// 'exceptions/server', 'sessions/count', |
| | | 186 | | /// 'performanceCounters/requestExecutionTime', |
| | | 187 | | /// 'performanceCounters/requestsPerSecond', |
| | | 188 | | /// 'performanceCounters/requestsInQueue', |
| | | 189 | | /// 'performanceCounters/memoryAvailableBytes', |
| | | 190 | | /// 'performanceCounters/exceptionsPerSecond', |
| | | 191 | | /// 'performanceCounters/processCpuPercentage', |
| | | 192 | | /// 'performanceCounters/processIOBytesPerSecond', |
| | | 193 | | /// 'performanceCounters/processPrivateBytes', |
| | | 194 | | /// 'performanceCounters/processorCpuPercentage', |
| | | 195 | | /// 'availabilityResults/availabilityPercentage', |
| | | 196 | | /// 'availabilityResults/duration', 'billing/telemetryCount', |
| | | 197 | | /// 'customEvents/count' |
| | | 198 | | /// </param> |
| | | 199 | | /// <param name='timespan'> |
| | | 200 | | /// The timespan over which to retrieve metric values. This is an |
| | | 201 | | /// ISO8601 time period value. If timespan is omitted, a default time |
| | | 202 | | /// range of `PT12H` ("last 12 hours") is used. The actual timespan |
| | | 203 | | /// that is queried may be adjusted by the server based. In all cases, |
| | | 204 | | /// the actual time span used for the query is included in the |
| | | 205 | | /// response. |
| | | 206 | | /// </param> |
| | | 207 | | /// <param name='interval'> |
| | | 208 | | /// The time interval to use when retrieving metric values. This is an |
| | | 209 | | /// ISO8601 duration. If interval is omitted, the metric value is |
| | | 210 | | /// aggregated across the entire timespan. If interval is supplied, the |
| | | 211 | | /// server may adjust the interval to a more appropriate size based on |
| | | 212 | | /// the timespan used for the query. In all cases, the actual interval |
| | | 213 | | /// used for the query is included in the response. |
| | | 214 | | /// </param> |
| | | 215 | | /// <param name='aggregation'> |
| | | 216 | | /// The aggregation to use when computing the metric values. To |
| | | 217 | | /// retrieve more than one aggregation at a time, separate them with a |
| | | 218 | | /// comma. If no aggregation is specified, then the default aggregation |
| | | 219 | | /// for the metric is used. |
| | | 220 | | /// </param> |
| | | 221 | | /// <param name='segment'> |
| | | 222 | | /// The name of the dimension to segment the metric values by. This |
| | | 223 | | /// dimension must be applicable to the metric you are retrieving. To |
| | | 224 | | /// segment by more than one dimension at a time, separate them with a |
| | | 225 | | /// comma (,). In this case, the metric data will be segmented in the |
| | | 226 | | /// order the dimensions are listed in the parameter. |
| | | 227 | | /// </param> |
| | | 228 | | /// <param name='top'> |
| | | 229 | | /// The number of segments to return. This value is only valid when |
| | | 230 | | /// segment is specified. |
| | | 231 | | /// </param> |
| | | 232 | | /// <param name='orderby'> |
| | | 233 | | /// The aggregation function and direction to sort the segments by. |
| | | 234 | | /// This value is only valid when segment is specified. |
| | | 235 | | /// </param> |
| | | 236 | | /// <param name='filter'> |
| | | 237 | | /// An expression used to filter the results. This value should be a |
| | | 238 | | /// valid OData filter expression where the keys of each clause should |
| | | 239 | | /// be applicable dimensions for the metric you are retrieving. |
| | | 240 | | /// </param> |
| | | 241 | | public static MetricsIntervaledResult GetIntervaledMetric(this IMetrics operations, string appId, |
| | | 242 | | string metricId, string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), |
| | | 243 | | IList<string> aggregation = default(IList<string>), IList<string> segment = default(IList<string>), |
| | | 244 | | int? top = default(int?), string orderby = default(string), string filter = default(string)) |
| | | 245 | | { |
| | 0 | 246 | | return operations |
| | 0 | 247 | | .GetIntervaledMetricAsync(appId, metricId, timespan, interval, aggregation, segment, top, orderby, filte |
| | 0 | 248 | | .GetAwaiter().GetResult(); |
| | | 249 | | } |
| | | 250 | | |
| | | 251 | | /// <summary> |
| | | 252 | | /// Retrieve metric data |
| | | 253 | | /// </summary> |
| | | 254 | | /// <remarks> |
| | | 255 | | /// Gets metric values for a single metric |
| | | 256 | | /// </remarks> |
| | | 257 | | /// <param name='operations'> |
| | | 258 | | /// The operations group for this extension method. |
| | | 259 | | /// </param> |
| | | 260 | | /// <param name='appId'> |
| | | 261 | | /// ID of the application. This is Application ID from the API Access settings |
| | | 262 | | /// blade in the Azure portal. |
| | | 263 | | /// </param> |
| | | 264 | | /// <param name='metricId'> |
| | | 265 | | /// ID of the metric. This is either a standard AI metric, or an |
| | | 266 | | /// application-specific custom metric. Possible values include: |
| | | 267 | | /// 'requests/count', 'requests/duration', 'requests/failed', |
| | | 268 | | /// 'users/count', 'users/authenticated', 'pageViews/count', |
| | | 269 | | /// 'pageViews/duration', 'client/processingDuration', |
| | | 270 | | /// 'client/receiveDuration', 'client/networkDuration', |
| | | 271 | | /// 'client/sendDuration', 'client/totalDuration', |
| | | 272 | | /// 'dependencies/count', 'dependencies/failed', |
| | | 273 | | /// 'dependencies/duration', 'exceptions/count', 'exceptions/browser', |
| | | 274 | | /// 'exceptions/server', 'sessions/count', |
| | | 275 | | /// 'performanceCounters/requestExecutionTime', |
| | | 276 | | /// 'performanceCounters/requestsPerSecond', |
| | | 277 | | /// 'performanceCounters/requestsInQueue', |
| | | 278 | | /// 'performanceCounters/memoryAvailableBytes', |
| | | 279 | | /// 'performanceCounters/exceptionsPerSecond', |
| | | 280 | | /// 'performanceCounters/processCpuPercentage', |
| | | 281 | | /// 'performanceCounters/processIOBytesPerSecond', |
| | | 282 | | /// 'performanceCounters/processPrivateBytes', |
| | | 283 | | /// 'performanceCounters/processorCpuPercentage', |
| | | 284 | | /// 'availabilityResults/availabilityPercentage', |
| | | 285 | | /// 'availabilityResults/duration', 'billing/telemetryCount', |
| | | 286 | | /// 'customEvents/count' |
| | | 287 | | /// </param> |
| | | 288 | | /// <param name='timespan'> |
| | | 289 | | /// The timespan over which to retrieve metric values. This is an |
| | | 290 | | /// ISO8601 time period value. If timespan is omitted, a default time |
| | | 291 | | /// range of `PT12H` ("last 12 hours") is used. The actual timespan |
| | | 292 | | /// that is queried may be adjusted by the server based. In all cases, |
| | | 293 | | /// the actual time span used for the query is included in the |
| | | 294 | | /// response. |
| | | 295 | | /// </param> |
| | | 296 | | /// <param name='interval'> |
| | | 297 | | /// The time interval to use when retrieving metric values. This is an |
| | | 298 | | /// ISO8601 duration. If interval is omitted, the metric value is |
| | | 299 | | /// aggregated across the entire timespan. If interval is supplied, the |
| | | 300 | | /// server may adjust the interval to a more appropriate size based on |
| | | 301 | | /// the timespan used for the query. In all cases, the actual interval |
| | | 302 | | /// used for the query is included in the response. |
| | | 303 | | /// </param> |
| | | 304 | | /// <param name='aggregation'> |
| | | 305 | | /// The aggregation to use when computing the metric values. To |
| | | 306 | | /// retrieve more than one aggregation at a time, separate them with a |
| | | 307 | | /// comma. If no aggregation is specified, then the default aggregation |
| | | 308 | | /// for the metric is used. |
| | | 309 | | /// </param> |
| | | 310 | | /// <param name='segment'> |
| | | 311 | | /// The name of the dimension to segment the metric values by. This |
| | | 312 | | /// dimension must be applicable to the metric you are retrieving. To |
| | | 313 | | /// segment by more than one dimension at a time, separate them with a |
| | | 314 | | /// comma (,). In this case, the metric data will be segmented in the |
| | | 315 | | /// order the dimensions are listed in the parameter. |
| | | 316 | | /// </param> |
| | | 317 | | /// <param name='top'> |
| | | 318 | | /// The number of segments to return. This value is only valid when |
| | | 319 | | /// segment is specified. |
| | | 320 | | /// </param> |
| | | 321 | | /// <param name='orderby'> |
| | | 322 | | /// The aggregation function and direction to sort the segments by. |
| | | 323 | | /// This value is only valid when segment is specified. |
| | | 324 | | /// </param> |
| | | 325 | | /// <param name='filter'> |
| | | 326 | | /// An expression used to filter the results. This value should be a |
| | | 327 | | /// valid OData filter expression where the keys of each clause should |
| | | 328 | | /// be applicable dimensions for the metric you are retrieving. |
| | | 329 | | /// </param> |
| | | 330 | | /// <param name='cancellationToken'> |
| | | 331 | | /// The cancellation token. |
| | | 332 | | /// </param> |
| | | 333 | | public static async Task<MetricsIntervaledResult> GetIntervaledMetricAsync(this IMetrics operations, string appI |
| | | 334 | | string metricId, string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), |
| | | 335 | | IList<string> aggregation = default(IList<string>), IList<string> segment = default(IList<string>), |
| | | 336 | | int? top = default(int?), string orderby = default(string), string filter = default(string), |
| | | 337 | | CancellationToken cancellationToken = default(CancellationToken)) |
| | | 338 | | { |
| | 0 | 339 | | using (var result = await operations.GetIntervaledMetricWithHttpMessagesAsync(appId, metricId, timespan, int |
| | | 340 | | { |
| | 0 | 341 | | return result.Body; |
| | | 342 | | } |
| | 0 | 343 | | } |
| | | 344 | | |
| | | 345 | | /// <summary> |
| | | 346 | | /// Retrieve metric data |
| | | 347 | | /// </summary> |
| | | 348 | | /// <remarks> |
| | | 349 | | /// Gets metric values for a single metric |
| | | 350 | | /// </remarks> |
| | | 351 | | /// <param name='operations'> |
| | | 352 | | /// The operations group for this extension method. |
| | | 353 | | /// </param> |
| | | 354 | | /// <param name='appId'> |
| | | 355 | | /// ID of the application. This is Application ID from the API Access settings |
| | | 356 | | /// blade in the Azure portal. |
| | | 357 | | /// </param> |
| | | 358 | | /// <param name='metricId'> |
| | | 359 | | /// ID of the metric. This is either a standard AI metric, or an |
| | | 360 | | /// application-specific custom metric. Possible values include: |
| | | 361 | | /// 'requests/count', 'requests/duration', 'requests/failed', |
| | | 362 | | /// 'users/count', 'users/authenticated', 'pageViews/count', |
| | | 363 | | /// 'pageViews/duration', 'client/processingDuration', |
| | | 364 | | /// 'client/receiveDuration', 'client/networkDuration', |
| | | 365 | | /// 'client/sendDuration', 'client/totalDuration', |
| | | 366 | | /// 'dependencies/count', 'dependencies/failed', |
| | | 367 | | /// 'dependencies/duration', 'exceptions/count', 'exceptions/browser', |
| | | 368 | | /// 'exceptions/server', 'sessions/count', |
| | | 369 | | /// 'performanceCounters/requestExecutionTime', |
| | | 370 | | /// 'performanceCounters/requestsPerSecond', |
| | | 371 | | /// 'performanceCounters/requestsInQueue', |
| | | 372 | | /// 'performanceCounters/memoryAvailableBytes', |
| | | 373 | | /// 'performanceCounters/exceptionsPerSecond', |
| | | 374 | | /// 'performanceCounters/processCpuPercentage', |
| | | 375 | | /// 'performanceCounters/processIOBytesPerSecond', |
| | | 376 | | /// 'performanceCounters/processPrivateBytes', |
| | | 377 | | /// 'performanceCounters/processorCpuPercentage', |
| | | 378 | | /// 'availabilityResults/availabilityPercentage', |
| | | 379 | | /// 'availabilityResults/duration', 'billing/telemetryCount', |
| | | 380 | | /// 'customEvents/count' |
| | | 381 | | /// </param> |
| | | 382 | | /// <param name='timespan'> |
| | | 383 | | /// The timespan over which to retrieve metric values. This is an |
| | | 384 | | /// ISO8601 time period value. If timespan is omitted, a default time |
| | | 385 | | /// range of `PT12H` ("last 12 hours") is used. The actual timespan |
| | | 386 | | /// that is queried may be adjusted by the server based. In all cases, |
| | | 387 | | /// the actual time span used for the query is included in the |
| | | 388 | | /// response. |
| | | 389 | | /// </param> |
| | | 390 | | /// <param name='aggregation'> |
| | | 391 | | /// The aggregation to use when computing the metric values. To |
| | | 392 | | /// retrieve more than one aggregation at a time, separate them with a |
| | | 393 | | /// comma. If no aggregation is specified, then the default aggregation |
| | | 394 | | /// for the metric is used. |
| | | 395 | | /// </param> |
| | | 396 | | /// <param name='segment'> |
| | | 397 | | /// The name of the dimension to segment the metric values by. This |
| | | 398 | | /// dimension must be applicable to the metric you are retrieving. To |
| | | 399 | | /// segment by more than one dimension at a time, separate them with a |
| | | 400 | | /// comma (,). In this case, the metric data will be segmented in the |
| | | 401 | | /// order the dimensions are listed in the parameter. |
| | | 402 | | /// </param> |
| | | 403 | | /// <param name='top'> |
| | | 404 | | /// The number of segments to return. This value is only valid when |
| | | 405 | | /// segment is specified. |
| | | 406 | | /// </param> |
| | | 407 | | /// <param name='orderby'> |
| | | 408 | | /// The aggregation function and direction to sort the segments by. |
| | | 409 | | /// This value is only valid when segment is specified. |
| | | 410 | | /// </param> |
| | | 411 | | /// <param name='filter'> |
| | | 412 | | /// An expression used to filter the results. This value should be a |
| | | 413 | | /// valid OData filter expression where the keys of each clause should |
| | | 414 | | /// be applicable dimensions for the metric you are retrieving. |
| | | 415 | | /// </param> |
| | | 416 | | public static MetricsSegmentedResult GetSegmentedMetric(this IMetrics operations, string appId, |
| | | 417 | | string metricId, string timespan = default(string), IList<string> aggregation = default(IList<string>), |
| | | 418 | | IList<string> segment = default(IList<string>), int? top = default(int?), string orderby = default(string), |
| | | 419 | | string filter = default(string)) |
| | | 420 | | { |
| | 0 | 421 | | return operations.GetSegmentedMetricAsync(appId, metricId, timespan, aggregation, segment, top, orderby, fil |
| | 0 | 422 | | .GetAwaiter().GetResult(); |
| | | 423 | | } |
| | | 424 | | |
| | | 425 | | /// <summary> |
| | | 426 | | /// Retrieve metric data |
| | | 427 | | /// </summary> |
| | | 428 | | /// <remarks> |
| | | 429 | | /// Gets metric values for a single metric |
| | | 430 | | /// </remarks> |
| | | 431 | | /// <param name='operations'> |
| | | 432 | | /// The operations group for this extension method. |
| | | 433 | | /// </param> |
| | | 434 | | /// <param name='appId'> |
| | | 435 | | /// ID of the application. This is Application ID from the API Access settings |
| | | 436 | | /// blade in the Azure portal. |
| | | 437 | | /// </param> |
| | | 438 | | /// <param name='metricId'> |
| | | 439 | | /// ID of the metric. This is either a standard AI metric, or an |
| | | 440 | | /// application-specific custom metric. Possible values include: |
| | | 441 | | /// 'requests/count', 'requests/duration', 'requests/failed', |
| | | 442 | | /// 'users/count', 'users/authenticated', 'pageViews/count', |
| | | 443 | | /// 'pageViews/duration', 'client/processingDuration', |
| | | 444 | | /// 'client/receiveDuration', 'client/networkDuration', |
| | | 445 | | /// 'client/sendDuration', 'client/totalDuration', |
| | | 446 | | /// 'dependencies/count', 'dependencies/failed', |
| | | 447 | | /// 'dependencies/duration', 'exceptions/count', 'exceptions/browser', |
| | | 448 | | /// 'exceptions/server', 'sessions/count', |
| | | 449 | | /// 'performanceCounters/requestExecutionTime', |
| | | 450 | | /// 'performanceCounters/requestsPerSecond', |
| | | 451 | | /// 'performanceCounters/requestsInQueue', |
| | | 452 | | /// 'performanceCounters/memoryAvailableBytes', |
| | | 453 | | /// 'performanceCounters/exceptionsPerSecond', |
| | | 454 | | /// 'performanceCounters/processCpuPercentage', |
| | | 455 | | /// 'performanceCounters/processIOBytesPerSecond', |
| | | 456 | | /// 'performanceCounters/processPrivateBytes', |
| | | 457 | | /// 'performanceCounters/processorCpuPercentage', |
| | | 458 | | /// 'availabilityResults/availabilityPercentage', |
| | | 459 | | /// 'availabilityResults/duration', 'billing/telemetryCount', |
| | | 460 | | /// 'customEvents/count' |
| | | 461 | | /// </param> |
| | | 462 | | /// <param name='timespan'> |
| | | 463 | | /// The timespan over which to retrieve metric values. This is an |
| | | 464 | | /// ISO8601 time period value. If timespan is omitted, a default time |
| | | 465 | | /// range of `PT12H` ("last 12 hours") is used. The actual timespan |
| | | 466 | | /// that is queried may be adjusted by the server based. In all cases, |
| | | 467 | | /// the actual time span used for the query is included in the |
| | | 468 | | /// response. |
| | | 469 | | /// </param> |
| | | 470 | | /// <param name='aggregation'> |
| | | 471 | | /// The aggregation to use when computing the metric values. To |
| | | 472 | | /// retrieve more than one aggregation at a time, separate them with a |
| | | 473 | | /// comma. If no aggregation is specified, then the default aggregation |
| | | 474 | | /// for the metric is used. |
| | | 475 | | /// </param> |
| | | 476 | | /// <param name='segment'> |
| | | 477 | | /// The name of the dimension to segment the metric values by. This |
| | | 478 | | /// dimension must be applicable to the metric you are retrieving. To |
| | | 479 | | /// segment by more than one dimension at a time, separate them with a |
| | | 480 | | /// comma (,). In this case, the metric data will be segmented in the |
| | | 481 | | /// order the dimensions are listed in the parameter. |
| | | 482 | | /// </param> |
| | | 483 | | /// <param name='top'> |
| | | 484 | | /// The number of segments to return. This value is only valid when |
| | | 485 | | /// segment is specified. |
| | | 486 | | /// </param> |
| | | 487 | | /// <param name='orderby'> |
| | | 488 | | /// The aggregation function and direction to sort the segments by. |
| | | 489 | | /// This value is only valid when segment is specified. |
| | | 490 | | /// </param> |
| | | 491 | | /// <param name='filter'> |
| | | 492 | | /// An expression used to filter the results. This value should be a |
| | | 493 | | /// valid OData filter expression where the keys of each clause should |
| | | 494 | | /// be applicable dimensions for the metric you are retrieving. |
| | | 495 | | /// </param> |
| | | 496 | | /// <param name='cancellationToken'> |
| | | 497 | | /// The cancellation token. |
| | | 498 | | /// </param> |
| | | 499 | | public static async Task<MetricsSegmentedResult> GetSegmentedMetricAsync(this IMetrics operations, string appId, |
| | | 500 | | string metricId, string timespan = default(string), IList<string> aggregation = default(IList<string>), |
| | | 501 | | IList<string> segment = default(IList<string>), int? top = default(int?), string orderby = default(string), |
| | | 502 | | string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) |
| | | 503 | | { |
| | 0 | 504 | | using (var result = await operations.GetSegmentedMetricWithHttpMessagesAsync(appId, metricId, timespan, aggr |
| | 0 | 505 | | segment, top, orderby, filter, null, cancellationToken).ConfigureAwait(false)) |
| | | 506 | | { |
| | 0 | 507 | | return result.Body; |
| | | 508 | | } |
| | 0 | 509 | | } |
| | | 510 | | |
| | | 511 | | /// <summary> |
| | | 512 | | /// Retrieve metric data |
| | | 513 | | /// </summary> |
| | | 514 | | /// <remarks> |
| | | 515 | | /// Gets metric values for a single metric |
| | | 516 | | /// </remarks> |
| | | 517 | | /// <param name='operations'> |
| | | 518 | | /// The operations group for this extension method. |
| | | 519 | | /// </param> |
| | | 520 | | /// <param name='appId'> |
| | | 521 | | /// ID of the application. This is Application ID from the API Access settings |
| | | 522 | | /// blade in the Azure portal. |
| | | 523 | | /// </param> |
| | | 524 | | /// <param name='metricId'> |
| | | 525 | | /// ID of the metric. This is either a standard AI metric, or an |
| | | 526 | | /// application-specific custom metric. Possible values include: |
| | | 527 | | /// 'requests/count', 'requests/duration', 'requests/failed', |
| | | 528 | | /// 'users/count', 'users/authenticated', 'pageViews/count', |
| | | 529 | | /// 'pageViews/duration', 'client/processingDuration', |
| | | 530 | | /// 'client/receiveDuration', 'client/networkDuration', |
| | | 531 | | /// 'client/sendDuration', 'client/totalDuration', |
| | | 532 | | /// 'dependencies/count', 'dependencies/failed', |
| | | 533 | | /// 'dependencies/duration', 'exceptions/count', 'exceptions/browser', |
| | | 534 | | /// 'exceptions/server', 'sessions/count', |
| | | 535 | | /// 'performanceCounters/requestExecutionTime', |
| | | 536 | | /// 'performanceCounters/requestsPerSecond', |
| | | 537 | | /// 'performanceCounters/requestsInQueue', |
| | | 538 | | /// 'performanceCounters/memoryAvailableBytes', |
| | | 539 | | /// 'performanceCounters/exceptionsPerSecond', |
| | | 540 | | /// 'performanceCounters/processCpuPercentage', |
| | | 541 | | /// 'performanceCounters/processIOBytesPerSecond', |
| | | 542 | | /// 'performanceCounters/processPrivateBytes', |
| | | 543 | | /// 'performanceCounters/processorCpuPercentage', |
| | | 544 | | /// 'availabilityResults/availabilityPercentage', |
| | | 545 | | /// 'availabilityResults/duration', 'billing/telemetryCount', |
| | | 546 | | /// 'customEvents/count' |
| | | 547 | | /// </param> |
| | | 548 | | /// <param name='timespan'> |
| | | 549 | | /// The timespan over which to retrieve metric values. This is an |
| | | 550 | | /// ISO8601 time period value. If timespan is omitted, a default time |
| | | 551 | | /// range of `PT12H` ("last 12 hours") is used. The actual timespan |
| | | 552 | | /// that is queried may be adjusted by the server based. In all cases, |
| | | 553 | | /// the actual time span used for the query is included in the |
| | | 554 | | /// response. |
| | | 555 | | /// </param> |
| | | 556 | | /// <param name='interval'> |
| | | 557 | | /// The time interval to use when retrieving metric values. This is an |
| | | 558 | | /// ISO8601 duration. If interval is omitted, the metric value is |
| | | 559 | | /// aggregated across the entire timespan. If interval is supplied, the |
| | | 560 | | /// server may adjust the interval to a more appropriate size based on |
| | | 561 | | /// the timespan used for the query. In all cases, the actual interval |
| | | 562 | | /// used for the query is included in the response. |
| | | 563 | | /// </param> |
| | | 564 | | /// <param name='aggregation'> |
| | | 565 | | /// The aggregation to use when computing the metric values. To |
| | | 566 | | /// retrieve more than one aggregation at a time, separate them with a |
| | | 567 | | /// comma. If no aggregation is specified, then the default aggregation |
| | | 568 | | /// for the metric is used. |
| | | 569 | | /// </param> |
| | | 570 | | /// <param name='segment'> |
| | | 571 | | /// The name of the dimension to segment the metric values by. This |
| | | 572 | | /// dimension must be applicable to the metric you are retrieving. To |
| | | 573 | | /// segment by more than one dimension at a time, separate them with a |
| | | 574 | | /// comma (,). In this case, the metric data will be segmented in the |
| | | 575 | | /// order the dimensions are listed in the parameter. |
| | | 576 | | /// </param> |
| | | 577 | | /// <param name='top'> |
| | | 578 | | /// The number of segments to return. This value is only valid when |
| | | 579 | | /// segment is specified. |
| | | 580 | | /// </param> |
| | | 581 | | /// <param name='orderby'> |
| | | 582 | | /// The aggregation function and direction to sort the segments by. |
| | | 583 | | /// This value is only valid when segment is specified. |
| | | 584 | | /// </param> |
| | | 585 | | /// <param name='filter'> |
| | | 586 | | /// An expression used to filter the results. This value should be a |
| | | 587 | | /// valid OData filter expression where the keys of each clause should |
| | | 588 | | /// be applicable dimensions for the metric you are retrieving. |
| | | 589 | | /// </param> |
| | | 590 | | public static MetricsIntervaledSegmentedResult GetIntervaledSegmentedMetric( |
| | | 591 | | this IMetrics operations, string appId, string metricId, string timespan = default(string), |
| | | 592 | | System.TimeSpan? interval = default(System.TimeSpan?), IList<string> aggregation = default(IList<string>), |
| | | 593 | | IList<string> segment = default(IList<string>), int? top = default(int?), string orderby = default(string), |
| | | 594 | | string filter = default(string)) |
| | | 595 | | { |
| | 0 | 596 | | return operations |
| | 0 | 597 | | .GetIntervaledSegmentedMetricAsync(appId, metricId, timespan, interval, aggregation, segment, top, order |
| | 0 | 598 | | filter).GetAwaiter().GetResult(); |
| | | 599 | | } |
| | | 600 | | |
| | | 601 | | /// <summary> |
| | | 602 | | /// Retrieve metric data |
| | | 603 | | /// </summary> |
| | | 604 | | /// <remarks> |
| | | 605 | | /// Gets metric values for a single metric |
| | | 606 | | /// </remarks> |
| | | 607 | | /// <param name='operations'> |
| | | 608 | | /// The operations group for this extension method. |
| | | 609 | | /// </param> |
| | | 610 | | /// <param name='appId'> |
| | | 611 | | /// ID of the application. This is Application ID from the API Access settings |
| | | 612 | | /// blade in the Azure portal. |
| | | 613 | | /// </param> |
| | | 614 | | /// <param name='metricId'> |
| | | 615 | | /// ID of the metric. This is either a standard AI metric, or an |
| | | 616 | | /// application-specific custom metric. Possible values include: |
| | | 617 | | /// 'requests/count', 'requests/duration', 'requests/failed', |
| | | 618 | | /// 'users/count', 'users/authenticated', 'pageViews/count', |
| | | 619 | | /// 'pageViews/duration', 'client/processingDuration', |
| | | 620 | | /// 'client/receiveDuration', 'client/networkDuration', |
| | | 621 | | /// 'client/sendDuration', 'client/totalDuration', |
| | | 622 | | /// 'dependencies/count', 'dependencies/failed', |
| | | 623 | | /// 'dependencies/duration', 'exceptions/count', 'exceptions/browser', |
| | | 624 | | /// 'exceptions/server', 'sessions/count', |
| | | 625 | | /// 'performanceCounters/requestExecutionTime', |
| | | 626 | | /// 'performanceCounters/requestsPerSecond', |
| | | 627 | | /// 'performanceCounters/requestsInQueue', |
| | | 628 | | /// 'performanceCounters/memoryAvailableBytes', |
| | | 629 | | /// 'performanceCounters/exceptionsPerSecond', |
| | | 630 | | /// 'performanceCounters/processCpuPercentage', |
| | | 631 | | /// 'performanceCounters/processIOBytesPerSecond', |
| | | 632 | | /// 'performanceCounters/processPrivateBytes', |
| | | 633 | | /// 'performanceCounters/processorCpuPercentage', |
| | | 634 | | /// 'availabilityResults/availabilityPercentage', |
| | | 635 | | /// 'availabilityResults/duration', 'billing/telemetryCount', |
| | | 636 | | /// 'customEvents/count' |
| | | 637 | | /// </param> |
| | | 638 | | /// <param name='timespan'> |
| | | 639 | | /// The timespan over which to retrieve metric values. This is an |
| | | 640 | | /// ISO8601 time period value. If timespan is omitted, a default time |
| | | 641 | | /// range of `PT12H` ("last 12 hours") is used. The actual timespan |
| | | 642 | | /// that is queried may be adjusted by the server based. In all cases, |
| | | 643 | | /// the actual time span used for the query is included in the |
| | | 644 | | /// response. |
| | | 645 | | /// </param> |
| | | 646 | | /// <param name='interval'> |
| | | 647 | | /// The time interval to use when retrieving metric values. This is an |
| | | 648 | | /// ISO8601 duration. If interval is omitted, the metric value is |
| | | 649 | | /// aggregated across the entire timespan. If interval is supplied, the |
| | | 650 | | /// server may adjust the interval to a more appropriate size based on |
| | | 651 | | /// the timespan used for the query. In all cases, the actual interval |
| | | 652 | | /// used for the query is included in the response. |
| | | 653 | | /// </param> |
| | | 654 | | /// <param name='aggregation'> |
| | | 655 | | /// The aggregation to use when computing the metric values. To |
| | | 656 | | /// retrieve more than one aggregation at a time, separate them with a |
| | | 657 | | /// comma. If no aggregation is specified, then the default aggregation |
| | | 658 | | /// for the metric is used. |
| | | 659 | | /// </param> |
| | | 660 | | /// <param name='segment'> |
| | | 661 | | /// The name of the dimension to segment the metric values by. This |
| | | 662 | | /// dimension must be applicable to the metric you are retrieving. To |
| | | 663 | | /// segment by more than one dimension at a time, separate them with a |
| | | 664 | | /// comma (,). In this case, the metric data will be segmented in the |
| | | 665 | | /// order the dimensions are listed in the parameter. |
| | | 666 | | /// </param> |
| | | 667 | | /// <param name='top'> |
| | | 668 | | /// The number of segments to return. This value is only valid when |
| | | 669 | | /// segment is specified. |
| | | 670 | | /// </param> |
| | | 671 | | /// <param name='orderby'> |
| | | 672 | | /// The aggregation function and direction to sort the segments by. |
| | | 673 | | /// This value is only valid when segment is specified. |
| | | 674 | | /// </param> |
| | | 675 | | /// <param name='filter'> |
| | | 676 | | /// An expression used to filter the results. This value should be a |
| | | 677 | | /// valid OData filter expression where the keys of each clause should |
| | | 678 | | /// be applicable dimensions for the metric you are retrieving. |
| | | 679 | | /// </param> |
| | | 680 | | /// <param name='cancellationToken'> |
| | | 681 | | /// The cancellation token. |
| | | 682 | | /// </param> |
| | | 683 | | public static async Task<MetricsIntervaledSegmentedResult> GetIntervaledSegmentedMetricAsync( |
| | | 684 | | this IMetrics operations, string appId, string metricId, string timespan = default(string), |
| | | 685 | | System.TimeSpan? interval = default(System.TimeSpan?), IList<string> aggregation = default(IList<string>), |
| | | 686 | | IList<string> segment = default(IList<string>), int? top = default(int?), string orderby = default(string), |
| | | 687 | | string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) |
| | | 688 | | { |
| | 0 | 689 | | using (var result = await operations.GetIntervaledSegmentedMetricWithHttpMessagesAsync(appId, metricId, time |
| | 0 | 690 | | interval, aggregation, segment, top, orderby, filter, null, cancellationToken).ConfigureAwait(false)) |
| | | 691 | | { |
| | 0 | 692 | | return result.Body; |
| | | 693 | | } |
| | 0 | 694 | | } |
| | | 695 | | |
| | | 696 | | #endregion |
| | | 697 | | } |
| | | 698 | | } |