src/sap.ui.core/src/sap/ui/performance/trace/Interaction.js
function handleResponse() {
		if (this.readyState === 4 && this.pendingInteraction && !this.pendingInteraction.completed) {
			// enrich interaction with information
			var sContentLength = this.getResponseHeader("content-length"),
				bCompressed = this.getResponseHeader("content-encoding") === "gzip",
				sFesrec = this.getResponseHeader("sap-perf-fesrec");
			this.pendingInteraction.bytesReceived += sContentLength ? parseInt(sContentLength) : 0;
			this.pendingInteraction.bytesReceived += this.getAllResponseHeaders().length;
			this.pendingInteraction.bytesSent += this.requestHeaderLength || 0;
			// this should be true only if all responses are compressed
			this.pendingInteraction.requestCompression = bCompressed && (this.pendingInteraction.requestCompression !== false);
			// sap-perf-fesrec header contains milliseconds
			this.pendingInteraction.networkTime += sFesrec ? Math.round(parseFloat(sFesrec, 10) / 1000) : 0;
			var sSapStatistics = this.getResponseHeader("sap-statistics");
			if (sSapStatistics) {
				var aTimings = window.performance.getEntriesByType("resource");
				this.pendingInteraction.sapStatistics.push({
					// add response url for mapping purposes
					url: this.responseURL,
					statistics: sSapStatistics,
					timing: aTimings ? aTimings[aTimings.length - 1] : undefined
				});
			}
			delete this.requestHeaderLength;
			delete this.pendingInteraction;
		}
	}
function handleResponse() {
		if (this.readyState === 4 && this.pendingInteraction && !this.pendingInteraction.completed) {
			// enrich interaction with information
			var sContentLength = this.getResponseHeader("content-length"),
				bCompressed = this.getResponseHeader("content-encoding") === "gzip",
				sFesrec = this.getResponseHeader("sap-perf-fesrec");
			this.pendingInteraction.bytesReceived += sContentLength ? parseInt(sContentLength) : 0;
			this.pendingInteraction.bytesReceived += this.getAllResponseHeaders().length;
			this.pendingInteraction.bytesSent += this.requestHeaderLength || 0;
			// this should be true only if all responses are compressed
			this.pendingInteraction.requestCompression = bCompressed && (this.pendingInteraction.requestCompression !== false);
			// sap-perf-fesrec header contains milliseconds
			this.pendingInteraction.networkTime += sFesrec ? Math.round(parseFloat(sFesrec, 10) / 1000) : 0;
			var sSapStatistics = this.getResponseHeader("sap-statistics");
			if (sSapStatistics) {
				var aTimings = window.performance.getEntriesByType("resource");
				this.pendingInteraction.sapStatistics.push({
					// add response url for mapping purposes
					url: this.responseURL,
					statistics: sSapStatistics,
					timing: aTimings ? aTimings[aTimings.length - 1] : undefined
				});
			}
			delete this.requestHeaderLength;
			delete this.pendingInteraction;
		}
	}
function handleResponse ( ) { if ( this . readyState === 4 && this . pendingInteraction && ! this . pendingInteraction . completed ) { // enrich interaction with information var sContentLength = this . getResponseHeader ( "content-length" ) , bCompressed = this . getResponseHeader ( "content-encoding" ) === "gzip" , sFesrec = this . getResponseHeader ( "sap-perf-fesrec" ) ; this . pendingInteraction . bytesReceived += sContentLength ? parseInt ( sContentLength ) : 0 ; this . pendingInteraction . bytesReceived += this . getAllResponseHeaders ( ) . length ; this . pendingInteraction . bytesSent += this . requestHeaderLength || 0 ; // this should be true only if all responses are compressed this . pendingInteraction . requestCompression = bCompressed && ( this . pendingInteraction . requestCompression !== false ) ; // sap-perf-fesrec header contains milliseconds this . pendingInteraction . networkTime += sFesrec ? Math . round ( parseFloat ( sFesrec , 10 ) / 1000 ) : 0 ; var sSapStatistics = this . getResponseHeader ( "sap-statistics" ) ; if ( sSapStatistics ) { var aTimings = window . performance . getEntriesByType ( "resource" ) ; this . pendingInteraction . sapStatistics . push ( { // add response url for mapping purposes url : this . responseURL , statistics : sSapStatistics , timing : aTimings ? aTimings [ aTimings . length - 1 ] : undefined } ) ; } delete this . requestHeaderLength ; delete this . pendingInteraction ; } }
response handler which uses the custom properties we added to the xhr to retrieve information from the response headers
response handler which uses the custom properties we added to the xhr to retrieve information from the response headers