Wowza Community

Meaning of the /connectioncounts API

Hi, i used “http://ip::8086/connectioncounts” api

and return

{
	"WowzaStreamingEngine": {
		"ConnectionsCurrent": "1",
		"ConnectionsTotal": "22",
		"ConnectionsTotalAccepted": "22",
		"ConnectionsTotalRejected": "0",
		"MessagesInBytesRate": "0.0",
		"MessagesOutBytesRate": "0.0",
		"VHost": {
			"Name": "_defaultVHost_",
			"TimeRunning": "79163.891",
			"ConnectionsLimit": "0",
			"ConnectionsCurrent": "0",
			"ConnectionsTotal": "14",
			"ConnectionsTotalAccepted": "14",
			"ConnectionsTotalRejected": "0",
			"MessagesInBytesRate": "0.0",
			"MessagesOutBytesRate": "0.0",
			"Application": {
				"Name": "live",
				"Status": "loaded",
				"TimeRunning": "77862.981",
				"ConnectionsCurrent": "0",
				"ConnectionsTotal": "5",
				"ConnectionsTotalAccepted": "5",
				"ConnectionsTotalRejected": "0",
				"MessagesInBytesRate": "0.0",
				"MessagesOutBytesRate": "0.0",
				"ApplicationInstance": {
					"Name": "_definst_",
					"TimeRunning": "77862.979",
					"ConnectionsCurrent": "0",
					"ConnectionsTotal": "5",
					"ConnectionsTotalAccepted": "5",
					"ConnectionsTotalRejected": "0",
					"MessagesInBytesRate": "0.0",
					"MessagesOutBytesRate": "0.0",
					"Stream": {
						"Name": "11.stream",
						"SessionsFlash": "0",
						"SessionsCupertino": "0",
						"SessionsSanJose": "0",
						"SessionsSmooth": "0",
						"SessionsRTSP": "0",
						"SessionsWebRTC": "0",
						"SessionsMPEGDash": "0",
						"SessionsTotal": "0"
					}
				}
			}
		}
	}
}

“Application -> ConnectionsTotal: 5”

  1. Does it mean that five people are connected? until now?

  2. What does “VHost -> ConnectionsTotal :14” mean?

  3. What does “WowzaStreamingEngine -> ConnectionsTotal : 22” mean?

  4. What does “WowzaStreamingEngine -> ConnectionsCurrents :1” mean?

There is one person, but no one is currently connected.

i study API to draw a monitoring graph

help. ㅜㅜ

Hi Hada, what is your wowza version ? My wowza ( 4.7.7 ) does not response like your query ? Did you change the connectioncounts http class ?

I can suggest you to work with http://localhost:8086/connectioncounts?flat

this will give true result to you .

<WowzaStreamingEngine>
<Stream vhostName="_defaultVHost_" applicationName="live" appInstanceName="_definst_" streamName="audiotest" sessionsFlash="0" sessionsCupertino="0" sessionsSanJose="0" sessionsSmooth="0" sessionsRTSP="0" sessionsWebRTC="0" sessionsMPEGDash="1"sessionsTotal="1"/>

</WowzaStreamingEngine>

Info and you can monitor with this summarry info. Also you can use The Rest Api,

it’s so powerful and you can get whatever you ask. Ie

Stream based info here is sample url for curl

http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/instances/_definst_/incomingstreams/STREAMNAME/monitoring/current

This will return the current statistics of the given application ( live here) & stream name

stdClass Object
(
    [serverName] => _defaultServer_
    [applicationInstance] => _definst_
    [name] => audiotest
    [uptime] => 14
    [bytesIn] => 4611903
    [bytesOut] => 0
    [bytesInRate] => 334952
    [bytesOutRate] => 0
    [totalConnections] => 0
    [connectionCount] => stdClass Object
        (
            [RTMP] => 0
            [MPEGDASH] => 0
            [CUPERTINO] => 0
            [SANJOSE] => 0
            [SMOOTH] => 0
            [RTP] => 0
        )

)

Here is sample php code .

<?php 
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/instances/_definst_/incomingstreams/audiotest/monitoring/current");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");

$headers = array();
$headers[] = "Accept: application/json; charset=utf-8";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
$array = json_decode($result);
echo "<pre>";
print_r($array);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close ($ch);

?>

Thank you for your kind comments. But it is not an answer to my question. i’ve already used REST API , http://localhost:8086/connectioncounts. and I wrote four questions in the text. I wondered what the number of return values means.

My wowza version is 4.7.7

interesting, my api does not return this kind of values. You see history & current same time. anyway connection current was counted with publishing stream befor ( ie : rtmp publish or stream file ) the newer version does not count this, probably you watched stream with this client before, and might this session info exist still, did you check that without any play action after restart ? you see still 1 ?