[quote author=hsujdik link=topic=12333.msg54989#msg54989 date=1659825141]
[quote author=CallMeMaybe link=topic=12333.msg54987#msg54987 date=1659718360]
[quote author=hsujdik link=topic=12333.msg54986#msg54986 date=1659708228]
I wouldn't recommend using RequestGetStatistic for cumulative statistics (TotalNumber, TotalTime, AverageNumber, etc). It works well for Current numbers, but can have some weird behavior when using with cummulative numbers.
Instead, use RequestOpenStatistic (or RequestOpenStatisticEx) and handle the EventInfo in your EventHandler function.
Take a look on this code that could be similar to your needs:
http://www.sggu.com/smf/index.php/topic,12271.msg54747.html#msg54747
[/quote]
Hey!
When you say cumulative, you mean TotalNumber being total inbound and outbound calls? Maybe there is another statistic I could pull? I am really only looking for the amount of inbound calls the agent has received on the day I run my application, I also don't want to periodically listen for events I just kind of want to read it and then close it.
Is there any example for Current number because I am not sure what you mean by that? (I thought Totalnumber of CallsAnswered was current number)
[/quote]
TotalNumber is a cummulative (or rather, aggregated) statistic. All the statistics that has some amount calculated over time is a cummulative/aggregated statistic. For instance - Total Number of call answered = total number since when?? Then, the TimeProfile comes into play, to let StatServer know the span which the numbers are valid. The Default time profile, for example, is a Growing profile that resets at midnight. You can have different ones, like "SinceLogin", or a Window of time (e.g. last 24 hours, last 1 hour, total within the hour, etc).
That said, for all those aggregated statistics, statserver needs to know that they will be needed and they need to be persisted. And that's where the RequestOpenStatistic comes into play.
Per the Stat Server's users guide:
[quote]
Persistent Statistics
The term persistence means that a statistic, once requested by a client, continues to be calculated even after the client disconnects. Stat Server treats all requested statistics as persistent. When a statistic that is not already available on the server side is requested, it is automatically added to the Persistent Statistic Pool. Stat Server continues to calculate the statistic even after the requesting client closes it. When the client reopens the request for this statistic, the Persistent Statistic Pool resends it with accurate values to the client. By default, a statistic becomes obsolete and is removed from this pool three days after a client last requested it.
[/quote]
Now, If somebody had opened this statistic* before within the last 3 days, you should receive the correct return either with RequestOpenStatistic or RequestGetStatistic. However, my suggestion was merely because I have seen before RequestGetStatistic not as it should sometimes, so I always take the RequestOpenStatistic approach for any cummulative/aggregated statistic. Should you really need to get with RequestGetStatistic and are getting wrong values (given that this Very Same Statitistic* has been used in the previous 3 days), you should talk to Genesys Technical Support because might be some bug.
Now, I have marked "statistic" with an * for the following reason:
An statistic means a combination of things, and if one of those things is different, it is another statistic:
Object + Statistical Type + Time Profile + Time Range(s) (when applicable) + Filter, being Statistical Type a combination of Category + Main Mask + Relative Mask + Formula
So, for example, if you have used an statistic with Time Profile "A" in the past, it is still open, and then you need the very same data for the same object, but with Time Profile "B", it will start counting from the time you first requested (and will continue for as long as Stat Server keeps it open).
[/quote]
I tried this without luck, I tried to add a while loop that does .Receive and prints message, I see EventStatisticOpened, EventServerMode and then EventInfo, but the data in EventInfo is not correct unfortunately. Loop is not shown on picture but here is my configurations
Edit: after further testing, it seems to open the statistic but it starts from 0 as if I opened a completely new statistic (maybe I misconfigured it somehow?). I want to tap into the already opened one from cc pulse
my code:
[img width=380 height=480]https://i.imgur.com/zhLmyFm.png[/img]
stat I wanted taken from cc pulse:
[img]https://i.imgur.com/aT9mZcF.png[/img]
[quote author=cavagnaro link=topic=12333.msg54988#msg54988 date=1659729282]
If you want to read and close then you are asking for Historical info, not real time.
Real time metrics are only populated by StatServer upon an application requests it to monitor such Metric. Unless you copy exactly what CCPulse is doing and requesting, you need to monitor your own Metric, which will begin to populate since the moment you request it.
[/quote]
this is exactly what I want to do, I want to take the exact same statistic that our cc pulse has