Legacy Dev Forum Posts

 View Only

Sign Up

Getting tSystemPresence offline time > 24hr when asking for PT24H granularity

  • 1.  Getting tSystemPresence offline time > 24hr when asking for PT24H granularity

    Posted 06-05-2025 18:14

    Jacou | 2018-12-14 17:38:30 UTC | #1

    Hello,

    We are using the postanalyticsusersaggregatesquery from the UsersApi workspace to fetch the different status of an agent throughout the day.

    In which situation would it be possible that the API returns a duration longer than 24hrs for the offline status? For 99% of our calls, the total state of all status will be exactly 24 hrs (we are not mix-matching organization vs system presence) but once in a while we will end up with a offline status that seems off.

    For instance, here is the Json we get back for the following call:

    API: postanalyticsusersaggregatesquery The content of body is:

    {'filter': {'clauses': None, 'predicates': [{'dimension': 'userId', 'metric': None, 'operator': None, 'pcProperty': None, 'propertytype': None, 'range': None, 'type': None, 'value': u'USER-ID-REDACTED'}], 'type': 'or'}, 'flattenmultivalueddimensions': None, 'granularity': 'PT24H', 'groupby': ['userId'], 'interval': '2018-12-09T00:00:00-06:00/2018-12-15T00:00:00-06:00', 'metrics': ['tOrganizationPresence', 'tAgentRoutingStatus', 'tSystemPresence'], 'time_zone': None, 'views': None}

    And then looking at the relevant part of the answer:

    {'interval': '2018-12-13T06:00:00.000Z/2018-12-14T06:00:00.000Z', 'metrics': [{'metric': 'tOrganizationPresence', 'qualifier': '3fd96123-badb-4f69-bc03-1b1ccc6d8014', 'stats': {'count': None, 'current': None, 'denominator': None, 'max': None, 'min': None, 'numerator': None, 'ratio': None, 'sum': 3632587.0, 'target': None}}, {'metric': 'tSystemPresence', 'qualifier': 'AVAILABLE', 'stats': {'count': None, 'current': None, 'denominator': None, 'max': None, 'min': None, 'numerator': None, 'ratio': None, 'sum': 451070.0, 'target': None}}, {'metric': 'tSystemPresence', 'qualifier': 'TRAINING', 'stats': {'count': None, 'current': None, 'denominator': None, 'max': None, 'min': None, 'numerator': None, 'ratio': None, 'sum': 2126651.0, 'target': None}}, {'metric': 'tOrganizationPresence', 'qualifier': '227b37e2-f1d0-4dd0-8f50-badd7cf6d158', 'stats': {'count': None, 'current': None, 'denominator': None, 'max': None, 'min': None, 'numerator': None, 'ratio': None, 'sum': 847084.0, 'target': None}}, {'metric': 'tOrganizationPresence', 'qualifier': 'd2390a99-8546-bad9-8f0a-219548e8aeb0', 'stats': {'count': None, 'current': None, 'denominator': None, 'max': None, 'min': None, 'numerator': None, 'ratio': None, 'sum': 2126651.0, 'target': None}}, {'metric': 'tOrganizationPresence', 'qualifier': '6a3af858-942f-489d-9700-5f9bcdcdae9b', 'stats': {'count': None, 'current': None, 'denominator': None, 'max': None, 'min': None, 'numerator': None, 'ratio': None, 'sum': 451070.0, 'target': None}}, {'metric': 'tOrganizationPresence', 'qualifier': 'bbdff279-7ae1-48ea-bade-7831d7234c64', 'stats': {'count': None, 'current': None, 'denominator': None, 'max': None, 'min': None, 'numerator': None, 'ratio': None, 'sum': 3993962.0, 'target': None}}, {'metric': 'tSystemPresence', 'qualifier': 'MEAL', 'stats': {'count': None, 'current': None, 'denominator': None, 'max': None, 'min': None, 'numerator': None, 'ratio': None, 'sum': 3632587.0, 'target': None}}, {'metric': 'tOrganizationPresence', 'qualifier': 'e08eaf1b-ee47-4fa9-a231-1200e284798f', 'stats': {'count': None, 'current': None, 'denominator': None, 'max': None, 'min': None, 'numerator': None, 'ratio': None, 'sum': 21526244.0, 'target': None}}, {'metric': 'tSystemPresence', 'qualifier': 'MEETING', 'stats': {'count': None, 'current': None, 'denominator': None, 'max': None, 'min': None, 'numerator': None, 'ratio': None, 'sum': 3993962.0, 'target': None}}, {'metric': 'tAgentRoutingStatus', 'qualifier': 'INTERACTING', 'stats': {'count': None, 'current': None, 'denominator': None, 'max': None, 'min': None, 'numerator': None, 'ratio': None, 'sum': 16807550.0, 'target': None}}, {'metric': 'tSystemPresence', 'qualifier': 'OFFLINE', 'stats': {'count': None, 'current': None, 'denominator': None, 'max': None, 'min': None, 'numerator': None, 'ratio': None, 'sum': 89880092.0, 'target': None}}, {'metric': 'tSystemPresence', 'qualifier': 'ON_QUEUE', 'stats': {'count': None, 'current': None, 'denominator': None, 'max': None, 'min': None, 'numerator': None, 'ratio': None, 'sum': 21526244.0, 'target': None}}, {'metric': 'tAgentRoutingStatus', 'qualifier': 'IDLE', 'stats': {'count': None, 'current': None, 'denominator': None, 'max': None, 'min': None, 'numerator': None, 'ratio': None, 'sum': 4832179.0, 'target': None}}, {'metric': 'tSystemPresence', 'qualifier': 'BREAK', 'stats': {'count': None, 'current': None, 'denominator': None, 'max': None, 'min': None, 'numerator': None, 'ratio': None, 'sum': 847084.0, 'target': None}}, {'metric': 'tOrganizationPresence', 'qualifier': 'ccf3c10a-aa2c-4845-8e8d-f59fa48c58e5', 'stats': {'count': None, 'current': None, 'denominator': None, 'max': None, 'min': None, 'numerator': None, 'ratio': None, 'sum': 89880092.0, 'target': None}}], 'views': None}

    Whether we look at the offline tSystemPresence:

    {'metric': 'tSystemPresence', 'qualifier': 'OFFLINE', 'stats': {'count': None, 'current': None, 'denominator': None, 'max': None, 'min': None, 'numerator': None, 'ratio': None, 'sum': 89880092.0, 'target': None}}

    or the corresponding tOrganizationPresence:

    {'metric': 'tOrganizationPresence', 'qualifier': 'ccf3c10a-aa2c-4845-8e8d-f59fa48c58e5', 'stats': {'count': None, 'current': None, 'denominator': None, 'max': None, 'min': None, 'numerator': None, 'ratio': None, 'sum': 89880092.0, 'target': None}}]

    I am having a hard time to understand how the sum can be 89880092.0 --> 24.967 hrs when the requested interval is 24hr.

    Thanks.


    tim.smith | 2018-12-14 22:07:34 UTC | #2

    I checked with the dev team to be sure there wasn't some condition where this would be expected, and they confirmed this doesn't look right. I've opened AR-6738 for this. Since I assume this is causing an issue for you, please open a case with PureCloud Care or work with Zach Hinkle to help prioritize and check on the status.


    Jacou | 2018-12-15 03:10:27 UTC | #3

    Official ticket created. Thanks Tim.


    system | 2019-01-15 03:10:29 UTC | #4

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 4190