-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
RouterQueueStatistics.cs
40 lines (37 loc) · 1.34 KB
/
RouterQueueStatistics.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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Linq;
using Azure.Core;
namespace Azure.Communication.JobRouter
{
public partial class RouterQueueStatistics
{
[CodeGenMember("EstimatedWaitTimeMinutes")]
internal IDictionary<string, double> _estimatedWaitTimeMinutes
{
get
{
return EstimatedWaitTimes != null && EstimatedWaitTimes.Count != 0
? EstimatedWaitTimes.ToDictionary(x => x.Key.ToString(), x => x.Value.TotalMinutes)
: new ChangeTrackingDictionary<string, double>();
}
set
{
if (value != null && value.Count != 0)
{
foreach (var estimatedWaitTime in value)
{
EstimatedWaitTimes[int.Parse(estimatedWaitTime.Key)] = TimeSpan.FromMinutes(estimatedWaitTime.Value);
}
}
}
}
/// <summary>
/// The estimated wait time of this queue rounded up to the nearest minute, grouped
/// by job priority
/// </summary>
public IDictionary<int, TimeSpan> EstimatedWaitTimes { get; } = new Dictionary<int, TimeSpan>();
}
}