diff options
author | Oleksii Kovalov <OleksiiKovalov@users.noreply.github.com> | 2013-02-11 16:00:07 +0000 |
---|---|---|
committer | Oleksii Kovalov <OleksiiKovalov@users.noreply.github.com> | 2013-02-11 16:00:07 +0000 |
commit | de7cdc8caa1fefd5d51132efd341c8868c0708df (patch) | |
tree | 3fbeda42fbde68c40b8c78e26b75d143ad4d7938 /ExpressProfiler | |
parent | 06b2d643cd235e40a54887e5a29f34939d3f29bf (diff) | |
download | expressprofiler-de7cdc8caa1fefd5d51132efd341c8868c0708df.zip expressprofiler-de7cdc8caa1fefd5d51132efd341c8868c0708df.tar.gz expressprofiler-de7cdc8caa1fefd5d51132efd341c8868c0708df.tar.bz2 |
[+] added filter on Duration column, added command line parameter for duration
[+] added -start command line parameter
[*] small guid changes - added buttons for clear trace, added lb for explicit auth selection
[*] changed formatting for numeric columns
[*] fixed filter on int/bigint column
[-] xtra code/classes removed
Diffstat (limited to 'ExpressProfiler')
-rw-r--r-- | ExpressProfiler/ExpressProfiler/MainForm.Designer.cs | 81 | ||||
-rw-r--r-- | ExpressProfiler/ExpressProfiler/MainForm.cs | 181 | ||||
-rw-r--r-- | ExpressProfiler/ExpressProfiler/MainForm.resx | 10 | ||||
-rw-r--r-- | ExpressProfiler/ExpressProfiler/Properties/AssemblyInfo.cs | 8 | ||||
-rw-r--r-- | ExpressProfiler/ExpressProfiler/RawTraceReader.cs | 49 |
5 files changed, 190 insertions, 139 deletions
diff --git a/ExpressProfiler/ExpressProfiler/MainForm.Designer.cs b/ExpressProfiler/ExpressProfiler/MainForm.Designer.cs index 0b09e45..ad78213 100644 --- a/ExpressProfiler/ExpressProfiler/MainForm.Designer.cs +++ b/ExpressProfiler/ExpressProfiler/MainForm.Designer.cs @@ -40,6 +40,8 @@ this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
this.edServer = new System.Windows.Forms.ToolStripTextBox();
+ this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
+ this.tbAuth = new System.Windows.Forms.ToolStripComboBox();
this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel();
this.edUser = new System.Windows.Forms.ToolStripTextBox();
this.toolStripLabel3 = new System.Windows.Forms.ToolStripLabel();
@@ -58,6 +60,10 @@ this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.reTextData = new System.Windows.Forms.RichTextBox();
this.timer1 = new System.Windows.Forms.Timer(this.components);
+ this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
+ this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
+ this.toolStripLabel4 = new System.Windows.Forms.ToolStripLabel();
+ this.edDuration = new System.Windows.Forms.ToolStripTextBox();
this.toolStrip1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
@@ -79,15 +85,21 @@ this.tbStop,
this.toolStripSeparator1,
this.tbScroll,
+ this.toolStripSeparator5,
+ this.toolStripButton1,
this.toolStripSeparator2,
this.toolStripLabel1,
this.edServer,
+ this.toolStripSeparator4,
+ this.tbAuth,
this.toolStripLabel2,
this.edUser,
this.toolStripLabel3,
this.edPassword,
this.toolStripSeparator3,
- this.cbSelectEvents});
+ this.cbSelectEvents,
+ this.toolStripLabel4,
+ this.edDuration});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(979, 25);
@@ -157,6 +169,21 @@ this.edServer.Name = "edServer";
this.edServer.Size = new System.Drawing.Size(100, 25);
//
+ // toolStripSeparator4
+ //
+ this.toolStripSeparator4.Name = "toolStripSeparator4";
+ this.toolStripSeparator4.Size = new System.Drawing.Size(6, 25);
+ //
+ // tbAuth
+ //
+ this.tbAuth.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.tbAuth.Items.AddRange(new object[] {
+ "Windows auth",
+ "SQL Server auth"});
+ this.tbAuth.Name = "tbAuth";
+ this.tbAuth.Size = new System.Drawing.Size(121, 25);
+ this.tbAuth.SelectedIndexChanged += new System.EventHandler(this.tbAuth_SelectedIndexChanged);
+ //
// toolStripLabel2
//
this.toolStripLabel2.Name = "toolStripLabel2";
@@ -206,26 +233,26 @@ // mnExistingConnection
//
this.mnExistingConnection.Name = "mnExistingConnection";
- this.mnExistingConnection.Size = new System.Drawing.Size(193, 22);
+ this.mnExistingConnection.Size = new System.Drawing.Size(171, 22);
this.mnExistingConnection.Text = "Existing connections";
this.mnExistingConnection.Click += new System.EventHandler(this.existingConnectionsToolStripMenuItem_Click);
//
// mnLoginLogout
//
this.mnLoginLogout.Name = "mnLoginLogout";
- this.mnLoginLogout.Size = new System.Drawing.Size(193, 22);
+ this.mnLoginLogout.Size = new System.Drawing.Size(171, 22);
this.mnLoginLogout.Text = "Audit login/logout";
this.mnLoginLogout.Click += new System.EventHandler(this.existingConnectionsToolStripMenuItem_Click);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
- this.toolStripMenuItem1.Size = new System.Drawing.Size(190, 6);
+ this.toolStripMenuItem1.Size = new System.Drawing.Size(168, 6);
//
// mnRPCStarting
//
this.mnRPCStarting.Name = "mnRPCStarting";
- this.mnRPCStarting.Size = new System.Drawing.Size(193, 22);
+ this.mnRPCStarting.Size = new System.Drawing.Size(171, 22);
this.mnRPCStarting.Text = "RPC:Starting";
this.mnRPCStarting.Click += new System.EventHandler(this.existingConnectionsToolStripMenuItem_Click);
//
@@ -234,19 +261,19 @@ this.mnRPCCompleted.Checked = true;
this.mnRPCCompleted.CheckState = System.Windows.Forms.CheckState.Checked;
this.mnRPCCompleted.Name = "mnRPCCompleted";
- this.mnRPCCompleted.Size = new System.Drawing.Size(193, 22);
+ this.mnRPCCompleted.Size = new System.Drawing.Size(171, 22);
this.mnRPCCompleted.Text = "RPC:Completed";
this.mnRPCCompleted.Click += new System.EventHandler(this.existingConnectionsToolStripMenuItem_Click);
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
- this.toolStripMenuItem2.Size = new System.Drawing.Size(190, 6);
+ this.toolStripMenuItem2.Size = new System.Drawing.Size(168, 6);
//
// mnBatchStarting
//
this.mnBatchStarting.Name = "mnBatchStarting";
- this.mnBatchStarting.Size = new System.Drawing.Size(193, 22);
+ this.mnBatchStarting.Size = new System.Drawing.Size(171, 22);
this.mnBatchStarting.Text = "Batch:Starting";
this.mnBatchStarting.Click += new System.EventHandler(this.existingConnectionsToolStripMenuItem_Click);
//
@@ -255,14 +282,14 @@ this.mnBatchCompleted.Checked = true;
this.mnBatchCompleted.CheckState = System.Windows.Forms.CheckState.Checked;
this.mnBatchCompleted.Name = "mnBatchCompleted";
- this.mnBatchCompleted.Size = new System.Drawing.Size(193, 22);
+ this.mnBatchCompleted.Size = new System.Drawing.Size(171, 22);
this.mnBatchCompleted.Text = "Batch:Completed";
this.mnBatchCompleted.Click += new System.EventHandler(this.existingConnectionsToolStripMenuItem_Click);
//
// toolStripMenuItem3
//
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
- this.toolStripMenuItem3.Size = new System.Drawing.Size(190, 6);
+ this.toolStripMenuItem3.Size = new System.Drawing.Size(168, 6);
//
// splitContainer1
//
@@ -293,6 +320,34 @@ this.timer1.Interval = 250;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
+ // toolStripButton1
+ //
+ this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));
+ this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Silver;
+ this.toolStripButton1.Name = "toolStripButton1";
+ this.toolStripButton1.Size = new System.Drawing.Size(23, 22);
+ this.toolStripButton1.Text = "Clear trace";
+ this.toolStripButton1.ToolTipText = "Clear trace\r\nCtrl+Shift+Del";
+ this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click_1);
+ //
+ // toolStripSeparator5
+ //
+ this.toolStripSeparator5.Name = "toolStripSeparator5";
+ this.toolStripSeparator5.Size = new System.Drawing.Size(6, 25);
+ //
+ // toolStripLabel4
+ //
+ this.toolStripLabel4.Name = "toolStripLabel4";
+ this.toolStripLabel4.Size = new System.Drawing.Size(87, 22);
+ this.toolStripLabel4.Text = "Duration, ms >=";
+ //
+ // edDuration
+ //
+ this.edDuration.Name = "edDuration";
+ this.edDuration.Size = new System.Drawing.Size(100, 25);
+ this.edDuration.Text = "0";
+ //
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -344,6 +399,12 @@ private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
+ private System.Windows.Forms.ToolStripComboBox tbAuth;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
+ private System.Windows.Forms.ToolStripButton toolStripButton1;
+ private System.Windows.Forms.ToolStripLabel toolStripLabel4;
+ private System.Windows.Forms.ToolStripTextBox edDuration;
}
}
diff --git a/ExpressProfiler/ExpressProfiler/MainForm.cs b/ExpressProfiler/ExpressProfiler/MainForm.cs index 053d7c8..ac0bd42 100644 --- a/ExpressProfiler/ExpressProfiler/MainForm.cs +++ b/ExpressProfiler/ExpressProfiler/MainForm.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
+using System.Globalization;
using System.Threading;
using System.Windows.Forms;
@@ -13,15 +14,9 @@ namespace ExpressProfiler {
public partial class MainForm : Form
{
- class EvtInfo
- {
- internal long Reads, Writes, Duration, Cpu, Count, LastDuration;
- internal string TextData,Caption;
- }
private enum ProfilingStateEnum { psStopped, psProfiling, psPaused }
private RawTraceReader m_Rdr;
- delegate void OnNewEventArrivedDelegate (ProfilerEvent evt);
- private readonly OnNewEventArrivedDelegate m_NewEventArriwedDelegate;
+
private readonly YukonLexer m_Lex = new YukonLexer();
private SqlConnection m_Conn;
private readonly SqlCommand m_Cmd = new SqlCommand();
@@ -34,24 +29,25 @@ namespace ExpressProfiler private readonly ProfilerEvent m_EventPaused = new ProfilerEvent();
private readonly List<ListViewItem> m_Cached = new List<ListViewItem>(1024);
private readonly Dictionary<string,ListViewItem> m_itembysql = new Dictionary<string, ListViewItem>();
- private static readonly Dictionary<string, string> cursors = new Dictionary<string, string>(50);
- private static readonly Dictionary<string, string> statements = new Dictionary<string, string>(50);
private string m_servername = "";
private string m_username = "";
private string m_userpassword = "";
private int m_maxEvents = 1000;
private ListViewNF lvEvents;
Queue<ProfilerEvent> m_events = new Queue<ProfilerEvent>(10);
+ private bool m_autostart = false;
public MainForm()
{
InitializeComponent();
InitLV();
- Text = "Express Profiler v1.2";
+ Text = "Express Profiler v1.3";
ParseCommandLine();
edServer.Text = m_servername;
edUser.Text = m_username;
edPassword.Text = m_userpassword;
+ tbAuth.SelectedIndex = String.IsNullOrEmpty(m_username)?0:1;
+ if(m_autostart) StartProfiling();
UpdateButtons();
}
@@ -83,6 +79,14 @@ namespace ExpressProfiler case "-maxevents":
if (!Int32.TryParse(ep, out m_maxEvents)) m_maxEvents = 1000;
break;
+ case "-d":
+ case "-duration":
+ int d;
+ if(Int32.TryParse(ep,out d)) edDuration.Text = d.ToString(CultureInfo.InvariantCulture);
+ break;
+ case "-start":
+ m_autostart = true;
+ break;
}
i++;
}
@@ -107,8 +111,10 @@ namespace ExpressProfiler tbPause.Enabled = m_ProfilingState == ProfilingStateEnum.psProfiling;
timer1.Enabled = m_ProfilingState == ProfilingStateEnum.psProfiling;
edServer.Enabled = m_ProfilingState == ProfilingStateEnum.psStopped;
- edUser.Enabled = edServer.Enabled;
- edPassword.Enabled = edServer.Enabled;
+ tbAuth.Enabled = m_ProfilingState == ProfilingStateEnum.psStopped;
+ edDuration.Enabled = m_ProfilingState == ProfilingStateEnum.psStopped;
+ edUser.Enabled = edServer.Enabled&&(tbAuth.SelectedIndex==1);
+ edPassword.Enabled = edServer.Enabled && (tbAuth.SelectedIndex == 1);
cbSelectEvents.Enabled = edServer.Enabled;
mnBatchStarting.Enabled = mnBatchCompleted.Enabled;
mnExistingConnection.Enabled = mnBatchCompleted.Enabled;
@@ -146,13 +152,10 @@ namespace ExpressProfiler lvEvents.Columns.Add("CPU", 82).TextAlign = HorizontalAlignment.Right;
lvEvents.Columns.Add("Reads", 78).TextAlign = HorizontalAlignment.Right;
lvEvents.Columns.Add("Writes", 78).TextAlign = HorizontalAlignment.Right;
- lvEvents.Columns.Add("Duration", 82).TextAlign = HorizontalAlignment.Right;
- lvEvents.Columns.Add("SPID", 80);
- lvEvents.Columns.Add("#", 53);
- lvEvents.Columns.Add("Cnt", 53).TextAlign = HorizontalAlignment.Right;
- lvEvents.Columns.Add("Avg duration", 82).TextAlign = HorizontalAlignment.Right;
- lvEvents.Columns.Add("Last duration", 82).TextAlign = HorizontalAlignment.Right;
- lvEvents.ColumnClick += new ColumnClickEventHandler(lvEvents_ColumnClick);
+ lvEvents.Columns.Add("Duration, ms", 82).TextAlign = HorizontalAlignment.Right;
+ lvEvents.Columns.Add("SPID", 80).TextAlign = HorizontalAlignment.Right;
+ lvEvents.Columns.Add("#", 53).TextAlign = HorizontalAlignment.Right;
+ lvEvents.ColumnClick += lvEvents_ColumnClick;
splitContainer1.Panel1.Controls.Add(lvEvents);
}
@@ -160,17 +163,6 @@ namespace ExpressProfiler {
}
- private void SetLVItemInfo(ListViewItem lvi, EvtInfo i)
- {
- lvi.SubItems[3].Text = i.Cpu.ToString("#,0");
- lvi.SubItems[4].Text = i.Reads.ToString("#,0");
- lvi.SubItems[5].Text = i.Writes.ToString("#,0");
- lvi.SubItems[6].Text = (i.Duration / 1000).ToString("#,0");
- lvi.SubItems[9].Text = i.Count.ToString("#,0");
- lvi.SubItems[10].Text = (i.Count == 0 ? "" : (i.Duration / 1000.0 / i.Count).ToString("#,0"));
- lvi.SubItems[11].Text = (i.LastDuration / 1000).ToString("#,0"); ;
- }
-
private void NewEventArrived(ProfilerEvent evt,bool last)
{
{
@@ -200,9 +192,9 @@ namespace ExpressProfiler new[]
{
- textData, evt.LoginName, evt.CPU.ToString(), evt.Reads.ToString()
- , evt.Writes.ToString(), (evt.Duration/1000).ToString("#,0"), evt.SPID.ToString()
- , m_EventCount.ToString(),"","",""
+ textData, evt.LoginName, evt.CPU.ToString("#,0",CultureInfo.InvariantCulture), evt.Reads.ToString("#,0",CultureInfo.InvariantCulture)
+ , evt.Writes.ToString("#,0",CultureInfo.InvariantCulture), (evt.Duration/1000).ToString("#,0"), evt.SPID.ToString(CultureInfo.InvariantCulture)
+ , m_EventCount.ToString(CultureInfo.InvariantCulture),"","",""
}
);
lvi.Tag = new ProfilerEvent();
@@ -243,7 +235,7 @@ namespace ExpressProfiler return new SqlConnection
{
ConnectionString =
- edUser.Text==""?String.Format(@"Data Source = {0}; Initial Catalog = master; Integrated Security=SSPI;Application Name=Express Profiler",edServer.Text)
+ tbAuth.SelectedIndex==0?String.Format(@"Data Source = {0}; Initial Catalog = master; Integrated Security=SSPI;Application Name=Express Profiler",edServer.Text)
: String.Format(@"Data Source={0};Initial Catalog=master;User Id={1};Password={2};;Application Name=Express Profiler", edServer.Text, edUser.Text, edPassword.Text)
};
}
@@ -309,6 +301,14 @@ namespace ExpressProfiler ProfilerEventColumns.Writes, ProfilerEventColumns.Duration,
ProfilerEventColumns.SPID);
}
+ int dur;
+ if (Int32.TryParse(edDuration.Text, out dur))
+ {
+ if (dur > 0)
+ {
+ m_Rdr.SetFilter(ProfilerEventColumns.Duration, LogicalOperators.AND, ComparisonOperators.GreaterThanOrEqual, dur*1000);
+ }
+ }
m_Cmd.Connection = m_Conn;
m_Cmd.CommandTimeout = 0;
m_Rdr.SetFilter(ProfilerEventColumns.ApplicationName, LogicalOperators.AND, ComparisonOperators.NotLike, "Express Profiler");
@@ -415,14 +415,7 @@ namespace ExpressProfiler {
if (e.Control &&e.Shift && e.KeyCode == Keys.Delete)
{
- lock (lvEvents)
- {
- m_Cached.Clear();
- m_itembysql.Clear();
- lvEvents.VirtualListSize = 0;
- listView1_ItemSelectionChanged_1(lvEvents, null);
- lvEvents.Invalidate();
- }
+ ClearTrace();
}
}
@@ -431,87 +424,6 @@ namespace ExpressProfiler }
- private void toolStripButton1_Click_1(object sender, EventArgs e)
- {
-
- }
-
- private class EventComparer:IComparer<EvtInfo>
- {
- private readonly int m_idx;
- public EventComparer(int idx)
- {
- m_idx = idx;
- }
-
- public int Compare(EvtInfo x, EvtInfo y)
- {
- double xa, ya;
- switch (m_idx)
- {
- case 4:
- xa = x.Reads;
- ya = y.Reads;
- break;
- case 5:
- xa = x.Writes;
- ya = y.Writes;
- break;
- case 6:
- xa = x.Duration;
- ya = y.Duration;
- break;
- case 9:
- xa = x.Count;
- ya = y.Count;
- break;
- case 10:
- xa = x.Count == 0 ? 0 : (x.Duration*1.0 / x.Count);
- ya = y.Count == 0 ? 0 : (y.Duration*1.0 / y.Count);
- break;
- default:
- return 0;
- }
- return xa == ya ? String.Compare(x.TextData,y.TextData) : (xa > ya ? -1 : 1);
- }
-
- }
-
-
- private void Resort(int idx)
- {
- lock (m_Cached)
- {
- List<EvtInfo> lst = new List<EvtInfo>(m_itembysql.Count);
- foreach (ListViewItem lvi in m_itembysql.Values)
- {
- lst.Add((EvtInfo)lvi.Tag);
- }
- lst.Sort(new EventComparer(idx));
- lvEvents.Items.Clear();
- m_Cached.Clear();
- m_itembysql.Clear();
-
- foreach(EvtInfo evt in lst)
- {
- ListViewItem lvi = new ListViewItem("");
- m_itembysql[evt.TextData] = lvi;
- lvi.SubItems.AddRange(
- new[]
- {
-
- evt.TextData, "", evt.Cpu.ToString(), evt.Reads.ToString()
- , evt.Writes.ToString(), (evt.Duration/1000).ToString("#,0"), ""
- , "","1",(evt.Duration/1000).ToString("#,0"),(evt.Duration/1000).ToString("#,0")
- }
- );
- m_Cached.Add(lvi);
- lvi.Tag = evt;
- SetLVItemInfo(lvi,evt);
- }
- lvEvents.Invalidate();
- }
- }
private void timer1_Tick(object sender, EventArgs e)
{
@@ -544,5 +456,28 @@ namespace ExpressProfiler (sender as ToolStripMenuItem).Checked = !(sender as ToolStripMenuItem).Checked;
UpdateButtons();
}
+
+ private void tbAuth_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ UpdateButtons();
+ }
+
+ private void ClearTrace()
+ {
+ lock (lvEvents)
+ {
+ m_Cached.Clear();
+ m_itembysql.Clear();
+ lvEvents.VirtualListSize = 0;
+ listView1_ItemSelectionChanged_1(lvEvents, null);
+ lvEvents.Invalidate();
+ }
+ }
+
+ private void toolStripButton1_Click_1(object sender, EventArgs e)
+ {
+ ClearTrace();
+ }
+
}
}
diff --git a/ExpressProfiler/ExpressProfiler/MainForm.resx b/ExpressProfiler/ExpressProfiler/MainForm.resx index 9a82cb1..bd2e8e1 100644 --- a/ExpressProfiler/ExpressProfiler/MainForm.resx +++ b/ExpressProfiler/ExpressProfiler/MainForm.resx @@ -160,6 +160,16 @@ JNmM7kSQIchiAA9vkk6XhwD1AAAAAElFTkSuQmCC
</value>
</data>
+ <data name="toolStripButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADrSURBVDhPY2AY9KB9zq7/NZO2/U+rW/a/oG3jf5IcDNIM
+ A9+/f/+//eh1sEFEGYKiGWjK+/ff/n8H0lv3XiNsCLJmkK5n77//v3HvDRiDgF9qB25XoDobU3Nl++z/
+ Vl7J2A0gZDNIc3bV5P8qVkGYBhBjM0xz99yTqAaANAMDGQ7Q/QyyGRT6IJsxNIOiBCT47Nn3//eevQcH
+ GMiw91ATYc5Ws/LCrhlkACiBrN167v9iIAbFNSi0QfpBmkEYr2ZYogBFDciPINeA8JSl+8CacTobW2oC
+ ucAtsvx/UEoFmObg4MCLiUqRNFcEAEFVWfCcnU3PAAAAAElFTkSuQmCC
+</value>
+ </data>
<data name="cbSelectEvents.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
diff --git a/ExpressProfiler/ExpressProfiler/Properties/AssemblyInfo.cs b/ExpressProfiler/ExpressProfiler/Properties/AssemblyInfo.cs index ef1d24e..5a87604 100644 --- a/ExpressProfiler/ExpressProfiler/Properties/AssemblyInfo.cs +++ b/ExpressProfiler/ExpressProfiler/Properties/AssemblyInfo.cs @@ -6,11 +6,11 @@ using System.Runtime.InteropServices; // set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Express Profiler")]
-[assembly: AssemblyDescription("Profiler for SqlExpress, restricted demo version")]
+[assembly: AssemblyDescription("Profiler for SqlExpress")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Express Profiler")]
-[assembly: AssemblyCopyright("Copyright © Locky 2009-2011")]
+[assembly: AssemblyCopyright("Copyright © Locky 2009-2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.2.*")]
-[assembly: AssemblyFileVersion("1.2")]
+[assembly: AssemblyVersion("1.3.*")]
+[assembly: AssemblyFileVersion("1.3")]
diff --git a/ExpressProfiler/ExpressProfiler/RawTraceReader.cs b/ExpressProfiler/ExpressProfiler/RawTraceReader.cs index 5b200c4..f7259d6 100644 --- a/ExpressProfiler/ExpressProfiler/RawTraceReader.cs +++ b/ExpressProfiler/ExpressProfiler/RawTraceReader.cs @@ -1127,7 +1127,7 @@ order by trace_column_id }
// ReSharper disable UnusedMember.Global
- public void SetFilter(int columnId, int logicalOperator,int comparisonOperator,int? value)
+ public void SetFilter(int columnId, int logicalOperator,int comparisonOperator,long? value)
// ReSharper restore UnusedMember.Global
{
SqlCommand cmd = new SqlCommand { Connection = m_Conn, CommandText = "sp_trace_setfilter", CommandType = CommandType.StoredProcedure };
@@ -1141,7 +1141,52 @@ order by trace_column_id }
else
{
- cmd.Parameters.Add("@value", SqlDbType.Int).Value = value;
+ switch (columnId)
+ {
+ case ProfilerEventColumns.BigintData1:
+ case ProfilerEventColumns.BigintData2:
+ case ProfilerEventColumns.Duration:
+ case ProfilerEventColumns.EventSequence:
+ case ProfilerEventColumns.ObjectID2:
+ case ProfilerEventColumns.Permissions:
+ case ProfilerEventColumns.Reads:
+ case ProfilerEventColumns.RowCounts:
+ case ProfilerEventColumns.TransactionID:
+ case ProfilerEventColumns.Writes:
+ case ProfilerEventColumns.XactSequence:
+ cmd.Parameters.Add("@value", SqlDbType.BigInt).Value = value;
+ break;
+ case ProfilerEventColumns.ClientProcessID:
+ case ProfilerEventColumns.ColumnPermissions:
+ case ProfilerEventColumns.CPU:
+ case ProfilerEventColumns.DatabaseID:
+ case ProfilerEventColumns.Error:
+ case ProfilerEventColumns.EventClass:
+ case ProfilerEventColumns.EventSubClass:
+ case ProfilerEventColumns.Handle:
+ case ProfilerEventColumns.IndexID:
+ case ProfilerEventColumns.IntegerData:
+ case ProfilerEventColumns.IntegerData2:
+ case ProfilerEventColumns.IsSystem:
+ case ProfilerEventColumns.LineNumber:
+ case ProfilerEventColumns.Mode:
+ case ProfilerEventColumns.NestLevel:
+ case ProfilerEventColumns.ObjectID:
+ case ProfilerEventColumns.ObjectType:
+ case ProfilerEventColumns.Offset:
+ case ProfilerEventColumns.OwnerID:
+ case ProfilerEventColumns.RequestID:
+ case ProfilerEventColumns.Severity:
+ case ProfilerEventColumns.SourceDatabaseID:
+ case ProfilerEventColumns.SPID:
+ case ProfilerEventColumns.State:
+ case ProfilerEventColumns.Success:
+ case ProfilerEventColumns.Type:
+ cmd.Parameters.Add("@value", SqlDbType.Int).Value = value;
+ break;
+ default:
+ throw new Exception(String.Format("Unsupported column_id: {0}",columnId));
+ }
}
cmd.ExecuteNonQuery();
}
|