Skip to content
Lorenzo Mangani edited this page Apr 8, 2018 · 6 revisions

DEV NOTES

The following notes are only intended for developers and testers!

Setup

npm install -g hepop

Usage

hepop -c /path/to/config.json

Requires

  • PostgreSQL
  • InfluxDB

HEP Collector

The HEP Collector handles udp/tcp packets from HEP Agents

Config

{
  "id" : "HEPop101",
  "socket": "udp", 
  "port": 9066,
  "address": "127.0.0.1",
  "queue": {
    "timeout": 2000, 
    "maxSize": 1000, 
    "useInterval": true 
  },
  "dbName": "homer",
  "tableName": "hep",
  "db": {
        "debug": true,
  	"pgsql":{
  	  "host": "127.0.0.1", 
  	  "port": 5432, 
  	  "user": "homer_user",
  	  "password": "homer_password",
	  "database": "homer_data"
  	}
  },
  "metrics": {
	"influx":{
		"period": 30000,
		"dbName": "hep",
		"hostname": "localhost:8086"
	}
  },
  "debug": true
}

Protocols

HEP Protocols are indexed using the following logic:

hep_proto + _ + protocol_id + _ + transaction_type

Query Example
psql -d "homer_data" -c "SELECT * from hep_proto_1_default WHERE data_header->>'callid' like 'khywhp@127.0.0.1' limit 1;"

Stats

HEP Stats are are indexed as timeseries in InfluxDB

Query Example
SELECT mean("INVITE") AS "mean_INVITE", mean("INVITE:200") AS "mean_INVITE:200", mean("BYE") AS "mean_BYE", mean("BYE:200") AS "mean_BYE:200" FROM "hep"."autogen"."method" WHERE time > :dashboardTime: GROUP BY :interval: FILL(null)

RTC Collector

The RTC Collector handles events from Janus and Mediasoup

Config

{
  "id" : "HEPop102",
  "socket": "http", 
  "port": 8888,
  "address": "127.0.0.1",
  "queue": {
    "timeout": 2000, 
    "maxSize": 1000, 
    "useInterval": true 
  },
  "dbName": "homer",
  "tableName": "hep",
  "db": {
        "debug": true,
  	"pgsql":{
  	  "host": "127.0.0.1", 
  	  "port": 5432, 
  	  "user": "homer_user",
  	  "password": "homer_password",
	  "database": "homer_data"
  	}
  },
  "metrics": {
	"influx":{
		"period": 30000,
		"dbName": "hep",
		"hostname": "localhost:8086"
	}
  },
  "debug": true
}

Events

RTC Protocols are indexed as type 1000 and can be JSON searched

Query Example
SELECT * from hep_proto_1000_default WHERE data_header->>'handle' like '8796940787397620' limit 1;
SELECT * from hep_proto_1000_default WHERE data_header->>'medium' like 'video' limit 1;
id | gid |        create_date         |                   protocol_header                   |                                        data_header                                        |                                                                                           raw                                                                                           
----+-----+----------------------------+-----------------------------------------------------+-------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1 |   0 | 2018-04-08 13:21:00.647154 | {"address":"5.6.7.8","family":"IPv4","port":57064} | {"type": 32, "handle": 8796940787397620, "medium": "video", "session": "211476467382971"} | {"type":32,"timestamp":1499105775654525,"session_id":"211476467382971","handle_id":8796940787397620,"event":{"media":"video","receiving":true},"@timestamp":"2018-04-08T11:20:58.760Z"}

Stats

RTC Protocol media statistics are indexed as timeseries in InfluxDB

Query Example
SELECT mean("nacks-sent") AS "mean_nacks-sent", mean("nacks-received") AS "mean_nacks-received" FROM "hep"."autogen"."janus" WHERE time > :dashboardTime: GROUP BY :interval: FILL(null)