I am currently getting bandwidth usage per session for RTMP , HTTP and RTP like this
//RTMP
public void onStreamDestroy(IMediaStream stream) {
if ( stream.getClient() != null){
IOPerformanceCounter perf = stream.getMediaIOPerformance();
Long outbytes = perf.getMessagesOutBytes();
}
}
//HTTP
public void onHTTPSessionDestroy(IHTTPStreamerSession httpSession) {
if ( httpSession != null){
IOPerformanceCounter perf = httpSession.getIOPerformanceCounter();
Long outbytes = perf.getMessagesOutBytes();
}
}
//RTP
public void onRTPSessionDestroy(RTPSession rtpSession) {
if ( rtpSession != null){
IOPerformanceCounter perf = rtpSession.getIOPerformanceCounter();
Long outbytes = perf.getMessagesOutBytes();
}
}
when i compare my useage with hosting provider it is very different , my useage is lower than my provider
so is this correct way to get bandwidth useage ? or am i missing some thing ?