Wowza Community

Rest API isn't giving the correct bytesIn and bytesOUT

I tried this on many different versions of wowza including 4.8.5 and earlier, I tried on origin and edge servers. Live applications are working fine, you can watch them. Other rest API calls are working fine, except the one which gives the bytes in and bytes out

curl_setopt($ch, CURLOPT_URL, "http://" . $domain . ":8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/" . $appName . "/instances/_definst_/incomingstreams/myStream/monitoring/current");

It returns this

array (
  'serverName' => '_defaultServer_',
  'applicationInstance' => '_definst_',
  'name' => 'myStream',
  'uptime' => 0,
  'bytesIn' => 0,
  'bytesOut' => 0,
  'bytesInRate' => 0,
  'bytesOutRate' => 0,
  'totalConnections' => 0,
  'connectionCount' => 
  array (
    'RTMP' => 0,
    'MPEGDASH' => 0,
    'CUPERTINO' => 0,
    'SANJOSE' => 0,
    'SMOOTH' => 0,
    'RTP' => 0,
  ),

I also tried this

curl_setopt($ch, CURLOPT_URL, "http://" . $domain . ":8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/instances/_definst_/incomingstreams/". $appName ."/monitoring/current");

Same result, only the name changes. I want to pass a live application name and get the bytesIn and bytesOut for that application, I don’t want to get 0.

Where should I pass the parameter for the curl request?

hmmmm…let me see what I can find out on why it’s returning zero values. I know that bytes in and out is not available yet through the REST API for either stream targets or smil files in adaptive bitrate, but doesn’t appear to be what you’re doing from what I can see. Be back when I have more info.

I’m only interested in gettings bytes in and out for an application so that we can automate its restart process when it stops working,

Take your time and thank you so much for your help

I had an engineer check and they said; http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/monitoring/current

Updates the BytesIn and BytesOut, till there’s an Application restart. Then goes back to zero.

That is where your problem is maybe? The automated restart process you wish to implement? If further assistance is needed with potential ways to configure that, we’ll need a ticket to test it out. It may require some custom work.

I don’t think so, I think you’re saying that if I restart the application, they’ll go back to 0, but I haven’t restarted anything yet. I’m trying to get the correct bytesIn and out, and based upon that data I should then restart.

But since the data I’m getting is wrong, I didn’t call the restart function, I stopped writing the program and came here to ask about it.

I see… Well then I guess our only option is a support ticket according to the engineer who looked at it. He want to see why it’s working for him and not for you. So sorry it’s returning zeros.

1 Like

Okay will do that, thank you