# Bandwidth Consumption

**URL:** <https://community.wowza.com/t/bandwidth-consumption/37900>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [May 6, 2016, 9:17am UTC](https://community.wowza.com/t/bandwidth-consumption/37900 "2016-05-06T09:17:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![asim\_khan](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@asim\_khan](https://community.wowza.com/u/asim_khan)\
**Post date:** [May 6, 2016, 9:17am UTC](https://community.wowza.com/t/bandwidth-consumption/37900/1 "2016-05-06T09:17:48Z")

</div>

I am currently getting bandwidth usage per session for RTMP , HTTP and RTP like this

```auto
//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 ?

---

<div class="post-metadata">

**Author:** ![Andy\_Engberson](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/andy_engberson/32/392_2.png) [@Andy\_Engberson](https://community.wowza.com/u/Andy_Engberson)\
**Post date:** [May 16, 2016, 12:44am UTC](https://community.wowza.com/t/bandwidth-consumption/37900/2 "2016-05-16T00:44:52Z")

</div>

Hi,

It looks like this is now being handled in the created ticket (170350)

Andy\_E
