This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

setResourceTimingBufferSize

Summary

Sets the maximum number of PerformanceResourceTiming resources that may be stored in the buffer to the value of the maxSize parameter.

Method of apis/resource_timing/Performanceapis/resource_timing/Performance

Syntax

 .setResourceTimingBufferSize(maxSize);

Parameters

maxSize

Data-type
unsigned long

The maximum number of PerformanceResourceTiming resources that will be stored in the buffer.

Return Value

No return value

Examples

This example uses clearResourceTimings and setResourceTimingBufferSize to set an initial buffer size. It then uses onresourcetimingbufferfull to detect when the buffer is full, and executes a function that uses clearResourceTimings to clear the buffer.

performance.clearResourceTimings();
setResourceTimingBufferSize(100);

function buffFull() {
  performance.clearResourceTimings();
  };

performance.onresourcetimingbufferfull = buffFull;

Notes

The setResourceTimingBufferSize does not take effect until the clearResourceTimings method is called.

Related specifications

W3C Resource Timing Specification
W3C Working Draft

Attributions