Event Counter Target
Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).
The event counter target counts all events that occur during an Extended Events session. By using the event counter target, you can obtain information about workload characteristics without adding the overhead of full event collection. This target has no customizable parameters.
To add the event counter target to an Extended Events session, you must include the following statement when you create or alter an event session:
ADD TARGET package0.event_counter
To review the output from the event counter target, you can use the following query, replacing session_name with the name of the event session:
SELECT name, target_name, CAST(xet.target_data AS xml) FROM sys.dm_xe_session_targets AS xet JOIN sys.dm_xe_sessions AS xe ON (xe.address = xet.event_session_address) WHERE xe.name = 'session_name'
The following example shows the event counter target output format.
<CounterTarget truncated = "0"> <Packages> <Package name = "[package name]"> <Event name = "[event name]" count = "[number]" /> </Package> </Packages> </CounterTarget>