| | 1 | | using Microsoft.Azure.ApplicationInsights.Query.Models; |
| | 2 | | using Microsoft.Rest; |
| | 3 | | using System.Collections.Generic; |
| | 4 | | using System.Linq; |
| | 5 | | using System.Net.Http; |
| | 6 | | using System.Threading; |
| | 7 | | using System.Threading.Tasks; |
| | 8 | |
|
| | 9 | | namespace Microsoft.Azure.ApplicationInsights.Query |
| | 10 | | { |
| | 11 | | public partial class Metrics : IServiceOperations<ApplicationInsightsDataClient>, IMetrics { |
| | 12 | | #region Metric Extensions |
| | 13 | |
|
| | 14 | | /// <summary> |
| | 15 | | /// Retrieve summary metric data |
| | 16 | | /// </summary> |
| | 17 | | /// <remarks> |
| | 18 | | /// Gets summary metric values for a single metric |
| | 19 | | /// </remarks> |
| | 20 | | /// <param name='appId'> |
| | 21 | | /// ID of the application. This is Application ID from the API Access settings |
| | 22 | | /// blade in the Azure portal. |
| | 23 | | /// </param> |
| | 24 | | /// <param name='metricId'> |
| | 25 | | /// ID of the metric. This is either a standard AI metric, or an |
| | 26 | | /// application-specific custom metric. Possible values include: |
| | 27 | | /// 'requests/count', 'requests/duration', 'requests/failed', |
| | 28 | | /// 'users/count', 'users/authenticated', 'pageViews/count', |
| | 29 | | /// 'pageViews/duration', 'client/processingDuration', |
| | 30 | | /// 'client/receiveDuration', 'client/networkDuration', |
| | 31 | | /// 'client/sendDuration', 'client/totalDuration', |
| | 32 | | /// 'dependencies/count', 'dependencies/failed', |
| | 33 | | /// 'dependencies/duration', 'exceptions/count', 'exceptions/browser', |
| | 34 | | /// 'exceptions/server', 'sessions/count', |
| | 35 | | /// 'performanceCounters/requestExecutionTime', |
| | 36 | | /// 'performanceCounters/requestsPerSecond', |
| | 37 | | /// 'performanceCounters/requestsInQueue', |
| | 38 | | /// 'performanceCounters/memoryAvailableBytes', |
| | 39 | | /// 'performanceCounters/exceptionsPerSecond', |
| | 40 | | /// 'performanceCounters/processCpuPercentage', |
| | 41 | | /// 'performanceCounters/processIOBytesPerSecond', |
| | 42 | | /// 'performanceCounters/processPrivateBytes', |
| | 43 | | /// 'performanceCounters/processorCpuPercentage', |
| | 44 | | /// 'availabilityResults/availabilityPercentage', |
| | 45 | | /// 'availabilityResults/duration', 'billing/telemetryCount', |
| | 46 | | /// 'customEvents/count' |
| | 47 | | /// </param> |
| | 48 | | /// <param name='timespan'> |
| | 49 | | /// The timespan over which to retrieve metric values. This is an |
| | 50 | | /// ISO8601 time period value. If timespan is omitted, a default time |
| | 51 | | /// range of `PT12H` ("last 12 hours") is used. The actual timespan |
| | 52 | | /// that is queried may be adjusted by the server based. In all cases, |
| | 53 | | /// the actual time span used for the query is included in the |
| | 54 | | /// response. |
| | 55 | | /// </param> |
| | 56 | | /// <param name='aggregation'> |
| | 57 | | /// The aggregation to use when computing the metric values. To |
| | 58 | | /// retrieve more than one aggregation at a time, separate them with a |
| | 59 | | /// comma. If no aggregation is specified, then the default aggregation |
| | 60 | | /// for the metric is used. |
| | 61 | | /// </param> |
| | 62 | | /// <param name='top'> |
| | 63 | | /// The number of segments to return. This value is only valid when |
| | 64 | | /// segment is specified. |
| | 65 | | /// </param> |
| | 66 | | /// <param name='orderby'> |
| | 67 | | /// The aggregation function and direction to sort the segments by. |
| | 68 | | /// This value is only valid when segment is specified. |
| | 69 | | /// </param> |
| | 70 | | /// <param name='filter'> |
| | 71 | | /// An expression used to filter the results. This value should be a |
| | 72 | | /// valid OData filter expression where the keys of each clause should |
| | 73 | | /// be applicable dimensions for the metric you are retrieving. |
| | 74 | | /// </param> |
| | 75 | | /// <param name='customHeaders'> |
| | 76 | | /// The headers that will be added to request. |
| | 77 | | /// </param> |
| | 78 | | /// <param name='cancellationToken'> |
| | 79 | | /// The cancellation token. |
| | 80 | | /// </param> |
| | 81 | | public async Task<HttpOperationResponse<MetricsSummaryResult>> GetMetricSummaryWithHttpMessagesAsync(string appI |
| | 82 | | int? top = default(int?), string orderby = default(string), string filter = default(string), Dictionary<stri |
| | 83 | | CancellationToken cancellationToken = default(CancellationToken)) |
| | 84 | | { |
| 0 | 85 | | var realResult = await GetWithHttpMessagesAsync(appId, metricId, timespan, null, aggregation, null, top, ord |
| 0 | 86 | | var realBody = realResult.Body.Value; |
| 0 | 87 | | return new HttpOperationResponse<MetricsSummaryResult> |
| 0 | 88 | | { |
| 0 | 89 | | Request = realResult.Request, |
| 0 | 90 | | Response = realResult.Response, |
| 0 | 91 | | Body = new MetricsSummaryResult |
| 0 | 92 | | { |
| 0 | 93 | | Start = realBody.Start, |
| 0 | 94 | | End = realBody.End, |
| 0 | 95 | | Sum = realBody.GetSum(), |
| 0 | 96 | | Average = realBody.GetAverage(), |
| 0 | 97 | | Min = realBody.GetMin(), |
| 0 | 98 | | Max = realBody.GetMax(), |
| 0 | 99 | | Count = realBody.GetCount() |
| 0 | 100 | | } |
| 0 | 101 | | }; |
| 0 | 102 | | } |
| | 103 | |
|
| | 104 | | /// <summary> |
| | 105 | | /// Retrieve metric data |
| | 106 | | /// </summary> |
| | 107 | | /// <remarks> |
| | 108 | | /// Gets metric values for a single metric |
| | 109 | | /// </remarks> |
| | 110 | | /// <param name='appId'> |
| | 111 | | /// ID of the application. This is Application ID from the API Access settings |
| | 112 | | /// blade in the Azure portal. |
| | 113 | | /// </param> |
| | 114 | | /// <param name='metricId'> |
| | 115 | | /// ID of the metric. This is either a standard AI metric, or an |
| | 116 | | /// application-specific custom metric. Possible values include: |
| | 117 | | /// 'requests/count', 'requests/duration', 'requests/failed', |
| | 118 | | /// 'users/count', 'users/authenticated', 'pageViews/count', |
| | 119 | | /// 'pageViews/duration', 'client/processingDuration', |
| | 120 | | /// 'client/receiveDuration', 'client/networkDuration', |
| | 121 | | /// 'client/sendDuration', 'client/totalDuration', |
| | 122 | | /// 'dependencies/count', 'dependencies/failed', |
| | 123 | | /// 'dependencies/duration', 'exceptions/count', 'exceptions/browser', |
| | 124 | | /// 'exceptions/server', 'sessions/count', |
| | 125 | | /// 'performanceCounters/requestExecutionTime', |
| | 126 | | /// 'performanceCounters/requestsPerSecond', |
| | 127 | | /// 'performanceCounters/requestsInQueue', |
| | 128 | | /// 'performanceCounters/memoryAvailableBytes', |
| | 129 | | /// 'performanceCounters/exceptionsPerSecond', |
| | 130 | | /// 'performanceCounters/processCpuPercentage', |
| | 131 | | /// 'performanceCounters/processIOBytesPerSecond', |
| | 132 | | /// 'performanceCounters/processPrivateBytes', |
| | 133 | | /// 'performanceCounters/processorCpuPercentage', |
| | 134 | | /// 'availabilityResults/availabilityPercentage', |
| | 135 | | /// 'availabilityResults/duration', 'billing/telemetryCount', |
| | 136 | | /// 'customEvents/count' |
| | 137 | | /// </param> |
| | 138 | | /// <param name='timespan'> |
| | 139 | | /// The timespan over which to retrieve metric values. This is an |
| | 140 | | /// ISO8601 time period value. If timespan is omitted, a default time |
| | 141 | | /// range of `PT12H` ("last 12 hours") is used. The actual timespan |
| | 142 | | /// that is queried may be adjusted by the server based. In all cases, |
| | 143 | | /// the actual time span used for the query is included in the |
| | 144 | | /// response. |
| | 145 | | /// </param> |
| | 146 | | /// <param name='interval'> |
| | 147 | | /// The time interval to use when retrieving metric values. This is an |
| | 148 | | /// ISO8601 duration. If interval is omitted, the metric value is |
| | 149 | | /// aggregated across the entire timespan. If interval is supplied, the |
| | 150 | | /// server may adjust the interval to a more appropriate size based on |
| | 151 | | /// the timespan used for the query. In all cases, the actual interval |
| | 152 | | /// used for the query is included in the response. |
| | 153 | | /// </param> |
| | 154 | | /// <param name='aggregation'> |
| | 155 | | /// The aggregation to use when computing the metric values. To |
| | 156 | | /// retrieve more than one aggregation at a time, separate them with a |
| | 157 | | /// comma. If no aggregation is specified, then the default aggregation |
| | 158 | | /// for the metric is used. |
| | 159 | | /// </param> |
| | 160 | | /// <param name='segment'> |
| | 161 | | /// The name of the dimension to segment the metric values by. This |
| | 162 | | /// dimension must be applicable to the metric you are retrieving. To |
| | 163 | | /// segment by more than one dimension at a time, separate them with a |
| | 164 | | /// comma (,). In this case, the metric data will be segmented in the |
| | 165 | | /// order the dimensions are listed in the parameter. |
| | 166 | | /// </param> |
| | 167 | | /// <param name='top'> |
| | 168 | | /// The number of segments to return. This value is only valid when |
| | 169 | | /// segment is specified. |
| | 170 | | /// </param> |
| | 171 | | /// <param name='orderby'> |
| | 172 | | /// The aggregation function and direction to sort the segments by. |
| | 173 | | /// This value is only valid when segment is specified. |
| | 174 | | /// </param> |
| | 175 | | /// <param name='filter'> |
| | 176 | | /// An expression used to filter the results. This value should be a |
| | 177 | | /// valid OData filter expression where the keys of each clause should |
| | 178 | | /// be applicable dimensions for the metric you are retrieving. |
| | 179 | | /// </param> |
| | 180 | | /// <param name='customHeaders'> |
| | 181 | | /// The headers that will be added to request. |
| | 182 | | /// </param> |
| | 183 | | /// <param name='cancellationToken'> |
| | 184 | | /// The cancellation token. |
| | 185 | | /// </param> |
| | 186 | | public async Task<HttpOperationResponse<MetricsIntervaledResult>> GetIntervaledMetricWithHttpMessagesAsync(strin |
| | 187 | | string metricId, string timespan = default(string), |
| | 188 | | System.TimeSpan? interval = default(System.TimeSpan?), IList<string> aggregation = default(IList<string>), |
| | 189 | | IList<string> segment = default(IList<string>), int? top = default(int?), string orderby = default(string), |
| | 190 | | string filter = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken c |
| | 191 | | { |
| 0 | 192 | | var realResult = await GetWithHttpMessagesAsync(appId, metricId, timespan, interval, aggregation, null, top, |
| 0 | 193 | | var realBody = realResult.Body.Value; |
| 0 | 194 | | return new HttpOperationResponse<MetricsIntervaledResult> |
| 0 | 195 | | { |
| 0 | 196 | | Request = realResult.Request, |
| 0 | 197 | | Response = realResult.Response, |
| 0 | 198 | | Body = new MetricsIntervaledResult |
| 0 | 199 | | { |
| 0 | 200 | | Start = realBody.Start, |
| 0 | 201 | | End = realBody.End, |
| 0 | 202 | | Interval = realBody.Interval, |
| 0 | 203 | | Intervals = realBody.Segments?.Select(inter => |
| | 204 | | new MetricsIntervaledData |
| | 205 | | { |
| | 206 | | Sum = inter.GetSum(), |
| | 207 | | Average = inter.GetAverage(), |
| | 208 | | Min = inter.GetMin(), |
| | 209 | | Max = inter.GetMax(), |
| | 210 | | Count = inter.GetCount() |
| | 211 | | } |
| 0 | 212 | | ).ToList() |
| 0 | 213 | | } |
| 0 | 214 | | }; |
| 0 | 215 | | } |
| | 216 | |
|
| | 217 | | /// <summary> |
| | 218 | | /// Retrieve metric data |
| | 219 | | /// </summary> |
| | 220 | | /// <remarks> |
| | 221 | | /// Gets metric values for a single metric |
| | 222 | | /// </remarks> |
| | 223 | | /// <param name='appId'> |
| | 224 | | /// ID of the application. This is Application ID from the API Access settings |
| | 225 | | /// blade in the Azure portal. |
| | 226 | | /// </param> |
| | 227 | | /// <param name='metricId'> |
| | 228 | | /// ID of the metric. This is either a standard AI metric, or an |
| | 229 | | /// application-specific custom metric. Possible values include: |
| | 230 | | /// 'requests/count', 'requests/duration', 'requests/failed', |
| | 231 | | /// 'users/count', 'users/authenticated', 'pageViews/count', |
| | 232 | | /// 'pageViews/duration', 'client/processingDuration', |
| | 233 | | /// 'client/receiveDuration', 'client/networkDuration', |
| | 234 | | /// 'client/sendDuration', 'client/totalDuration', |
| | 235 | | /// 'dependencies/count', 'dependencies/failed', |
| | 236 | | /// 'dependencies/duration', 'exceptions/count', 'exceptions/browser', |
| | 237 | | /// 'exceptions/server', 'sessions/count', |
| | 238 | | /// 'performanceCounters/requestExecutionTime', |
| | 239 | | /// 'performanceCounters/requestsPerSecond', |
| | 240 | | /// 'performanceCounters/requestsInQueue', |
| | 241 | | /// 'performanceCounters/memoryAvailableBytes', |
| | 242 | | /// 'performanceCounters/exceptionsPerSecond', |
| | 243 | | /// 'performanceCounters/processCpuPercentage', |
| | 244 | | /// 'performanceCounters/processIOBytesPerSecond', |
| | 245 | | /// 'performanceCounters/processPrivateBytes', |
| | 246 | | /// 'performanceCounters/processorCpuPercentage', |
| | 247 | | /// 'availabilityResults/availabilityPercentage', |
| | 248 | | /// 'availabilityResults/duration', 'billing/telemetryCount', |
| | 249 | | /// 'customEvents/count' |
| | 250 | | /// </param> |
| | 251 | | /// <param name='timespan'> |
| | 252 | | /// The timespan over which to retrieve metric values. This is an |
| | 253 | | /// ISO8601 time period value. If timespan is omitted, a default time |
| | 254 | | /// range of `PT12H` ("last 12 hours") is used. The actual timespan |
| | 255 | | /// that is queried may be adjusted by the server based. In all cases, |
| | 256 | | /// the actual time span used for the query is included in the |
| | 257 | | /// response. |
| | 258 | | /// </param> |
| | 259 | | /// <param name='aggregation'> |
| | 260 | | /// The aggregation to use when computing the metric values. To |
| | 261 | | /// retrieve more than one aggregation at a time, separate them with a |
| | 262 | | /// comma. If no aggregation is specified, then the default aggregation |
| | 263 | | /// for the metric is used. |
| | 264 | | /// </param> |
| | 265 | | /// <param name='segment'> |
| | 266 | | /// The name of the dimension to segment the metric values by. This |
| | 267 | | /// dimension must be applicable to the metric you are retrieving. To |
| | 268 | | /// segment by more than one dimension at a time, separate them with a |
| | 269 | | /// comma (,). In this case, the metric data will be segmented in the |
| | 270 | | /// order the dimensions are listed in the parameter. |
| | 271 | | /// </param> |
| | 272 | | /// <param name='top'> |
| | 273 | | /// The number of segments to return. This value is only valid when |
| | 274 | | /// segment is specified. |
| | 275 | | /// </param> |
| | 276 | | /// <param name='orderby'> |
| | 277 | | /// The aggregation function and direction to sort the segments by. |
| | 278 | | /// This value is only valid when segment is specified. |
| | 279 | | /// </param> |
| | 280 | | /// <param name='filter'> |
| | 281 | | /// An expression used to filter the results. This value should be a |
| | 282 | | /// valid OData filter expression where the keys of each clause should |
| | 283 | | /// be applicable dimensions for the metric you are retrieving. |
| | 284 | | /// </param> |
| | 285 | | /// <param name='customHeaders'> |
| | 286 | | /// The headers that will be added to request. |
| | 287 | | /// </param> |
| | 288 | | /// <param name='cancellationToken'> |
| | 289 | | /// The cancellation token. |
| | 290 | | /// </param> |
| | 291 | | public async Task<HttpOperationResponse<MetricsSegmentedResult>> GetSegmentedMetricWithHttpMessagesAsync(string |
| | 292 | | string timespan = default(string), IList<string> aggregation = default(IList<string>), |
| | 293 | | IList<string> segment = default(IList<string>), int? top = default(int?), string orderby = default(string), |
| | 294 | | string filter = default(string), Dictionary<string, List<string>> customHeaders = null, |
| | 295 | | CancellationToken cancellationToken = default(CancellationToken)) |
| | 296 | | { |
| 0 | 297 | | var realResult = await GetWithHttpMessagesAsync(appId, metricId, timespan, null, aggregation, segment, top, |
| 0 | 298 | | var realBody = realResult.Body.Value; |
| 0 | 299 | | return new HttpOperationResponse<MetricsSegmentedResult> |
| 0 | 300 | | { |
| 0 | 301 | | Request = realResult.Request, |
| 0 | 302 | | Response = realResult.Response, |
| 0 | 303 | | Body = new MetricsSegmentedResult |
| 0 | 304 | | { |
| 0 | 305 | | Start = realBody.Start, |
| 0 | 306 | | End = realBody.End, |
| 0 | 307 | | Segments= GetSegmentInfo(realBody.Segments), |
| 0 | 308 | | } |
| 0 | 309 | | }; |
| 0 | 310 | | } |
| | 311 | |
|
| | 312 | | private static IList<IMetricsBaseSegmentInfo> GetSegmentInfo(IList<MetricsSegmentInfo> segments) |
| | 313 | | { |
| 0 | 314 | | return segments?.Select(seg => |
| 0 | 315 | | { |
| 0 | 316 | | IMetricsBaseSegmentInfo result; |
| 0 | 317 | | if (seg.Segments != null && seg.Segments.Count != 0) |
| 0 | 318 | | { |
| 0 | 319 | | result = new MetricsNestedSegment() |
| 0 | 320 | | { |
| 0 | 321 | | SegmentId = seg.SegmentId, |
| 0 | 322 | | SegmentValue = seg.SegmentValue, |
| 0 | 323 | | Segments = GetSegmentInfo(seg.Segments), |
| 0 | 324 | | }; |
| 0 | 325 | | } |
| 0 | 326 | | else |
| 0 | 327 | | { |
| 0 | 328 | | result = new MetricsSegmentedData |
| 0 | 329 | | { |
| 0 | 330 | | SegmentId = seg.SegmentId, |
| 0 | 331 | | SegmentValue = seg.SegmentValue, |
| 0 | 332 | | Sum = seg.GetSum(), |
| 0 | 333 | | Average = seg.GetAverage(), |
| 0 | 334 | | Min = seg.GetMin(), |
| 0 | 335 | | Max = seg.GetMax(), |
| 0 | 336 | | Count = seg.GetCount() |
| 0 | 337 | | }; |
| 0 | 338 | | } |
| 0 | 339 | |
|
| 0 | 340 | | return result; |
| 0 | 341 | | }).ToList(); |
| | 342 | | } |
| | 343 | |
|
| | 344 | | /// <summary> |
| | 345 | | /// Retrieve metric data |
| | 346 | | /// </summary> |
| | 347 | | /// <remarks> |
| | 348 | | /// Gets metric values for a single metric |
| | 349 | | /// </remarks> |
| | 350 | | /// <param name='appId'> |
| | 351 | | /// ID of the application. This is Application ID from the API Access settings |
| | 352 | | /// blade in the Azure portal. |
| | 353 | | /// </param> |
| | 354 | | /// <param name='metricId'> |
| | 355 | | /// ID of the metric. This is either a standard AI metric, or an |
| | 356 | | /// application-specific custom metric. Possible values include: |
| | 357 | | /// 'requests/count', 'requests/duration', 'requests/failed', |
| | 358 | | /// 'users/count', 'users/authenticated', 'pageViews/count', |
| | 359 | | /// 'pageViews/duration', 'client/processingDuration', |
| | 360 | | /// 'client/receiveDuration', 'client/networkDuration', |
| | 361 | | /// 'client/sendDuration', 'client/totalDuration', |
| | 362 | | /// 'dependencies/count', 'dependencies/failed', |
| | 363 | | /// 'dependencies/duration', 'exceptions/count', 'exceptions/browser', |
| | 364 | | /// 'exceptions/server', 'sessions/count', |
| | 365 | | /// 'performanceCounters/requestExecutionTime', |
| | 366 | | /// 'performanceCounters/requestsPerSecond', |
| | 367 | | /// 'performanceCounters/requestsInQueue', |
| | 368 | | /// 'performanceCounters/memoryAvailableBytes', |
| | 369 | | /// 'performanceCounters/exceptionsPerSecond', |
| | 370 | | /// 'performanceCounters/processCpuPercentage', |
| | 371 | | /// 'performanceCounters/processIOBytesPerSecond', |
| | 372 | | /// 'performanceCounters/processPrivateBytes', |
| | 373 | | /// 'performanceCounters/processorCpuPercentage', |
| | 374 | | /// 'availabilityResults/availabilityPercentage', |
| | 375 | | /// 'availabilityResults/duration', 'billing/telemetryCount', |
| | 376 | | /// 'customEvents/count' |
| | 377 | | /// </param> |
| | 378 | | /// <param name='timespan'> |
| | 379 | | /// The timespan over which to retrieve metric values. This is an |
| | 380 | | /// ISO8601 time period value. If timespan is omitted, a default time |
| | 381 | | /// range of `PT12H` ("last 12 hours") is used. The actual timespan |
| | 382 | | /// that is queried may be adjusted by the server based. In all cases, |
| | 383 | | /// the actual time span used for the query is included in the |
| | 384 | | /// response. |
| | 385 | | /// </param> |
| | 386 | | /// <param name='interval'> |
| | 387 | | /// The time interval to use when retrieving metric values. This is an |
| | 388 | | /// ISO8601 duration. If interval is omitted, the metric value is |
| | 389 | | /// aggregated across the entire timespan. If interval is supplied, the |
| | 390 | | /// server may adjust the interval to a more appropriate size based on |
| | 391 | | /// the timespan used for the query. In all cases, the actual interval |
| | 392 | | /// used for the query is included in the response. |
| | 393 | | /// </param> |
| | 394 | | /// <param name='aggregation'> |
| | 395 | | /// The aggregation to use when computing the metric values. To |
| | 396 | | /// retrieve more than one aggregation at a time, separate them with a |
| | 397 | | /// comma. If no aggregation is specified, then the default aggregation |
| | 398 | | /// for the metric is used. |
| | 399 | | /// </param> |
| | 400 | | /// <param name='segment'> |
| | 401 | | /// The name of the dimension to segment the metric values by. This |
| | 402 | | /// dimension must be applicable to the metric you are retrieving. To |
| | 403 | | /// segment by more than one dimension at a time, separate them with a |
| | 404 | | /// comma (,). In this case, the metric data will be segmented in the |
| | 405 | | /// order the dimensions are listed in the parameter. |
| | 406 | | /// </param> |
| | 407 | | /// <param name='top'> |
| | 408 | | /// The number of segments to return. This value is only valid when |
| | 409 | | /// segment is specified. |
| | 410 | | /// </param> |
| | 411 | | /// <param name='orderby'> |
| | 412 | | /// The aggregation function and direction to sort the segments by. |
| | 413 | | /// This value is only valid when segment is specified. |
| | 414 | | /// </param> |
| | 415 | | /// <param name='filter'> |
| | 416 | | /// An expression used to filter the results. This value should be a |
| | 417 | | /// valid OData filter expression where the keys of each clause should |
| | 418 | | /// be applicable dimensions for the metric you are retrieving. |
| | 419 | | /// </param> |
| | 420 | | /// <param name='customHeaders'> |
| | 421 | | /// The headers that will be added to request. |
| | 422 | | /// </param> |
| | 423 | | /// <param name='cancellationToken'> |
| | 424 | | /// The cancellation token. |
| | 425 | | /// </param> |
| | 426 | | public async Task<HttpOperationResponse<MetricsIntervaledSegmentedResult>> GetIntervaledSegmentedMetricWithHttpM |
| | 427 | | string appId, string metricId, |
| | 428 | | string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), |
| | 429 | | IList<string> aggregation = default(IList<string>), IList<string> segment = default(IList<string>), |
| | 430 | | int? top = default(int?), string orderby = default(string), string filter = default(string), |
| | 431 | | Dictionary<string, List<string>> customHeaders = null, |
| | 432 | | CancellationToken cancellationToken = default(CancellationToken)) |
| | 433 | | { |
| 0 | 434 | | var realResult = await GetWithHttpMessagesAsync(appId, metricId, timespan, interval, aggregation, segment, t |
| 0 | 435 | | var realBody = realResult.Body.Value; |
| 0 | 436 | | return new HttpOperationResponse<MetricsIntervaledSegmentedResult> |
| 0 | 437 | | { |
| 0 | 438 | | Request = realResult.Request, |
| 0 | 439 | | Response = realResult.Response, |
| 0 | 440 | | Body = new MetricsIntervaledSegmentedResult |
| 0 | 441 | | { |
| 0 | 442 | | Start = realBody.Start, |
| 0 | 443 | | End = realBody.End, |
| 0 | 444 | | Interval = realBody.Interval, |
| 0 | 445 | | Intervals = realBody.Segments?.Select(inter => |
| | 446 | | new MetricsSegmentedIntervalData |
| | 447 | | { |
| | 448 | | Start = inter.Start, |
| | 449 | | End = inter.End, |
| | 450 | | Segments = GetSegmentInfo(inter.Segments), |
| | 451 | | } |
| 0 | 452 | | ).ToList() |
| 0 | 453 | | } |
| 0 | 454 | | }; |
| 0 | 455 | | } |
| | 456 | |
|
| | 457 | | #endregion |
| | 458 | | } |
| | 459 | | } |