Bent_Slyngstad | 2017-03-14 16:34:04 UTC | #1
Can someone comment on how often PureCloud update the Agent stats ?
For example if I fetch agent stats at 11:00 for the time period of 10:30-11:00, do they update the stats for this time period later on? This is important to understand how back in time I should aggregate the data.
tim.smith | 2017-03-14 16:35:41 UTC | #2
What API request are you using?
Bent_Slyngstad | 2017-03-15 18:59:46 UTC | #3
This is the request:
apiInstance.PostUsersAggregatesQuery(body);
tim.smith | 2017-03-15 19:06:40 UTC | #4
If you are querying for an interval that exists completely in the past, the aggregate data should not change. If the interval contains the current time, the aggregate data will be different every time you request it because the data is different (time has elapsed between requests).
Bent_Slyngstad | 2017-03-21 07:29:46 UTC | #5
Sorry for late answer. The issue is related to when the data is first available. For example;
Time: 12:00 We look up data for 11:30 - 12:00. The data might not be ready - but data for 11:00 - 11:30 is for example avialable.
The question is how long to wait before quering for data for an interval.
Thanks so far Tim
Bent
tim.smith | 2017-03-21 15:08:39 UTC | #6
Bent_Slyngstad, post:5, topic:1043
The question is how long to wait before quering for data for an interval.
You have to wait until the data won't change anymore. :) I can't give you an exact timeframe because I can't tell you when all of your conversations will conclude. If someone has a conversation active for 5 hours, it could impact the statistics for any of those intervals and you'd have to wait until that conversation is completed to get the "final" data for the last 5 hours.
This is a decision you'll have to make for yourself in the context of how your business operates and what you consider a typical handle time. You could regenerate the stats for every interval in the day at every interval and then compare them to see how much and how often they change. That should give you a decent baseline to determine how long you need to wait until the data for an interval can reliably be considered complete.
Bent_Slyngstad | 2017-03-31 14:12:42 UTC | #7
We do miss data in periods. The dates are - in March: 7, 9, 14, 15, 17, 20, 21, 23, 27, 28, & 29.
As the screenshot shows - we miss data after 16:30. Why should we experience that ?
<img src="//inin-prod-use1-developerforum.s3.amazonaws.com/original/1X/1f6c2f68c465b9a471427f017f6cf08f987a4e83.jpg" width="690" height="342">
tim.smith | 2017-03-31 15:25:13 UTC | #8
Can you provide more information about the queries you're doing (what resource and the request body)? Are you making the request for the missing interval during the interval or after it, and do you ever get data for that interval if you query for it later (i.e. the next day)?
sajidali | 2017-04-03 14:20:14 UTC | #9
Hi Tim,
I am using below queries to fetch the data. I am fetching full day of data with every request, but i am still not getting the complete adherence. However if i fetch the data next day, then the information is complete.
var apiInstance = new AnalyticsApi();
var body = new AggregationQuery();
body.Interval = lastLogDateTime.ToUniversalTime().ToString("s", CultureInfo.InvariantCulture) +
"/" +
lastLogDateTime.AddDays(_daysForward).ToUniversalTime().ToString("s", CultureInfo.InvariantCulture);
body.GroupBy = new List<AggregationQuery.GroupByEnum> { AggregationQuery.GroupByEnum.Userid };
body.Granularity = _granularity;
body.FlattenMultivaluedDimensions = true;
var splittedList = usersList.Split(Convert.ToInt16(_usersListDivision));
foreach (var ids in splittedList)
{
var analyticsQueryFilter = new AnalyticsQueryFilter(AnalyticsQueryFilter.TypeEnum.Or, new List<AnalyticsQueryClause>());
foreach (var userId in ids)
{
analyticsQueryFilter.Clauses.Add(new AnalyticsQueryClause(AnalyticsQueryClause.TypeEnum.Or,
new List<AnalyticsQueryPredicate>()
{
new AnalyticsQueryPredicate
(
AnalyticsQueryPredicate.TypeEnum.Dimension,
AnalyticsQueryPredicate.DimensionEnum.Userid,
Value: userId//"7cec5fff-da85-4c7e-88a9-e2a16b9f08e4"
)
}));
}
body.Filter = analyticsQueryFilter;
var result = apiInstance.PostUsersAggregatesQuery(body);
var dataTable = db.PostUsersAgg();
}
sajidali | 2017-04-03 07:44:45 UTC | #10
And just to let you know, the missing of adherence information is not always true for all agents, it happens randomly. As i am fetching the full day of data, it shouldn't matter if adherence information is updated later on PureCloud side, however i am also doing aggregation inside our application, for which its good to know how far back in time should i consider that update can happen.
tim.smith | 2017-04-03 14:26:37 UTC | #11
Thanks for providing the info. I don't see anything obviously wrong with your query. I'm not sure if the value for lastLogDateTime will necessarily line up with your granularity, but it should. E.g. don't make your interval 10:00 to 10:41 if your interval is 15 minutes; it may produce unexpected results.
sajidali, post:10, topic:1043
the missing of adherence information is not always true for all agents, it happens randomly.
This is good to know and confirms that your query is probably fine and there's some server side issue or condition that is causing the issue. Missing data problems when your query is correct typically need to be handled by PureCloud support. If you can open a ticket with them, they can investigate further. Thanks!
sajidali | 2017-04-04 07:31:02 UTC | #12
Thanks Tim. The lastLogDateTime is a local variable to store the date until data is being fetched. Then we use this variable for internal calculations.
I will definitely contact PureCloud support if needed, but can you please explain what is the frequency of agent data update in purecloud? For example an agent working from 16:00 AM-16:30 AM, what is the maximum time until PureCloud is finished with the aggregation for this time period? Is it next few hours you are doing the aggregation or is it depends on the number of agents etc, and can possibly stretch to next day?
Thanks.
Bent_Slyngstad | 2017-04-04 08:21:31 UTC | #13
Thanks both for beeing so solution oriented in this. I believe Tim answered the issue here above with this; "I can't give you an exact timeframe because I can't tell you when all of your conversations will conclude. If someone has a conversation active for 5 hours, it could impact the statistics for any of those intervals and you'd have to wait until that conversation is completed to get the "final" data for the last 5 hours."
If opening a support case - maybe I will have to do it, anyway - they will ask for logs, Id's etc - part of the fun really
sajidali | 2017-04-04 08:58:28 UTC | #14
Thanks Bent, But i still want to understand is there any limitation on PureCloud to aggregate the past data? Lets say a call is 5 hours long( which is very rare case), and it will be aggregated after 5 hours, but will this also impact other agents working in the same interval? Is the aggregation is based on per agent per interval or per interval for all agents?
tim.smith | 2017-04-04 21:01:54 UTC | #15
The data is stored as raw data and aggregated in real-time when you execute an aggregate query. When you make an aggregate query, the data should be accurate as of that moment. If you make the same query again, it's possible that you'll get a different result if the source data has changed.
sajidali | 2017-04-05 06:52:54 UTC | #16
Thank you Tim for the clarification.
system | 2017-08-28 19:32:58 UTC | #17
This post was migrated from the old Developer Forum.
ref: 1043