Author Topic: Stats - Get Total Time by Reason Code  (Read 7562 times)

Offline federom

  • Newbie
  • *
  • Posts: 16
  • Karma: 0
Stats - Get Total Time by Reason Code
« on: July 09, 2013, 05:39:43 PM »
Hello All,
            How can i get the total time spent by certain user in an specific Not Ready Reason code?

Any clue?

Thanks!

Offline René

  • Administrator
  • Hero Member
  • *****
  • Posts: 1832
  • Karma: 62
Re: Stats - Get Total Time by Reason Code
« Reply #1 on: July 09, 2013, 08:05:12 PM »
Hi,

You have to define a filter and apply it to TotalTime in NotReady status statistic.

R.

Offline federom

  • Newbie
  • *
  • Posts: 16
  • Karma: 0
Re: Stats - Get Total Time by Reason Code
« Reply #2 on: July 10, 2013, 12:31:59 PM »
Thanks Rene!

How do i define the filter ? Right now what i have is


[code]
            req.StatisticObject = StatisticObject.Create();
            req.StatisticObject.ObjectType = StatisticObjectType.Agent;
            req.StatisticObject.TenantName = "Resources";
            req.StatisticObject.ObjectId = "UserID";
           

            req.StatisticMetric = StatisticMetric.Create();
            req.StatisticMetric.StatisticType = "TotalNotReadyStatusTime";
           

            req.ReferenceId = 2;

            protocolManagment[statServerConfigName].Send(req);[/code]

Thanks!

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: Stats - Get Total Time by Reason Code
« Reply #3 on: July 10, 2013, 12:50:37 PM »
Remember you have:

Metric applied to an object = Statistic

So on StatisticMetric you define filter too as you would do on CCPulse for example and there you go ;)
You can find more info on the PSDK doc that inside the Doc folder on the install path


Offline federom

  • Newbie
  • *
  • Posts: 16
  • Karma: 0
Re: Stats - Get Total Time by Reason Code
« Reply #4 on: July 10, 2013, 04:01:59 PM »
[quote author=cavagnaro link=topic=7895.msg34493#msg34493 date=1373460637]
Remember you have:

Metric applied to an object = Statistic

So on StatisticMetric you define filter too as you would do on CCPulse for example and there you go ;)
You can find more info on the PSDK doc that inside the Doc folder on the install path
[/quote]

Thanks cavagnaro !

i have created a Filter in the stat Server as

Name = LunchTime
Value= ExtensionReasonCode="Lunch"

Then i did the call

[code]'RequestGetStatistic' ('1033')
message attributes:
StatisticObject = ComplexClass(StatisticObject):
TENANT_PASSWORD [str] = [output suppressed]
OBJECT [int]    = 0 [Agent]
TENANT_ID [str] = "Resources"
OBJECT_ID [str] = "891536"
StatisticMetric = ComplexClass(StatisticMetric):
STATTYPE [str]  = "TotalNotReadyStatusTime"
ACTION_FILTER [str] = "LunchTime"
REQ_ID [int]    = 2
VOID_VALUE [bstr] = KVList:
'Filter' [str] = "LunchTime"

'EventInfo' ('2')
message attributes:
REQ_ID [int]    = 2
USER_REQ_ID [int] = -1
TM_SERVER [int] = 1373470691
TM_LENGTH [int] = 190
LONG_VALUE [int] = 0
STRING_VALUE [str] = "0"

[/code]

But i think that the Value is not correct despite i dont receive an error response.

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: Stats - Get Total Time by Reason Code
« Reply #5 on: July 10, 2013, 04:20:10 PM »
Does it work on CCPulse?
Try that first. When you have values on CCPulse you can go to your development

Offline federom

  • Newbie
  • *
  • Posts: 16
  • Karma: 0
Re: Stats - Get Total Time by Reason Code
« Reply #6 on: July 10, 2013, 05:58:37 PM »
Yes, i am trying that also but i always get 0 (Despite of the fact that i know that the user has been at Lunch as NotReady Reason Code)

This means that i defined the Filter in a wrong way, or something else it is going on...

I will keep trying, Thanks for all your help !!

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: Stats - Get Total Time by Reason Code
« Reply #7 on: July 10, 2013, 06:03:25 PM »
Check TServer logs, compare the KVPs

Offline federom

  • Newbie
  • *
  • Posts: 16
  • Karma: 0
Re: Stats - Get Total Time by Reason Code
« Reply #8 on: July 10, 2013, 07:08:09 PM »
[quote author=cavagnaro link=topic=7895.msg34503#msg34503 date=1373479405]
Check TServer logs, compare the KVPs
[/quote]

I checked that also. I also checked Stat Server Documentation and it says..

[quote]• ExtensionReasonCode != 12 (or Reason != 12) returns True if the
Extension TEvent returns a key-value pair of ReasonCode (the key)
and its accompanying value which is equal to a value other than 12.
From 8.0 release, Stat Server supports less than or equal, greater than or
equal, greater than, less than expressions for numeric operands. For
example:[/quote]

So I set up the Filter as

Option Name : LunchTime
Option Value : Reason = 4


From my app when i change to lunch i receive;

[code]2013-07-10 15:57:19,511 MOSAIC DEBUG [THREAD : SelectorThread] - Proxy got message 'EventAgentNotReady' ('76')
message attributes:
AttributeThisDN [str] = "7016"
AttributeReasons [bstr] = KVList:
'Lunch' [int] = 4
CallHistory    = ComplexClass(CallHistoryInfo):
LastParty      = ComplexClass(LastRemoteParty):
FirstParty      = ComplexClass(FirstRemoteParty):
AttributeExtensions [bstr] = KVList:
'AgentSessionID' [str] = "EOI98SBB6T77N1ECVMFKESAVG4011VQG"
AttributeEventSequenceNumber [long] = 4732958
AttributeAgentID [str] = "fromero"
AttributeReferenceID [int] = 4
Time            = ComplexClass(TimeStamp):
AttributeTimeinuSecs [int] = 817000
AttributeTimeinSecs [int] = 1373482639
AttributeAgentWorkMode [int] = 4 [AuxWork]
[/code]

Meanwhile, at TServer, I can see

[code]15:57:19.817 Trc 04541 RequestAgentNotReady received from [660] (0000020d MosaicDesktop 10.135.103.118:58848)
message RequestAgentNotReady
AttributeReason [16] 00 01 01 00..
'Lunch' 4
AttributeReferenceID 4
AttributeAgentWorkMode 4 (AuxWork)
AttributeThisDN '7016'
@15:57:19.8170 [gctmi] Distributing request RequestAgentNotReady
@15:57:19.8170 [tsgctm] AgentLogin [7016,idfromero,sNRDY] softAgent: sending not-ready.
@15:57:19.8170 [gctmi] AgentLogin [7016,idfromero,sNRDY] distributing EventAgentNotReady
@15:57:19.8170 [gctmi] AgentLogin [7016,idfromero,sNRDY] processNotReady
@15:57:19.8170 [gctmi] request RequestAgentNotReady ctiRefId 324832 removed from reqMgr
@15:57:19.8170 [0] 8.1.001.06 distribute_response: message EventAgentNotReady
AttributeExtensions [53] 00 01 00 00..
'AgentSessionID' 'EOI98SBB6T77N1ECVMFKESAVG4011VQG'
AttributeEventSequenceNumber 000000000048381e
AttributeTimeinuSecs 817000
AttributeTimeinSecs 1373482639 (15:57:19)
AttributeThisDN '7016'
AttributeAgentWorkMode 4 (AuxWork)
AttributeAgentID 'fromero'
AttributeReason [16] 00 01 01 00..
'Lunch' 4
AttributeReferenceID 4[/code]


but later when i call the stats, with the filter, i receive 0

[code]'RequestGetStatistic' ('1033')
message attributes:
StatisticObject = ComplexClass(StatisticObject):
TENANT_PASSWORD [str] = [output suppressed]
OBJECT [int]    = 0 [Agent]
TENANT_ID [str] = "Resources"
OBJECT_ID [str] = "891536"
StatisticMetric = ComplexClass(StatisticMetric):
STATTYPE [str]  = "TotalNotReadyStatusTime"
ACTION_FILTER [str] = "LunchTime"
REQ_ID [int]    = 2
VOID_VALUE [bstr] = KVList:
'Filter' [str] = "LunchTime"

'EventInfo' ('2')
message attributes:
REQ_ID [int]    = 2
USER_REQ_ID [int] = -1
TM_SERVER [int] = 1373482781
TM_LENGTH [int] = 4387
LONG_VALUE [int] = 0
STRING_VALUE [str] = "0"[/code]


I am quite lost (and new with Stat Server)

Thanks for all your help on this!

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: Stats - Get Total Time by Reason Code
« Reply #9 on: July 10, 2013, 07:48:12 PM »
Your KVP is LUNCH = 4
So your filter should be

PairExists("LUNCH","4")

Offline federom

  • Newbie
  • *
  • Posts: 16
  • Karma: 0
Re: Stats - Get Total Time by Reason Code
« Reply #10 on: July 10, 2013, 08:42:06 PM »
[quote author=cavagnaro link=topic=7895.msg34511#msg34511 date=1373485692]
Your KVP is LUNCH = 4
So your filter should be

PairExists("LUNCH","4")
[/quote]

Excellent!!!!! IT works!!!

Thanks forma all your help!!