bin/XEtemplates/Database File IO.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<event_sessions xmlns="http://schemas.microsoft.com/sqlserver/2008/07/extendedeventconfig">
   <event_session name="Database File I/O" maxMemory="4" eventRetentionMode="allowSingleEventLoss" trackCausality="false" dispatchLatency="30" maxEventSize="0" memoryPartitionMode="none">
    <templateCategory>
      <!-- _locID_text="templateCategory" _locComment = "" -->Everyday Extended Events</templateCategory>
    <templateName>
      <!-- _locID_text = "templateName" _locComment = "" -->Database File IO</templateName>
    <templateDescription>
      <!-- _locID_text = "templateDescription" _locComment = "" -->Use event counter and histogram to see which database file(s) have the most reads and writes.</templateDescription>
      <event package="sqlserver" name="file_read_completed">
         <action package="sqlserver" name="client_app_name" />
         <action package="sqlserver" name="client_hostname" />
         <action package="sqlserver" name="database_id" />
         <action package="sqlserver" name="database_name" />
         <action package="sqlserver" name="plan_handle" />
         <action package="sqlserver" name="sql_text" />
         <parameter name="collect_io_data" value="1" />
         <parameter name="collect_path" value="1" />
         <predicate>
            <leaf>
               <comparator name="greater_than_uint64" package="package0" />
               <global name="database_id" package="sqlserver" />
               <value>4</value>
            </leaf>
         </predicate>
      </event>
      <event package="sqlserver" name="file_write_completed">
         <action package="sqlserver" name="client_app_name" />
         <action package="sqlserver" name="client_hostname" />
         <action package="sqlserver" name="database_id" />
         <action package="sqlserver" name="database_name" />
         <action package="sqlserver" name="plan_handle" />
         <action package="sqlserver" name="sql_text" />
         <parameter name="collect_path" value="1" />
         <predicate>
            <leaf>
               <comparator name="greater_than_uint64" package="package0" />
               <global name="database_id" package="sqlserver" />
               <value>4</value>
            </leaf>
         </predicate>
      </event>
      <target package="package0" name="event_counter" />
      <target package="package0" name="histogram">
         <parameter name="filtering_event_name" value="sqlserver.file_read_completed" />
         <parameter name="source" value="file_id" />
         <parameter name="source_type" value="0" />
      </target>
   </event_session>
</event_sessions>