Service Virtualization

 View Only
  • 1.  Monitor available coordinator instances

    Posted Jan 12, 2017 07:27 PM

    I've copied my test collateral (.tst and .mar) to my DevTest Server and I can execute them with lisa-invoke.

     

    I'm looking for a programmatic way to call lisa-invoke while there are sufficient coordinator instances available, so I don't flood the server. E.g. if i have a single coordinator with 256 instances, i want to check for available/total instances, and begin calling lisa-invoke until i reach some threshold (like 20 remaining), then wait a bit and poll the server for instances being returned/available and then do lisa-invoke again.

     

    I see https://[host]:[port]/api/Dcm/CoordinatorServers will return info about what's running, but how do i know the total instances available? And, is there a better approach to running tests dynamically on DevTest Server?

     

    Thanks,

    -Jason



  • 2.  Re: Monitor available coordinator instances

    Broadcom Employee
    Posted Jan 17, 2017 03:56 PM

    Hello- 

     

    If you want to monitor the instances, you should be looking at the Simulator.  As far as monitoring instances available, there are ways to monitor this in the Server Console and Workstation.  I am not sure if there is a command you can run that will return the remaining available instances.

     

    Maybe Koustubh.Warty would have an idea?

     

    Thanks- 

    Stephanie



  • 3.  Re: Monitor available coordinator instances

    Posted Jan 17, 2017 05:58 PM

    You can call the swagger service on LISA Invoke 2.0  on the Simulator Service and it will tell you the available capacity and the running instance.   The person who wants the information would have to use swagger and a parser to extract,  but its doable.

     

    http://localhost:1505/api/swagger/

     

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?><SimulatorServer xmlns="http://www.ca.com/lisa/invoke/v2.0" name="Simulator" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ca.com/lisa/invoke/v2.0 SimulatorServer.xsd" href="http://localhost:1505/api/Dcm/SimulatorServers/Simulator" type="application/vnd.ca.lisaInvoke.simulatorServer+xml"><ConsoleURL>tcp://wiljo29-E2254:2010</ConsoleURL><HostAddress>wiljo29-E2254</HostAddress><Status>OK: 0 Simulators running. Memory used 41mb, allocated 105mb, max 569mb (7%) Our cpu usage 0%, system cpu used 4%</Status><AvailableCapacity>256</AvailableCapacity><RunningInstances>0</RunningInstances><Link href="http://localhost:1505/api/Dcm/Labs/LISA:Default" rel="up"/></SimulatorServer>



  • 4.  Re: Monitor available coordinator instances

    Posted Jan 17, 2017 06:22 PM

    Hey Joe, that's exactly what I'm looking for, but it's not working for me. 

     

    We have 8.2 deployed. I see the swagger docs displayed when i go to /api/swagger. If I open the call details for SimulatorServers and CoordinatorServers and add my live Lisa Server host/port, I'm getting the following:

    https://[myHost]:[myPort]/api/Dcm/SimulatorServers   <-- gives 404
    https://[myHost]:[myPort]/api/Dcm/CoordinatorServers  <-- returns current running tests

     

    Any ideas?

    I will also follow up with our server admin and make sure everything is deployed properly.



  • 5.  Re: Monitor available coordinator instances

    Posted Jan 18, 2017 02:23 PM

    Hi Jason,

     

    Didn't have 8.2 installed,  but I did check to see if it was a problem in a prior build  (8.0.2)  and I was able to see a similar result from DevTest 10  (see below)   I expect the 404 is because it could not find the simulator name that was registered with the registry,  or your simulator is down?    I would test the swagger call in the browser.   If you continue to have a problem pulling back the result,  open a ticket and one of us will be able to help you out.

     

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?><SimulatorServer xmlns="http://www.ca.com/lisa/invoke/v2.0" name="Simulator" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ca.com/lisa/invoke/v2.0 SimulatorServer.xsd" href="http://localhost:1505/api/Dcm/SimulatorServers/Simulator" type="application/vnd.ca.lisaInvoke.simulatorServer+xml"><ConsoleURL>tcp://10.132.141.46:2010</ConsoleURL><HostAddress>10.132.141.46</HostAddress><Status>OK: 0 Simulators running. Memory used 93mb, allocated 193mb, max 455mb (20%) Our cpu usage 6%, system cpu used 8%</Status><AvailableCapacity>256</AvailableCapacity><RunningInstances>0</RunningInstances><Link href="http://localhost:1505/api/Dcm/Labs/LISA:Default" rel="up"/></SimulatorServer>

     

    I



  • 6.  Re: Monitor available coordinator instances
    Best Answer

    Posted Jan 18, 2017 02:26 PM

    Thanks Joe. It was a permissions issue on the server with this one API, strangely enough. Worked with Server Admin and resolved it. 

     

    The returned info from this call is what I was looking for. I should be able to pull the <AvailableCapacity>256</AvailableCapacity><RunningInstances>0</RunningInstances> and then do async lisa-invokes on my mar files with much more control.

     

    Thanks!

    -Jason