Commit b3c9820c b3c9820cdc0810e8ddfadc75dfdea58e64337431 by Christian Gerdes

ClearSSLSessions now takes a regex to match agents.

1 parent d3bc1be6
......@@ -18,6 +18,7 @@ using System.ComponentModel;
using System.IO;
using System.Collections.Specialized;
using System.Net;
using System.Text.RegularExpressions;
namespace LIL_VSTT_Plugins
{
......@@ -28,8 +29,27 @@ namespace LIL_VSTT_Plugins
[Description("(C) Copyright 2018 LIGHTS IN LINE AB\r\nDisables SSL Session Cache and Reuse of handshakes during this loadtest. Beta.")]
public class ClearSSLSessions : ILoadTestPlugin
{
[DisplayName("Agents RegEx")]
[Description("The regular expression must match the Agent Name if specified. Empty matches all agents.")]
[DefaultValue("")]
public string AgentRegEx
{
get; set;
}
public void Initialize(LoadTest loadTest)
{
if(!String.IsNullOrEmpty(AgentRegEx))
{
Regex r = new Regex(AgentRegEx);
if (!r.IsMatch(loadTest.Context.AgentName))
{
// Just in case, run undoIt() restoring default behaviour
loadTest.LoadTestStarting += new EventHandler(mLoadTest_Finished);
return;
}
}
// If we get here, either the agent matches, or no regex has been given so we run on all agents.
loadTest.LoadTestStarting += new EventHandler(mLoadTest_Starting);
loadTest.LoadTestFinished += new EventHandler(mLoadTest_Finished);
loadTest.LoadTestAborted += new EventHandler<LoadTestAbortedEventArgs>(mLoadTest_Aborted);
......