Author Topic: Problems with StatServer and GIS stat sdk  (Read 10658 times)

pacohlopez

  • Guest
Problems with StatServer and GIS stat sdk
« on: May 28, 2007, 03:58:04 PM »
I´m tirying to get some stats with GIS for Agent Groups and Queues, I can get the stats but after some time I get the exception "Peek Stat Timeout" and after some exceptions like this one, The CCpulse disconnects from StatServer and I get the message "StatServer out of service" at the GIS log.
I'm running a thread for each stat I need, so the exception occurs for each thread at diferent times.
I'm using java, statserver 7.1 and GIS 7.2.
Why I'm geting a timeout? my tests are retrieving only 5 stats, and I'll need 60.
What do I have to do for the exception? a delay?

Thanks in advance

pacohlopez

  • Guest
Re: Problems with StatServer and GIS stat sdk
« Reply #1 on: May 28, 2007, 06:45:11 PM »
We have only one license for GIS Stats, Do we need a license for each stat we need?

Marked as best answer by on Today at 05:56:56 AM

Offline victor

  • Administrator
  • Hero Member
  • *****
  • Posts: 1416
  • Karma: 18
Re: Problems with StatServer and GIS stat sdk
« Reply #2 on: May 29, 2007, 01:34:09 AM »
  • Undo Best Answer
  • Hi!

    I used to have timeouts with GIS all the time, and the only way I managed to handle it was through handling exceptions and then reconnecting to GIS and trying again.

    Can you post GIS and StatServer logs for when it happens?

    Thanks,
    Vic

    pacohlopez

    • Guest
    Re: Problems with StatServer and GIS stat sdk
    « Reply #3 on: May 29, 2007, 04:33:34 PM »
    Hi
    This are logs at the moment that problem occurs.

    [color=yellow]GIS Log[/color]

    17:57:39.308 Dbg 20013 call to login method for  default -> SessionService:1180133859308H2
    17:57:39.495 Dbg 20012 Checking out feature GIS_STATSERVICE in 7260@CTI01: OK
    17:57:39.495 Dbg 20012 SessionService:1180133859308H2 -> license GIS_STATSERVICE checked
    17:59:48.823 Std 04504 Connection to Stat server 'ReportingStatServer' at host 'CTI02', port 3420 lost
    17:59:57.573 Std 04503 Connected to Stat Server 'ReportingStatServer' at host 'CTI02', port 3420
    17:59:57.573 Dbg 20012 SOpenServerEx: ReportingStatServer@CTI02:3420
    18:00:18.323 Dbg 20012 retrieveStatistic java.lang.Exception: PeekStat Timout
    18:00:18.355 Dbg 20012 retrieveStatistic java.lang.Exception: PeekStat Timout
    18:00:18.370 Dbg 20012 retrieveStatistic java.lang.Exception: PeekStat Timout
    18:02:20.558 Std 04504 Connection to Stat server 'ReportingStatServer' at host 'CTI02', port 3420 lost
    18:02:26.370 Dbg 20012 retrieveStatistic java.lang.Exception: PeekStat Timout
    18:02:26.495 Dbg 20012 retrieveStatistic java.lang.Exception: StatServer out of service
    18:02:26.495 Dbg 20012 retrieveStatistic java.lang.Exception: StatServer out of service
    18:02:26.542 Dbg 20012 retrieveStatistic java.lang.Exception: StatServer out of service



    [color=yellow]StatServer LOG[/color]

    18:01:22.258 Trc 04541 Message NewAPIGetStat received from 308 ( 'GIS')
    18:01:22.258 Trc 04541 Message NewAPIGetStat received from 308 ( 'GIS')
    18:01:22.289 Trc 04541 Message NewAPIGetStat received from 308 ( 'GIS')
    18:01:24.133 Trc 04541 Message NewAPIGetStat received from 308 ( 'GIS')
    18:01:24.164 Trc 04541 Message NewAPIGetStat received from 308 ( 'GIS')
    18:01:46.930 Int 04543 Interaction message "EventReleased" received from 65200 ("TServerAlcatel")
    18:01:53.820 Int 04543 Interaction message "EventOffHook" received from 65200 ("TServerAlcatel")
    18:01:54.289 Trc 04541 Message NewAPIGetStat received from 308 ( 'GIS')
    18:01:54.305 Trc 04541 Message NewAPIGetStat received from 308 ( 'GIS')
    18:01:54.320 Trc 04541 Message NewAPIGetStat received from 308 ( 'GIS')
    18:01:54.508 Int 04543 Interaction message "EventOnHook" received from 65200 ("TServerAlcatel")
    18:01:54.711 Int 04543 Interaction message "EventAgentReady" received from 65200 ("TServerAlcatel")
    18:01:56.164 Trc 04541 Message NewAPIGetStat received from 308 ( 'GIS')
    Signal 0xC0000005 received
    ...exception in block [NCO_exec]

    ----FAULT----05/25/07@18:01:56.1640----
    Exception: 5 (0xc0000005) ACCESS_VIOLATION
    AddrPC:    005d5c35
    AddrFrame: 014632c8
    AddrStack: 014632ac

    005d5c35 statserv:___sbh_free_block+371(17e4554,22fa9bc,17eda90,22fa710..)
    005d22f8 statserv:_free+89(22fab00,1463328,49ce0c,670cc0..)
    004a34f8 statserv:_tmemory_pool_free+108(670cc0,22fab00,146333c,49cdaa..)
    0049ce0c statserv:_msg_delete+143(22fab00,22fab00,22fab20,1463348..)
    0049cdaa statserv:_msg_delete+45(22fa710,1463398,404132,22fa710..)
    005bfe7c statserv:_MessageDelete+12(22fa710,22f9070,22f9070,212acb0..)
    00404132 statserv:CLIENT::NewAPIStatsHandle+1522(17eda90,22f9070,212acb0,22f8c60..)
    .. file N:\statserver\main\client.cpp, line 1867 (disp=0)
    00401985 statserv:CLIENT::Message+725(22f9070,146f588,1940cf0,0..)
    .. file N:\statserver\main\client.cpp, line 850 (disp=0)
    00401611 statserv:CLIENT::Request+193(997e00,146f4d8,4a0e27,212c930..)
    .. file N:\statserver\main\client.cpp, line 370 (disp=0)
    004a1034 statserv:?conn_do_multi_scan@@YAHHHPAUfd_set@@H@Z+3345(212c930,146f588,1940cf0,1463434..)
    004a0e27 statserv:?conn_do_multi_scan@@YAHHHPAUfd_set@@H@Z+2820(790,ffffffff,0,ffffffff..)
    004a16c3 statserv:_conn_main_loop+75(118ade8,118d8f8,74617473,76726573..)
    00574d30 statserv:_NCO_exec+1177(146f5b8,1,7,146f82c..)
    00574a3e statserv:_NCO_exec+423(146f82c,118ade8,118d8f8,74617473..)
    00405ab4 statserv:ServerMainLoop+116(145b78,146f8d0,118ade8,1162d90..)
    .. file N:\statserver\main\main_m.cpp, line 131 (disp=41)
    00405957 statserv:sserver_main+775(9,118ade8,0,9..)
    .. file N:\statserver\main\main_m.cpp, line 629 (disp=11)
    00574ca8 statserv:_NCO_exec+1041(146f900,0,0,146faac..)
    00574a3e statserv:_NCO_exec+423(146faac,9,118ade8,0..)
    00573afd statserv:_NCO_main+989(9,118ade8,0,405650..)
    00405610 statserv:g_run_app_my+80(9,118ade8,0,146ff84..)
    .. file N:\statserver\main\main_m.cpp, line 682 (disp=16)
    004055b9 statserv:g_run_app+41(9,118ade8,146fb64,1162d90..)
    .. file N:\statserver\main\main_m.cpp, line 690 (disp=15)
    00590537 statserv:?main_thread@@YAXPAX@Z+648(0,0,0,1162d90..)
    005d8845 statserv:__beginthread+206(1162d90,0,0,1162d90..)
    77e6608b kernel32:GetModuleFileNameA+235(5d87ee,1162d90,0,c8..)
    -----------END-OF-FAULT-INFO-----------


    I think that StatServer goes down when the access violation occurs because I found many small log files around the time of this problem.

    Thanks for your help

    Offline René

    • Administrator
    • Hero Member
    • *****
    • Posts: 1832
    • Karma: 62
    Re: Problems with StatServer and GIS stat sdk
    « Reply #4 on: May 29, 2007, 06:36:37 PM »
    Hi,

    Your outcome is right. StatServer crashes down when it receives one of "Subscribe" requests from GIS. Based on log I would say that the request contains something wrong and StatServer is unable to handle it.

    Please check that your request is valid and well formatted. If it's possible then try to install newer version of StatServer and make test using that version. Definitely it isn't correct that StatServer crashes down.

    René

    Peter J

    • Guest
    Re: Problems with StatServer and GIS stat sdk
    « Reply #5 on: May 30, 2007, 09:02:04 AM »
    Ok,

    18:01:56.164 Trc 04541 Message NewAPIGetStat received from 308 ( 'GIS')
    Signal 0xC0000005 received
    ...exception in block [NCO_exec]

    ----FAULT----05/25/07@18:01:56.1640----
    Exception: 5 (0xc0000005) ACCESS_VIOLATION
    AddrPC:    005d5c35
    AddrFrame: 014632c8
    AddrStack: 014632ac

    005d5c35 statserv:___sbh_free_block+371(17e4554,22fa9bc,17eda90,22fa710..)

    is a violation caused by NewApiGetStat.
    Can you show the content of NewApiGetStat?
    Also, please show the excerpt where you are issuing this command. I would watch for a null as one of the variables.

    pacohlopez

    • Guest
    Re: Problems with StatServer and GIS stat sdk
    « Reply #6 on: June 01, 2007, 01:37:04 PM »
    Hi VIc
    the content of NewApiGetStat is the java code where I'm geting the stats?

    pacohlopez

    • Guest
    Re: Problems with StatServer and GIS stat sdk
    « Reply #7 on: June 01, 2007, 11:55:41 PM »
    HI VIc

    This is the exerpt of my code:

    Statistic statistic = new Statistic();
    statistic.setStatisticId("statref1");
    ObjectIdType objectId = new ObjectIdType();
    objectId.setId(obID);
    objectId.setTenantName("Resources");
    statistic.setObjectId(objectId);
    Metric metric = new Metric();
    StatisticType statisticType = new StatisticType();
    if (obtype.equalsIgnoreCase("Queue")) {
    ObjectType[] objectType = new ObjectType[] {ObjectType.Queue};
    statisticType.setObjectType(objectType);
    //System.out.println(obtype);
    }else if (obtype.equalsIgnoreCase("GroupAgents")){
    ObjectType[] objectType = new ObjectType[] {ObjectType.GroupAgents};
    statisticType.setObjectType(objectType);
    //System.out.println(obtype);
    }else{
    ObjectType[] objectType = new ObjectType[] {ObjectType.GroupAgents};
    statisticType.setObjectType(objectType);
    }
    metric.setStatisticType(statisticType);
    metric.setTypeName(metrica);
    TimeInterval timeInterval = new gis.services.statistic.TimeInterval();
    timeInterval.setIntervalType(TimeIntervalType.GrowingWindow);
    metric.setInterval(timeInterval);
    statistic.setMetric(metric);
    Schedule schedule = new Schedule();
    schedule.setNotificationMode(ScheduleMode.ChangesBased);
    schedule.setInsensitivity(0);
    schedule.setTimeout(5);
    statistic.setSchedule(schedule);
    RetrieveStatisticResponse retStat = null;

    if (statPort == null){
    Thread.sleep(33000);
    }
    try {
    retStat = statPort.retrieveStatistic(statistic,
    "GISStatServer");
    System.out.println("retstat1");
    } catch (RemoteException e) {
    //logueo.escribe(e.getMessage());
    e.printStackTrace();
    }
    StatisticValue stat = retStat.getStatisticValue();
    while(alive){
    try {
    Thread.sleep(32000);
    } catch (InterruptedException interruptedexception) {
    }

    // the second call retrieves the statistic.

    try {
    retStat = statPort.retrieveStatistic(statistic,
    "GISStatServer");
    System.out.println("retstat2");
    } catch (RemoteException e) {
    //logueo.escribe(e.getMessage());
    System.out.println(e.getMessage());
    //e.printStackTrace();
    }
    stat = retStat.getStatisticValue();
    valor_act = stat.getEventValues()[0].getLValue();
    System.out.println(valor_act);


    Thanks