Improve querying of Extended Events target file

As part of our server estate monitoring, I am adding extended events to pick up warnings, blocking etc and I’d like to periodically (Every couple of minutes) query the event file to collect the data. I have been using the below to query data using xQuery, but it seems to be quite slow. I am aware of using a fileoffset as an option to optimise, but beyond that, are there any ways in which I can better improve predicates as been below?

    SELECT           event_data         ,n.value('@timestamp', 'DATETIME2') DtTimeStamp         ,n.value('(action[@name="collect_cpu_cycle_time"]/value)[1]', 'bigINT') CollectCpuCycleTime         ,n.value('(action[@name="collect_system_time"]/value)[1]', 'DATETIME2') CollectSystemTime         ,n.value('(action[@name="last_error"]/value)[1]', 'varchar(255)') LastError         ,n.value('(action[@name="collect_system_time"]/value)[1]', 'datetime2')             CollectSystemTime         ,n.value('(action[@name="task_time"]/value)[1]', 'bigint')                          TaskTime         ,n.value('(action[@name="client_app_name"]/value)[1]', 'varchar(255)')              ClientAppName         ,n.value('(action[@name="client_hostname"]/value)[1]', 'varchar(255)')              ClientHostName         ,n.value('(action[@name="database_name"]/value)[1]', 'varchar(255)')                DatabaseName         ,n.value('(action[@name="nt_username"]/value)[1]', 'varchar(255)')                  NtUserName         ,n.value('(action[@name="server_instance_name"]/value)[1]', 'varchar(255)')         InstanceName         ,n.value('(action[@name="session_id"]/value)[1]', 'INT')                            SessionID         ,n.value('(action[@name="client_pid"]/value)[1]', 'INT')                            ClientPID         ,n.value('(action[@name="sql_text"]/value)[1]', 'VARCHAR(MAX)')                         SQLText     FROM          (             SELECT                  CAST(event_data as XML) event_data             FROM                  sys.fn_xe_file_target_read_file('C:\Temp\EE_QueryWarnings*.xel', null, null, null)         ) ed     OUTER APPLY         ed.event_data.nodes('event') (n)     WHERE         n.value('@name', 'varchar(MAX)')    = 'missing_column_statistics'     AND         n.value('@timestamp', 'DATETIME2')   >= DATEADD(MINUTE,-10,GETUTCDATE()); 

Does Extended Spell extend a spell exponentially or linearly?

I know you can’t re-extend a spell if it’s already active, but I’m talking about the initial casting, where you can spend multiple sorcery points to double the spell’s duration

When it mentions that you can spend 1 sorcery point to double its duration, up to a maximum of 24 hours, does it mean everytime you spend a sorcery point you add the original duration again, or does it exponentially double the duration? For example, if I spend 4 sorcery points on a 1 minute spell, does it become 5 minutes (1 minute duration added four times) or 16 minutes long (1 minute doubled four times)?

Extended Vision changes ranged effects modifiers due to distance?

I’m trying to build a character that has an incredible vision, using her Extended Senses (Vision). She uses firearms in battle. I kinda wanted to simulate her efficiency in shooting at great distances at easy, but I got stuck in some rules.

Range attacks have three types of ranges: short, medium and long, each one giving different modifiers base on the distance to hit the target.

A ranged effect has a short range of (rank x 25 feet), a medium range of (rank x 50 feet) and a long range of (rank x 100 feet). Ranged attack checks at medium range suffer a –2 circumstance penalty, while ranged attacks at long range suffer a –5 circumstance penalty.

Extended Vision would be a reasonable choice, but it seems to just affect Perception checks and not range attacks. I could use Extended Distance Extra, but it seems that I would need to apply it to each weapon, or at least for a container of powers. Shouldn’t Extended Vision affect the range for ranged attacks?

Should extended Latin characters in urls (ü, ö, etc.) be percent-encoded as standard?

I am putting together an English language site which contains its own German translation (don’t worry, I’ve lived in Germany and I have a degree in Germanic and Slavonic Studies, it’s proper German…).

I am wondering what the best practice is regarding extended Latin characters in URLs.

If I have a URL like:

https://example.com/fußgängerbrücke/ 

Am I better to link to it internally as:

  • a) /fußgängerbrücke/
  • b) /fu%C3%9Fg%C3%A4ngerbr%C3%BCcke/
  • c) /fussgaengerbruecke/

I have no problem doing any of the above and I am quite happy to use .htaccess mod_rewrite if and where necessary to ensure that variants all 301 to the correct canonical page.

On that note, a secondary question: which format (if different) should I be using for the <link rel="canonical"> in the <head>?

Can you use the Sorcerer’s Extended Spell Metamagic option with the Delayed Blast Fireball spell to get an extra 10d6 damage?

The Sorcerer can get the Metamagic, Extended Spell.

Extended Spell (PHB p. 102)

When you Cast a Spell that has a Duration of 1 minute or longer, you can spend 1 sorcery point to double its Duration, to a maximum Duration of 24 hours.

Delayed Blast Fireball (PHB p. 230-231)

…The spell’s base damage is 12d6. If at the end of your turn the bead has not yet detonated, the damage increases by 1d6…

Extended Spell would extend the spell duration to up to 2 minutes. This would add a possible ten more rounds which would be 10d6 damage.

Is this possible for only 1 sorcery point? This would make the damage from a full duration delayed blast fireball 32d6 (192) or an average of 112 damage.

Extended events filter not working

When I create an Extended Events session with filtering for username, I get no results.

If I remove the filter, I get results, including ones that should match the filter.

The user is a SQL Login.

This query returns nothing:

CREATE EVENT SESSION [p] ON SERVER ADD EVENT sqlserver.rpc_starting(   ACTION(package0.event_sequence,sqlserver.nt_username,sqlserver.server_principal_name,sqlserver.session_id,sqlserver.username)     WHERE ([package0].[equal_boolean]([sqlserver].[is_system],(0)))     AND (([sqlserver].[server_principal_name]=N'MySQLUserName'))), ADD EVENT sqlserver.sql_batch_starting(     ACTION(package0.event_sequence,sqlserver.nt_username,sqlserver.server_principal_name,sqlserver.session_id,sqlserver.username)     WHERE ([package0].[equal_boolean]([sqlserver].[is_system],(0)))     AND (([sqlserver].[server_principal_name]=N'MySQLUserName'))) ADD TARGET package0.ring_buffer WITH (MAX_MEMORY=8192 KB,EVENT_RETENTION_MODE=ALLOW_SINGLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=5 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=PER_CPU,TRACK_CAUSALITY=ON,STARTUP_STATE=OFF) GO 

This query returns results that should have been in the original results:

CREATE EVENT SESSION [p] ON SERVER ADD EVENT sqlserver.rpc_starting(     ACTION(package0.event_sequence,sqlserver.nt_username,sqlserver.server_principal_name,sqlserver.session_id,sqlserver.username)     WHERE ([package0].[equal_boolean]([sqlserver].[is_system],(0)))), ADD EVENT sqlserver.sql_batch_starting(     ACTION(package0.event_sequence,sqlserver.nt_username,sqlserver.server_principal_name,sqlserver.session_id,sqlserver.username)     WHERE ([package0].[equal_boolean]([sqlserver].[is_system],(0)))) ADD TARGET package0.ring_buffer WITH (MAX_MEMORY=8192 KB,EVENT_RETENTION_MODE=ALLOW_SINGLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=5 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=PER_CPU,TRACK_CAUSALITY=ON,STARTUP_STATE=OFF) GO 

How to use get_terms() in extended walker class


Desired outcome

I have a custom post type and belonging to it, a custom taxonomy. I’m trying to get my child theme dynamically add the terms belonging to that taxonomy as a sub-menu under a certain list item in one of my theme’s menus. The taxonomy is hierarchical, and I would like to add all terms of depth = 1, i.e. the first and second-level terms with proper indentation and the same styles as my current menu.

My strategy

So I first thought of using the wp_nav_menu_items filter, but since there can be many terms and they are hierarchical, I instead thought it’s best to go with a custom walker to extend the Walker_Nav_Menu class.

The issue

The issue I’ve encountered is that when I try to call the get_terms() function inside the custom walker, it returns “Invalid taxonomy”.

What I’ve tried

I read up about it, and I think it’s due to the get_terms() is getting called before init when it’s invoked in the walker class. So I tried to lift out the get_terms() function from the class and do the following:

function get_mytax_terms() {   $  myterms= get_terms( array(     'taxonomy' => 'mytax',     'hide_empty' => true   ) );   return $  myterms; } add_action( 'init' , get_mytax_terms() , 10 ); 

I even tried making the variable global, but it still doesn’t return any terms, and throws an error for the taxonomy being invalid. But a var_dump on that variable still gives me “Invalid taxonomy”. So I read on, and saw in a comment at the codex (on the Walker_Nav_menu class page) that I need to use static functions, and did this inside the custom walker class:

/**    * Get all terms of tax mytax    */   public static function init() {     add_action( 'init', array( get_called_class(), 'get_mytax_terms' ), 10 );   }   public static function get_mytax_terms() {     $  myterms = get_terms( array(       'taxonomy' => 'mytax',       'hide_empty' => true     ) );     return $  myterms ;     var_dump($  myterms );   } 

And that var_dump runs as it should but still returns the “Invalid taxonomy” error. I know for a fact that the taxonomy is registered and that there are terms in the database.

The question

So what am I missing here? I’m including my custom walker, if anyone would like to show me how I would best go about calling the get_terms() function inside this class.

Current situation

/* ---- Add mytax taxonomy terms to menu ---- */ class Walker_Add_Myterms extends Walker_Nav_Menu {   // Insert a submenu   function end_el( &$  output, $  item, $  depth=1, $  args=array() ) {       // if the current menu item being output is parentmenuitem       if( 'parentmenuitem' == $  item->title ){           // get all terms           $  myterms = get_terms( array(               'taxonomy' => 'mytax',               'hide_empty' => true,           ) );           if ( ! empty( $  myterms ) && ! is_wp_error( $  myterms ) ) {               // start a new list               $  output .= '<ul>';               // iterate over each type and add an li               foreach( $  myterms $  myterm){                   $  term_url = get_permalink( $  myterm->term_id );                   $  name = $  myterm->name;                   $  format = '<li><a href="%s">%s</a></li>';                   $  output .= sprintf( $  format, $  term_url, $  name );               }               // close the list               $  output .= '</ul>';           }       }       // close the parent li       $  output .= "</li>\n";     } } wp_nav_menu( array(     'theme_location'  => 'expanded',     'container'       => 'ul',     'menu_class'      => 'expanded-menu sub-menu active',     'walker'          => new Walker_Add_Myterms ) ); 

If I have an Extended Teleport effect, can it be triggered when I get knocked out?

This is the power I bought for my character

Triggered(1) Extended Teleport 10 Trigger: When Artifice is knocked out, he teleports away from enemies to a teleport beacon he's set up. 

Teleport says this:

You can move instantly from place to place without crossing the distance in between. You can teleport yourself and up to 50 lbs. (mass rank 0) of additional mass a distance rank equal to your effect rank as a move action. Unwilling passengers get a Dodge resistance check to avoid being taken along. 

Extended says this:

Extended: You can take two move actions to make an extended teleport with a distance rank equal to your effect rank +8. You are dazed and vulnerable for one round after an extended teleport. +1 cost per rank. 

Triggered says this:

You can “set” an instant duration effect with this modifier to activate under particular circumstances, such as in response to a particular danger, after a set amount of time, in response to a particular event, and so forth—chosen when you apply the modifier. Once chosen, the trigger cannot be changed. The circumstances must be detectable by your senses. You can acquire Senses Limited and Linked to Triggered effects, if desired. Setting the effect requires the same action as using it normally. 

Using this, is it possible to use the Triggered modifier to teleport me away when my character is knocked out, and can I use the Extended modifier with it as well?

Triple handshake attack – what are the implications of not supporting RFC 7627: “Session Hash and Extended Master Secret Extension”?

The referenced RFC details a mitigation to what appears to be the ability to compromise a TLS connection through an attack known as the ‘triple handshake attack’.

How serious is this vulnerability? How could this vulnerability be exploited and what would the impact be?

The related RFC for this can be found here: https://tools.ietf.org/html/rfc7627