AsPerfMon
This commit is contained in:
parent
13a0846249
commit
7972ac54f4
22
AsPerfMon/ASPerfMon.sln
Normal file
22
AsPerfMon/ASPerfMon.sln
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio 14
|
||||||
|
VisualStudioVersion = 14.0.25420.1
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ASPerfMon", "ASPerfMon\ASPerfMon.csproj", "{B2442578-2C46-47D2-B5FB-57096C234552}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{B2442578-2C46-47D2-B5FB-57096C234552}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{B2442578-2C46-47D2-B5FB-57096C234552}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{B2442578-2C46-47D2-B5FB-57096C234552}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{B2442578-2C46-47D2-B5FB-57096C234552}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
BIN
AsPerfMon/AsPerfMon.png
Normal file
BIN
AsPerfMon/AsPerfMon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 133 KiB |
94
AsPerfMon/AsPerfMon/ASPerfMon.Designer.cs
generated
Normal file
94
AsPerfMon/AsPerfMon/ASPerfMon.Designer.cs
generated
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
namespace ASPerfMon
|
||||||
|
{
|
||||||
|
partial class ASPerfMon
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
||||||
|
System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
|
||||||
|
System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
||||||
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ASPerfMon));
|
||||||
|
this.chartControl = new System.Windows.Forms.DataVisualization.Charting.Chart();
|
||||||
|
this.btnConnect = new System.Windows.Forms.Button();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.chartControl)).BeginInit();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// chartControl
|
||||||
|
//
|
||||||
|
chartArea1.Name = "ChartArea1";
|
||||||
|
this.chartControl.ChartAreas.Add(chartArea1);
|
||||||
|
this.chartControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
legend1.Name = "Legend1";
|
||||||
|
this.chartControl.Legends.Add(legend1);
|
||||||
|
this.chartControl.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.chartControl.Name = "chartControl";
|
||||||
|
series1.ChartArea = "ChartArea1";
|
||||||
|
series1.Legend = "Legend1";
|
||||||
|
series1.Name = "Series1";
|
||||||
|
this.chartControl.Series.Add(series1);
|
||||||
|
this.chartControl.Size = new System.Drawing.Size(948, 645);
|
||||||
|
this.chartControl.TabIndex = 0;
|
||||||
|
this.chartControl.Text = "chart1";
|
||||||
|
this.chartControl.GetToolTipText += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.ToolTipEventArgs>(this.chartControl_GetToolTipText);
|
||||||
|
//
|
||||||
|
// btnConnect
|
||||||
|
//
|
||||||
|
this.btnConnect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.btnConnect.Location = new System.Drawing.Point(788, 567);
|
||||||
|
this.btnConnect.Name = "btnConnect";
|
||||||
|
this.btnConnect.Size = new System.Drawing.Size(127, 44);
|
||||||
|
this.btnConnect.TabIndex = 6;
|
||||||
|
this.btnConnect.Text = "Connect";
|
||||||
|
this.btnConnect.UseVisualStyleBackColor = true;
|
||||||
|
this.btnConnect.Click += new System.EventHandler(this.btnConnect_Click);
|
||||||
|
//
|
||||||
|
// ASPerfMon
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.BackColor = System.Drawing.Color.White;
|
||||||
|
this.ClientSize = new System.Drawing.Size(948, 645);
|
||||||
|
this.Controls.Add(this.btnConnect);
|
||||||
|
this.Controls.Add(this.chartControl);
|
||||||
|
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||||
|
this.Name = "ASPerfMon";
|
||||||
|
this.Text = "AS PerfMon";
|
||||||
|
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ASPerfMon_FormClosing);
|
||||||
|
this.Load += new System.EventHandler(this.ASPerfMon_Load);
|
||||||
|
this.Shown += new System.EventHandler(this.ASPerfMon_Shown);
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.chartControl)).EndInit();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.DataVisualization.Charting.Chart chartControl;
|
||||||
|
private System.Windows.Forms.Button btnConnect;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
394
AsPerfMon/AsPerfMon/ASPerfMon.cs
Normal file
394
AsPerfMon/AsPerfMon/ASPerfMon.cs
Normal file
@ -0,0 +1,394 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using System.Windows.Forms.DataVisualization.Charting;
|
||||||
|
using System.Timers;
|
||||||
|
using Microsoft.AnalysisServices;
|
||||||
|
using Tom = Microsoft.AnalysisServices.Tabular;
|
||||||
|
using System.Xml;
|
||||||
|
using System.Drawing;
|
||||||
|
|
||||||
|
namespace ASPerfMon
|
||||||
|
{
|
||||||
|
public partial class ASPerfMon : Form
|
||||||
|
{
|
||||||
|
public ASPerfMon()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Tom.Server _server = new Tom.Server();
|
||||||
|
private System.Timers.Timer _timer;
|
||||||
|
private const int _smallestFont = 12;
|
||||||
|
private string _serverConnectionString;
|
||||||
|
private DateTime _connectionTime;
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
//120 X axis markers, one for each array item.
|
||||||
|
//Each item holds a dictionary with lookup key of series name (e.g. database name), which returns a SeriesPoint object.
|
||||||
|
Dictionary<string, SeriesPoint>[] _seriesData = new Dictionary<string, SeriesPoint>[120];
|
||||||
|
|
||||||
|
class SeriesPoint
|
||||||
|
{
|
||||||
|
public string XAxisLabel;
|
||||||
|
public long MemoryUsedBytes;
|
||||||
|
public long MemoryUsedMegabytes
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return MemoryUsedBytes / 1024 / 1024;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public SeriesPoint(string xAxisCategoryName)
|
||||||
|
{
|
||||||
|
this.XAxisLabel = xAxisCategoryName;
|
||||||
|
this.MemoryUsedBytes = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ASPerfMon_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
InitializeChart(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeChart(bool withSampleSeries)
|
||||||
|
{
|
||||||
|
chartControl.ChartAreas[0].AxisX.MajorGrid.Enabled = false;
|
||||||
|
chartControl.ChartAreas[0].AxisX.Interval = 5;
|
||||||
|
chartControl.ChartAreas[0].AxisY.IsMarksNextToAxis = true;
|
||||||
|
chartControl.ChartAreas[0].AxisY.LabelStyle.Format = "{0:n0}";
|
||||||
|
chartControl.ChartAreas[0].AxisY.Title = "Memory Usage MB";
|
||||||
|
chartControl.Palette = ChartColorPalette.Pastel;
|
||||||
|
chartControl.ChartAreas[0].AxisY.TitleFont = new Font(Font.FontFamily, _smallestFont + 2);
|
||||||
|
chartControl.Legends[0].Font = new Font(Font.FontFamily, _smallestFont);
|
||||||
|
chartControl.Legends[0].LegendItemOrder = LegendItemOrder.ReversedSeriesOrder;
|
||||||
|
|
||||||
|
//initialize the chart with blanks
|
||||||
|
Dictionary<string, SeriesPoint> pointsSample;
|
||||||
|
if (withSampleSeries)
|
||||||
|
pointsSample = GetNewXAxisMarkerPointsFromAs();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pointsSample = new Dictionary<string, SeriesPoint>();
|
||||||
|
}
|
||||||
|
|
||||||
|
chartControl.Series.Clear();
|
||||||
|
if (withSampleSeries)
|
||||||
|
{
|
||||||
|
for (int i = _seriesData.Length - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
foreach (KeyValuePair<string, SeriesPoint> entry in pointsSample)//to get series
|
||||||
|
{
|
||||||
|
entry.Value.XAxisLabel = " ";
|
||||||
|
entry.Value.MemoryUsedBytes = 0;
|
||||||
|
|
||||||
|
//add the series if not there yet
|
||||||
|
if (chartControl.Series.FindByName(entry.Key) == null)
|
||||||
|
{
|
||||||
|
Series series = new Series(entry.Key);
|
||||||
|
chartControl.Series.Add(series);
|
||||||
|
}
|
||||||
|
chartControl.Series[entry.Key].Points.AddXY(" ", 0);
|
||||||
|
}
|
||||||
|
_seriesData[i] = pointsSample;
|
||||||
|
}
|
||||||
|
PaintChart();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
chartControl.Series.Add("");
|
||||||
|
for (int i = 0; i < _seriesData.Length; i++)
|
||||||
|
{
|
||||||
|
chartControl.Series[0].Points.AddXY(" ", 0);
|
||||||
|
}
|
||||||
|
chartControl.Invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
_timer = new System.Timers.Timer(Settings.Default.SampleInterval);
|
||||||
|
_timer.Elapsed += OnTimedEvent;
|
||||||
|
_timer.AutoReset = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PaintChart()
|
||||||
|
{
|
||||||
|
//set dynamic scale
|
||||||
|
long maxValue = 0;
|
||||||
|
for (int i = _seriesData.Length - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
long pointsStack = 0;
|
||||||
|
foreach (SeriesPoint point in _seriesData[i].Values)
|
||||||
|
{
|
||||||
|
pointsStack += Math.Abs(point.MemoryUsedMegabytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pointsStack > maxValue)
|
||||||
|
maxValue = pointsStack;
|
||||||
|
}
|
||||||
|
chartControl.ChartAreas[0].AxisY.IsStartedFromZero = true;
|
||||||
|
chartControl.ChartAreas[0].AxisY.Minimum = double.NaN;
|
||||||
|
chartControl.ChartAreas[0].AxisY.Maximum = double.NaN;
|
||||||
|
chartControl.ChartAreas[0].RecalculateAxesScale();
|
||||||
|
chartControl.Invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
delegate void SetTimerCallback(Object source, ElapsedEventArgs e);
|
||||||
|
private void OnTimedEvent(Object source, ElapsedEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (chartControl.InvokeRequired)
|
||||||
|
{
|
||||||
|
SetTimerCallback callback = new SetTimerCallback(OnTimedEvent);
|
||||||
|
//todo safer invoke look up bism
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Invoke(callback, new object[] { source, e });
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Todo delete this once http stability fix is done
|
||||||
|
if ((DateTime.Now - _connectionTime).TotalMinutes > 8)
|
||||||
|
{
|
||||||
|
_server.Disconnect();
|
||||||
|
_server.Connect(_serverConnectionString);
|
||||||
|
_connectionTime = DateTime.Now;
|
||||||
|
}
|
||||||
|
|
||||||
|
_seriesData[0] = GetNewXAxisMarkerPointsFromAs();
|
||||||
|
|
||||||
|
//rebind
|
||||||
|
chartControl.Series.Clear();
|
||||||
|
|
||||||
|
//for each X axis marker
|
||||||
|
for (int i = _seriesData.Length - 1; i > 0; i--)
|
||||||
|
{
|
||||||
|
//push back one category
|
||||||
|
_seriesData[i] = _seriesData[i - 1];
|
||||||
|
|
||||||
|
//foreach series for the X axis marker we are populating: ...
|
||||||
|
foreach (KeyValuePair<string, SeriesPoint> entry in _seriesData[i])
|
||||||
|
{
|
||||||
|
//add the series if not there yet
|
||||||
|
if (chartControl.Series.FindByName(entry.Key) == null)
|
||||||
|
{
|
||||||
|
Series series = new Series(entry.Key);
|
||||||
|
series.ChartType = SeriesChartType.StackedColumn;
|
||||||
|
chartControl.Series.Add(series);
|
||||||
|
}
|
||||||
|
|
||||||
|
//add the data point for the series
|
||||||
|
DataPoint point = new DataPoint();
|
||||||
|
point.SetValueXY(entry.Value.XAxisLabel, entry.Value.MemoryUsedMegabytes);
|
||||||
|
point.ToolTip = string.Format($"{entry.Value.XAxisLabel} - {entry.Key}: {string.Format("{0:#,###0}", entry.Value.MemoryUsedMegabytes)} MB");
|
||||||
|
chartControl.Series[entry.Key].Points.Add(point);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
PaintChart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
//Workaround for timeout over HTTP. Try to reconnect - todo delete
|
||||||
|
try
|
||||||
|
{
|
||||||
|
System.Diagnostics.Debug.WriteLine($"Exception occurred at {DateTime.Now}: {exc.Message}");
|
||||||
|
_server.Disconnect();
|
||||||
|
_server.Connect(_serverConnectionString);
|
||||||
|
_connectionTime = DateTime.Now;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
_timer.Enabled = false;
|
||||||
|
MessageBox.Show($"Error: {exc.Message}", "AS PerfMon", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Dictionary<string, SeriesPoint> GetNewXAxisMarkerPointsFromAs()
|
||||||
|
{
|
||||||
|
Dictionary<string, SeriesPoint> points = new Dictionary<string, SeriesPoint>();
|
||||||
|
string xAxisLabel = DateTime.Now.ToString("hh:mm:ss tt");
|
||||||
|
string commandStatement = String.Format("SELECT [OBJECT_PARENT_PATH], [OBJECT_MEMORY_NONSHRINKABLE] FROM $SYSTEM.DISCOVER_OBJECT_MEMORY_USAGE");
|
||||||
|
XmlNodeList rows = ExecuteXmlaCommand(_server, commandStatement);
|
||||||
|
|
||||||
|
foreach (XmlNode row in rows)
|
||||||
|
{
|
||||||
|
long result, label;
|
||||||
|
if (long.TryParse(row.LastChild.InnerText, out result) && result > 0)
|
||||||
|
{
|
||||||
|
string objectName = "";
|
||||||
|
string[] pathMembers = row.ChildNodes[0].InnerText.Split('.');
|
||||||
|
|
||||||
|
if (pathMembers.Length > 2 && _server.Databases.ContainsName(pathMembers[2]))
|
||||||
|
{
|
||||||
|
//Database name identified
|
||||||
|
objectName = pathMembers[2];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string firstMember = row.ChildNodes[0].InnerText;
|
||||||
|
|
||||||
|
//Ignore if number or blank. Assuming this is a double counted, shared allocation.
|
||||||
|
if (!long.TryParse(firstMember, out label) && firstMember != "")
|
||||||
|
{
|
||||||
|
objectName = firstMember;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (objectName != "" && objectName != "Global") //todo: delete global condition
|
||||||
|
{
|
||||||
|
if (!points.ContainsKey(objectName))
|
||||||
|
points.Add(objectName, new SeriesPoint(xAxisLabel));
|
||||||
|
|
||||||
|
points[objectName].MemoryUsedBytes += Math.Abs(result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (result > 0)
|
||||||
|
{
|
||||||
|
System.Diagnostics.Debug.WriteLine("We have a problem parsing");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return points;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static XmlNodeList ExecuteXmlaCommand(Microsoft.AnalysisServices.Core.Server amoServer, string commandStatement)
|
||||||
|
{
|
||||||
|
XmlWriter xmlWriter = amoServer.StartXmlaRequest(XmlaRequestType.Undefined);
|
||||||
|
WriteSoapEnvelopeWithCommandStatement(xmlWriter, amoServer.SessionID, commandStatement);
|
||||||
|
System.Xml.XmlReader xmlReader = amoServer.EndXmlaRequest();
|
||||||
|
xmlReader.MoveToContent();
|
||||||
|
string fullEnvelopeResponseFromServer = xmlReader.ReadOuterXml();
|
||||||
|
xmlReader.Close();
|
||||||
|
|
||||||
|
XmlDocument documentResponse = new XmlDocument();
|
||||||
|
documentResponse.LoadXml(fullEnvelopeResponseFromServer);
|
||||||
|
XmlNamespaceManager nsmgr = new XmlNamespaceManager(documentResponse.NameTable);
|
||||||
|
nsmgr.AddNamespace("myns1", "urn:schemas-microsoft-com:xml-analysis");
|
||||||
|
nsmgr.AddNamespace("myns2", "urn:schemas-microsoft-com:xml-analysis:rowset");
|
||||||
|
XmlNodeList rows = documentResponse.SelectNodes("//myns1:ExecuteResponse/myns1:return/myns2:root/myns2:row", nsmgr);
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void WriteSoapEnvelopeWithCommandStatement(XmlWriter xmlWriter, string sessionId, string commandStatement)
|
||||||
|
{
|
||||||
|
//--------------------------------------------------------------------------------
|
||||||
|
// This is a sample of the XMLA request we'll write:
|
||||||
|
//
|
||||||
|
// <Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
|
||||||
|
// <Header>
|
||||||
|
// <Session soap:mustUnderstand="1" SessionId="THE SESSION ID HERE" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:schemas-microsoft-com:xml-analysis" />
|
||||||
|
// </Header>
|
||||||
|
// <Body>
|
||||||
|
// <Execute xmlns="urn:schemas-microsoft-com:xml-analysis">
|
||||||
|
// <Command>
|
||||||
|
// <Statement>
|
||||||
|
// ...
|
||||||
|
// </Statement>
|
||||||
|
// </Command>
|
||||||
|
// <Properties/>
|
||||||
|
// </Execute>
|
||||||
|
// </Body>
|
||||||
|
// </Envelope>
|
||||||
|
//--------------------------------------------------------------------------------
|
||||||
|
xmlWriter.WriteStartElement("Envelope", "http://schemas.xmlsoap.org/soap/envelope/");
|
||||||
|
xmlWriter.WriteStartElement("Header");
|
||||||
|
if (sessionId != null)
|
||||||
|
{
|
||||||
|
xmlWriter.WriteStartElement("Session", "urn:schemas-microsoft-com:xml-analysis");
|
||||||
|
xmlWriter.WriteAttributeString("soap", "mustUnderstand", "http://schemas.xmlsoap.org/soap/envelope/", "1");
|
||||||
|
xmlWriter.WriteAttributeString("SessionId", sessionId);
|
||||||
|
xmlWriter.WriteEndElement(); // </Session>
|
||||||
|
}
|
||||||
|
xmlWriter.WriteEndElement(); // </Header>
|
||||||
|
xmlWriter.WriteStartElement("Body");
|
||||||
|
xmlWriter.WriteStartElement("Execute", "urn:schemas-microsoft-com:xml-analysis");
|
||||||
|
xmlWriter.WriteStartElement("Command");
|
||||||
|
xmlWriter.WriteElementString("Statement", commandStatement);
|
||||||
|
xmlWriter.WriteEndElement(); // </Command>
|
||||||
|
xmlWriter.WriteStartElement("Properties");
|
||||||
|
xmlWriter.WriteEndElement(); // </Properties>
|
||||||
|
xmlWriter.WriteEndElement(); // </Execute>
|
||||||
|
xmlWriter.WriteEndElement(); // </Body>
|
||||||
|
xmlWriter.WriteEndElement(); // </Envelope>
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnConnect_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Connect();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Connect()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Connect connForm = new Connect();
|
||||||
|
connForm.StartPosition = FormStartPosition.CenterParent;
|
||||||
|
connForm.ShowDialog();
|
||||||
|
|
||||||
|
if (connForm.DialogResult == DialogResult.OK)
|
||||||
|
{
|
||||||
|
_timer.Enabled = false;
|
||||||
|
|
||||||
|
if (connForm.IntegratedAuth)
|
||||||
|
_serverConnectionString = $"Provider=MSOLAP;Data Source={connForm.ServerName};";
|
||||||
|
else
|
||||||
|
_serverConnectionString = $"Provider=MSOLAP;Data Source={connForm.ServerName};User ID={connForm.UserName};Password={connForm.Passwrod};Persist Security Info=True;Impersonation Level=Impersonate;";
|
||||||
|
|
||||||
|
_server = new Tom.Server();
|
||||||
|
_server.Connect(_serverConnectionString);
|
||||||
|
_connectionTime = DateTime.Now;
|
||||||
|
if (_server.ServerProperties.Count == 0)
|
||||||
|
{
|
||||||
|
throw new ConnectionException("User is not AS admin.");
|
||||||
|
}
|
||||||
|
|
||||||
|
chartControl.Titles.Clear();
|
||||||
|
chartControl.Titles.Add(connForm.ServerName);
|
||||||
|
chartControl.Titles[0].Font = new Font(Font.FontFamily, _smallestFont + 4);
|
||||||
|
|
||||||
|
InitializeChart(true);
|
||||||
|
_timer.Interval = connForm.SampleInterval;
|
||||||
|
_timer.Enabled = true;
|
||||||
|
|
||||||
|
Settings.Default.ServerName = connForm.ServerName;
|
||||||
|
Settings.Default.UserName = connForm.UserName;
|
||||||
|
Settings.Default.SampleInterval = connForm.SampleInterval;
|
||||||
|
Settings.Default.IntegratedAuth = connForm.IntegratedAuth;
|
||||||
|
Settings.Default.Save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"Cannot connect.\n{exc.Message}", "AS PerfMon", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ASPerfMon_FormClosing(object sender, FormClosingEventArgs e)
|
||||||
|
{
|
||||||
|
Disconnect();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Disconnect()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (_server != null) _server.Disconnect();
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
}
|
||||||
|
|
||||||
|
private void chartControl_GetToolTipText(object sender, ToolTipEventArgs e)
|
||||||
|
{
|
||||||
|
//Event handler has to be hooked up in order to display tooltip (!)
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ASPerfMon_Shown(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Connect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
160
AsPerfMon/AsPerfMon/ASPerfMon.csproj
Normal file
160
AsPerfMon/AsPerfMon/ASPerfMon.csproj
Normal file
@ -0,0 +1,160 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{B2442578-2C46-47D2-B5FB-57096C234552}</ProjectGuid>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>ASPerfMon</RootNamespace>
|
||||||
|
<AssemblyName>ASPerfMon</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
<PublishUrl>publish\</PublishUrl>
|
||||||
|
<Install>true</Install>
|
||||||
|
<InstallFrom>Disk</InstallFrom>
|
||||||
|
<UpdateEnabled>false</UpdateEnabled>
|
||||||
|
<UpdateMode>Foreground</UpdateMode>
|
||||||
|
<UpdateInterval>7</UpdateInterval>
|
||||||
|
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||||
|
<UpdatePeriodically>false</UpdatePeriodically>
|
||||||
|
<UpdateRequired>false</UpdateRequired>
|
||||||
|
<MapFileExtensions>true</MapFileExtensions>
|
||||||
|
<ApplicationRevision>0</ApplicationRevision>
|
||||||
|
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||||
|
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||||
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
|
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<ApplicationIcon>Chart.ico</ApplicationIcon>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="Microsoft.AnalysisServices, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Microsoft SQL Server\130\SDK\Assemblies\Microsoft.AnalysisServices.DLL</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.AnalysisServices.Core, Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Microsoft SQL Server\130\SDK\Assemblies\Microsoft.AnalysisServices.Core.DLL</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.AnalysisServices.Tabular, Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Microsoft SQL Server\130\SDK\Assemblies\Microsoft.AnalysisServices.Tabular.DLL</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.AnalysisServices.Tabular.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Microsoft SQL Server\130\SDK\Assemblies\Microsoft.AnalysisServices.Tabular.Json.DLL</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Windows.Forms.DataVisualization" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Deployment" />
|
||||||
|
<Reference Include="System.Drawing" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Windows.Forms" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="ASPerfMon.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="ASPerfMon.Designer.cs">
|
||||||
|
<DependentUpon>ASPerfMon.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Connect.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Connect.Designer.cs">
|
||||||
|
<DependentUpon>Connect.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Program.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="Settings.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<EmbeddedResource Include="ASPerfMon.resx">
|
||||||
|
<DependentUpon>ASPerfMon.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Connect.resx">
|
||||||
|
<DependentUpon>Connect.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
</Compile>
|
||||||
|
<None Include="packages.config" />
|
||||||
|
<None Include="Properties\Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
</Compile>
|
||||||
|
<None Include="Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="Chart.ico" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<BootstrapperPackage Include=".NETFramework,Version=v4.5.2">
|
||||||
|
<Visible>False</Visible>
|
||||||
|
<ProductName>Microsoft .NET Framework 4.5.2 %28x86 and x64%29</ProductName>
|
||||||
|
<Install>true</Install>
|
||||||
|
</BootstrapperPackage>
|
||||||
|
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||||
|
<Visible>False</Visible>
|
||||||
|
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||||
|
<Install>false</Install>
|
||||||
|
</BootstrapperPackage>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
<Target Name="BeforeBuild">
|
||||||
|
</Target>
|
||||||
|
<Target Name="AfterBuild">
|
||||||
|
</Target>
|
||||||
|
-->
|
||||||
|
</Project>
|
2937
AsPerfMon/AsPerfMon/ASPerfMon.resx
Normal file
2937
AsPerfMon/AsPerfMon/ASPerfMon.resx
Normal file
File diff suppressed because it is too large
Load Diff
27
AsPerfMon/AsPerfMon/App.config
Normal file
27
AsPerfMon/AsPerfMon/App.config
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<configSections>
|
||||||
|
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||||
|
<section name="ASPerfMon.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
|
</sectionGroup>
|
||||||
|
</configSections>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||||
|
</startup>
|
||||||
|
<userSettings>
|
||||||
|
<ASPerfMon.Settings>
|
||||||
|
<setting name="ServerName" serializeAs="String">
|
||||||
|
<value />
|
||||||
|
</setting>
|
||||||
|
<setting name="UserName" serializeAs="String">
|
||||||
|
<value />
|
||||||
|
</setting>
|
||||||
|
<setting name="SampleInterval" serializeAs="String">
|
||||||
|
<value>2500</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="IntegratedAuth" serializeAs="String">
|
||||||
|
<value>False</value>
|
||||||
|
</setting>
|
||||||
|
</ASPerfMon.Settings>
|
||||||
|
</userSettings>
|
||||||
|
</configuration>
|
BIN
AsPerfMon/AsPerfMon/Chart.ico
Normal file
BIN
AsPerfMon/AsPerfMon/Chart.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 165 KiB |
210
AsPerfMon/AsPerfMon/Connect.Designer.cs
generated
Normal file
210
AsPerfMon/AsPerfMon/Connect.Designer.cs
generated
Normal file
@ -0,0 +1,210 @@
|
|||||||
|
namespace ASPerfMon
|
||||||
|
{
|
||||||
|
partial class Connect
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.btnOK = new System.Windows.Forms.Button();
|
||||||
|
this.btnCancel = new System.Windows.Forms.Button();
|
||||||
|
this.txtUserName = new System.Windows.Forms.TextBox();
|
||||||
|
this.txtServer = new System.Windows.Forms.TextBox();
|
||||||
|
this.label3 = new System.Windows.Forms.Label();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.chkIntegratedAuth = new System.Windows.Forms.CheckBox();
|
||||||
|
this.txtPassword = new System.Windows.Forms.TextBox();
|
||||||
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
|
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.txtSampleInterval = new System.Windows.Forms.TextBox();
|
||||||
|
this.label4 = new System.Windows.Forms.Label();
|
||||||
|
this.groupBox1.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// btnOK
|
||||||
|
//
|
||||||
|
this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.btnOK.Location = new System.Drawing.Point(264, 179);
|
||||||
|
this.btnOK.Name = "btnOK";
|
||||||
|
this.btnOK.Size = new System.Drawing.Size(75, 23);
|
||||||
|
this.btnOK.TabIndex = 0;
|
||||||
|
this.btnOK.Text = "OK";
|
||||||
|
this.btnOK.UseVisualStyleBackColor = true;
|
||||||
|
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
|
||||||
|
//
|
||||||
|
// btnCancel
|
||||||
|
//
|
||||||
|
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||||
|
this.btnCancel.Location = new System.Drawing.Point(345, 179);
|
||||||
|
this.btnCancel.Name = "btnCancel";
|
||||||
|
this.btnCancel.Size = new System.Drawing.Size(75, 23);
|
||||||
|
this.btnCancel.TabIndex = 1;
|
||||||
|
this.btnCancel.Text = "Cancel";
|
||||||
|
this.btnCancel.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// txtUserName
|
||||||
|
//
|
||||||
|
this.txtUserName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.txtUserName.Location = new System.Drawing.Point(111, 62);
|
||||||
|
this.txtUserName.Name = "txtUserName";
|
||||||
|
this.txtUserName.Size = new System.Drawing.Size(310, 20);
|
||||||
|
this.txtUserName.TabIndex = 10;
|
||||||
|
//
|
||||||
|
// txtServer
|
||||||
|
//
|
||||||
|
this.txtServer.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.txtServer.Location = new System.Drawing.Point(111, 13);
|
||||||
|
this.txtServer.Name = "txtServer";
|
||||||
|
this.txtServer.Size = new System.Drawing.Size(310, 20);
|
||||||
|
this.txtServer.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// label3
|
||||||
|
//
|
||||||
|
this.label3.AutoSize = true;
|
||||||
|
this.label3.Location = new System.Drawing.Point(6, 65);
|
||||||
|
this.label3.Name = "label3";
|
||||||
|
this.label3.Size = new System.Drawing.Size(63, 13);
|
||||||
|
this.label3.TabIndex = 8;
|
||||||
|
this.label3.Text = "User Name:";
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Location = new System.Drawing.Point(6, 16);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(41, 13);
|
||||||
|
this.label1.TabIndex = 6;
|
||||||
|
this.label1.Text = "Server:";
|
||||||
|
//
|
||||||
|
// chkIntegratedAuth
|
||||||
|
//
|
||||||
|
this.chkIntegratedAuth.AutoSize = true;
|
||||||
|
this.chkIntegratedAuth.Location = new System.Drawing.Point(111, 39);
|
||||||
|
this.chkIntegratedAuth.Name = "chkIntegratedAuth";
|
||||||
|
this.chkIntegratedAuth.Size = new System.Drawing.Size(145, 17);
|
||||||
|
this.chkIntegratedAuth.TabIndex = 2;
|
||||||
|
this.chkIntegratedAuth.Text = "Integrated Authentication";
|
||||||
|
this.chkIntegratedAuth.UseVisualStyleBackColor = true;
|
||||||
|
this.chkIntegratedAuth.CheckedChanged += new System.EventHandler(this.chkIntegratedAuth_CheckedChanged);
|
||||||
|
//
|
||||||
|
// txtPassword
|
||||||
|
//
|
||||||
|
this.txtPassword.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.txtPassword.Location = new System.Drawing.Point(111, 88);
|
||||||
|
this.txtPassword.Name = "txtPassword";
|
||||||
|
this.txtPassword.PasswordChar = '*';
|
||||||
|
this.txtPassword.Size = new System.Drawing.Size(310, 20);
|
||||||
|
this.txtPassword.TabIndex = 13;
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
this.label2.AutoSize = true;
|
||||||
|
this.label2.Location = new System.Drawing.Point(6, 91);
|
||||||
|
this.label2.Name = "label2";
|
||||||
|
this.label2.Size = new System.Drawing.Size(56, 13);
|
||||||
|
this.label2.TabIndex = 12;
|
||||||
|
this.label2.Text = "Password:";
|
||||||
|
//
|
||||||
|
// groupBox1
|
||||||
|
//
|
||||||
|
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.groupBox1.Controls.Add(this.txtUserName);
|
||||||
|
this.groupBox1.Controls.Add(this.txtPassword);
|
||||||
|
this.groupBox1.Controls.Add(this.label1);
|
||||||
|
this.groupBox1.Controls.Add(this.label2);
|
||||||
|
this.groupBox1.Controls.Add(this.label3);
|
||||||
|
this.groupBox1.Controls.Add(this.chkIntegratedAuth);
|
||||||
|
this.groupBox1.Controls.Add(this.txtServer);
|
||||||
|
this.groupBox1.Location = new System.Drawing.Point(12, 12);
|
||||||
|
this.groupBox1.Name = "groupBox1";
|
||||||
|
this.groupBox1.Size = new System.Drawing.Size(427, 123);
|
||||||
|
this.groupBox1.TabIndex = 14;
|
||||||
|
this.groupBox1.TabStop = false;
|
||||||
|
//
|
||||||
|
// txtSampleInterval
|
||||||
|
//
|
||||||
|
this.txtSampleInterval.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.txtSampleInterval.Location = new System.Drawing.Point(123, 141);
|
||||||
|
this.txtSampleInterval.Name = "txtSampleInterval";
|
||||||
|
this.txtSampleInterval.Size = new System.Drawing.Size(310, 20);
|
||||||
|
this.txtSampleInterval.TabIndex = 15;
|
||||||
|
this.txtSampleInterval.Text = "1000";
|
||||||
|
//
|
||||||
|
// label4
|
||||||
|
//
|
||||||
|
this.label4.AutoSize = true;
|
||||||
|
this.label4.Location = new System.Drawing.Point(18, 144);
|
||||||
|
this.label4.Name = "label4";
|
||||||
|
this.label4.Size = new System.Drawing.Size(105, 13);
|
||||||
|
this.label4.TabIndex = 14;
|
||||||
|
this.label4.Text = "Sample Interval (ms):";
|
||||||
|
//
|
||||||
|
// Connect
|
||||||
|
//
|
||||||
|
this.AcceptButton = this.btnOK;
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.CancelButton = this.btnCancel;
|
||||||
|
this.ClientSize = new System.Drawing.Size(450, 219);
|
||||||
|
this.Controls.Add(this.txtSampleInterval);
|
||||||
|
this.Controls.Add(this.label4);
|
||||||
|
this.Controls.Add(this.groupBox1);
|
||||||
|
this.Controls.Add(this.btnCancel);
|
||||||
|
this.Controls.Add(this.btnOK);
|
||||||
|
this.MaximizeBox = false;
|
||||||
|
this.MinimizeBox = false;
|
||||||
|
this.Name = "Connect";
|
||||||
|
this.ShowIcon = false;
|
||||||
|
this.Text = "Connect";
|
||||||
|
this.Load += new System.EventHandler(this.Connect_Load);
|
||||||
|
this.groupBox1.ResumeLayout(false);
|
||||||
|
this.groupBox1.PerformLayout();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.Button btnOK;
|
||||||
|
private System.Windows.Forms.Button btnCancel;
|
||||||
|
private System.Windows.Forms.TextBox txtUserName;
|
||||||
|
private System.Windows.Forms.TextBox txtServer;
|
||||||
|
private System.Windows.Forms.Label label3;
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
private System.Windows.Forms.CheckBox chkIntegratedAuth;
|
||||||
|
private System.Windows.Forms.TextBox txtPassword;
|
||||||
|
private System.Windows.Forms.Label label2;
|
||||||
|
private System.Windows.Forms.GroupBox groupBox1;
|
||||||
|
private System.Windows.Forms.TextBox txtSampleInterval;
|
||||||
|
private System.Windows.Forms.Label label4;
|
||||||
|
}
|
||||||
|
}
|
70
AsPerfMon/AsPerfMon/Connect.cs
Normal file
70
AsPerfMon/AsPerfMon/Connect.cs
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace ASPerfMon
|
||||||
|
{
|
||||||
|
public partial class Connect : Form
|
||||||
|
{
|
||||||
|
public string ServerName { get; set; }
|
||||||
|
public bool IntegratedAuth { get; set; }
|
||||||
|
public string UserName { get; set; }
|
||||||
|
public string Passwrod { get; set; }
|
||||||
|
public int SampleInterval { get; set; }
|
||||||
|
|
||||||
|
public Connect()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Connect_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
this.txtServer.Text = Settings.Default.ServerName;
|
||||||
|
this.chkIntegratedAuth.Checked = Settings.Default.IntegratedAuth;
|
||||||
|
this.txtUserName.Text = Settings.Default.UserName;
|
||||||
|
this.txtSampleInterval.Text = Settings.Default.SampleInterval.ToString();
|
||||||
|
|
||||||
|
this.txtServer.MouseDown += new System.Windows.Forms.MouseEventHandler(this.txt_MouseDown);
|
||||||
|
this.txtUserName.MouseDown += new System.Windows.Forms.MouseEventHandler(this.txt_MouseDown);
|
||||||
|
this.txtPassword.MouseDown += new System.Windows.Forms.MouseEventHandler(this.txt_MouseDown);
|
||||||
|
this.txtSampleInterval.MouseDown += new System.Windows.Forms.MouseEventHandler(this.txt_MouseDown);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void chkIntegratedAuth_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
txtUserName.Enabled = !chkIntegratedAuth.Checked;
|
||||||
|
txtPassword.Enabled = !chkIntegratedAuth.Checked;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnOK_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
int sampleInterval;
|
||||||
|
if (!int.TryParse(txtSampleInterval.Text, out sampleInterval))
|
||||||
|
{
|
||||||
|
MessageBox.Show("Sample Interval must be a positive integer", "AS PerfMon", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.ServerName = txtServer.Text;
|
||||||
|
this.IntegratedAuth = chkIntegratedAuth.Checked;
|
||||||
|
this.UserName = txtUserName.Text;
|
||||||
|
this.Passwrod = txtPassword.Text;
|
||||||
|
this.SampleInterval = sampleInterval;
|
||||||
|
|
||||||
|
this.DialogResult = DialogResult.OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void txt_MouseDown(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
TextBox textBox = (TextBox)sender;
|
||||||
|
textBox.SelectAll();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
123
AsPerfMon/AsPerfMon/Connect.resx
Normal file
123
AsPerfMon/AsPerfMon/Connect.resx
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
</root>
|
23
AsPerfMon/AsPerfMon/Program.cs
Normal file
23
AsPerfMon/AsPerfMon/Program.cs
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace ASPerfMon
|
||||||
|
{
|
||||||
|
static class Program
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The main entry point for the application.
|
||||||
|
/// </summary>
|
||||||
|
[STAThread]
|
||||||
|
static void Main()
|
||||||
|
{
|
||||||
|
Application.EnableVisualStyles();
|
||||||
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
|
|
||||||
|
Application.Run(new ASPerfMon());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
36
AsPerfMon/AsPerfMon/Properties/AssemblyInfo.cs
Normal file
36
AsPerfMon/AsPerfMon/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("ASPerfMon")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("Microsoft Corporation")]
|
||||||
|
[assembly: AssemblyProduct("ASPerfMon")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © Microsoft Corporation 2016")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
|
// to COM components. If you need to access a type in this assembly from
|
||||||
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
|
[assembly: Guid("b2442578-2c46-47d2-b5fb-57096c234552")]
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// 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.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
63
AsPerfMon/AsPerfMon/Properties/Resources.Designer.cs
generated
Normal file
63
AsPerfMon/AsPerfMon/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace ASPerfMon.Properties {
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||||
|
/// </summary>
|
||||||
|
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||||
|
// class via a tool like ResGen or Visual Studio.
|
||||||
|
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||||
|
// with the /str option, or rebuild your VS project.
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
internal class Resources {
|
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal Resources() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the cached ResourceManager instance used by this class.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||||
|
get {
|
||||||
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ASPerfMon.Properties.Resources", typeof(Resources).Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Overrides the current thread's CurrentUICulture property for all
|
||||||
|
/// resource lookups using this strongly typed resource class.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
|
get {
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
117
AsPerfMon/AsPerfMon/Properties/Resources.resx
Normal file
117
AsPerfMon/AsPerfMon/Properties/Resources.resx
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
26
AsPerfMon/AsPerfMon/Properties/Settings.Designer.cs
generated
Normal file
26
AsPerfMon/AsPerfMon/Properties/Settings.Designer.cs
generated
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace ASPerfMon.Properties {
|
||||||
|
|
||||||
|
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
||||||
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
|
public static Settings Default {
|
||||||
|
get {
|
||||||
|
return defaultInstance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
7
AsPerfMon/AsPerfMon/Properties/Settings.settings
Normal file
7
AsPerfMon/AsPerfMon/Properties/Settings.settings
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||||
|
<Profiles>
|
||||||
|
<Profile Name="(Default)" />
|
||||||
|
</Profiles>
|
||||||
|
<Settings />
|
||||||
|
</SettingsFile>
|
74
AsPerfMon/AsPerfMon/Settings.Designer.cs
generated
Normal file
74
AsPerfMon/AsPerfMon/Settings.Designer.cs
generated
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace ASPerfMon {
|
||||||
|
|
||||||
|
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
||||||
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
|
public static Settings Default {
|
||||||
|
get {
|
||||||
|
return defaultInstance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||||
|
public string ServerName {
|
||||||
|
get {
|
||||||
|
return ((string)(this["ServerName"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["ServerName"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||||
|
public string UserName {
|
||||||
|
get {
|
||||||
|
return ((string)(this["UserName"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["UserName"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("2500")]
|
||||||
|
public int SampleInterval {
|
||||||
|
get {
|
||||||
|
return ((int)(this["SampleInterval"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["SampleInterval"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||||
|
public bool IntegratedAuth {
|
||||||
|
get {
|
||||||
|
return ((bool)(this["IntegratedAuth"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["IntegratedAuth"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
18
AsPerfMon/AsPerfMon/Settings.settings
Normal file
18
AsPerfMon/AsPerfMon/Settings.settings
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="ASPerfMon" GeneratedClassName="Settings">
|
||||||
|
<Profiles />
|
||||||
|
<Settings>
|
||||||
|
<Setting Name="ServerName" Type="System.String" Scope="User">
|
||||||
|
<Value Profile="(Default)" />
|
||||||
|
</Setting>
|
||||||
|
<Setting Name="UserName" Type="System.String" Scope="User">
|
||||||
|
<Value Profile="(Default)" />
|
||||||
|
</Setting>
|
||||||
|
<Setting Name="SampleInterval" Type="System.Int32" Scope="User">
|
||||||
|
<Value Profile="(Default)">2500</Value>
|
||||||
|
</Setting>
|
||||||
|
<Setting Name="IntegratedAuth" Type="System.Boolean" Scope="User">
|
||||||
|
<Value Profile="(Default)">False</Value>
|
||||||
|
</Setting>
|
||||||
|
</Settings>
|
||||||
|
</SettingsFile>
|
27
AsPerfMon/AsPerfMon/bin/Debug/ASPerfMon.exe.config
Normal file
27
AsPerfMon/AsPerfMon/bin/Debug/ASPerfMon.exe.config
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<configSections>
|
||||||
|
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||||
|
<section name="ASPerfMon.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
|
</sectionGroup>
|
||||||
|
</configSections>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||||
|
</startup>
|
||||||
|
<userSettings>
|
||||||
|
<ASPerfMon.Settings>
|
||||||
|
<setting name="ServerName" serializeAs="String">
|
||||||
|
<value />
|
||||||
|
</setting>
|
||||||
|
<setting name="UserName" serializeAs="String">
|
||||||
|
<value />
|
||||||
|
</setting>
|
||||||
|
<setting name="SampleInterval" serializeAs="String">
|
||||||
|
<value>2500</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="IntegratedAuth" serializeAs="String">
|
||||||
|
<value>False</value>
|
||||||
|
</setting>
|
||||||
|
</ASPerfMon.Settings>
|
||||||
|
</userSettings>
|
||||||
|
</configuration>
|
BIN
AsPerfMon/AsPerfMon/bin/Debug/ASPerfMon.vshost.exe
Normal file
BIN
AsPerfMon/AsPerfMon/bin/Debug/ASPerfMon.vshost.exe
Normal file
Binary file not shown.
27
AsPerfMon/AsPerfMon/bin/Debug/ASPerfMon.vshost.exe.config
Normal file
27
AsPerfMon/AsPerfMon/bin/Debug/ASPerfMon.vshost.exe.config
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<configSections>
|
||||||
|
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||||
|
<section name="ASPerfMon.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
|
</sectionGroup>
|
||||||
|
</configSections>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||||
|
</startup>
|
||||||
|
<userSettings>
|
||||||
|
<ASPerfMon.Settings>
|
||||||
|
<setting name="ServerName" serializeAs="String">
|
||||||
|
<value />
|
||||||
|
</setting>
|
||||||
|
<setting name="UserName" serializeAs="String">
|
||||||
|
<value />
|
||||||
|
</setting>
|
||||||
|
<setting name="SampleInterval" serializeAs="String">
|
||||||
|
<value>2500</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="IntegratedAuth" serializeAs="String">
|
||||||
|
<value>False</value>
|
||||||
|
</setting>
|
||||||
|
</ASPerfMon.Settings>
|
||||||
|
</userSettings>
|
||||||
|
</configuration>
|
11
AsPerfMon/AsPerfMon/bin/Debug/ASPerfMon.vshost.exe.manifest
Normal file
11
AsPerfMon/AsPerfMon/bin/Debug/ASPerfMon.vshost.exe.manifest
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||||
|
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
|
||||||
|
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||||
|
<security>
|
||||||
|
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
|
||||||
|
</requestedPrivileges>
|
||||||
|
</security>
|
||||||
|
</trustInfo>
|
||||||
|
</assembly>
|
@ -0,0 +1 @@
|
|||||||
|
C:\Users\ChWade\Source\Repos\Analysis-Services\AsPerfMon\ASPerfMon\bin\Debug\ASPerfMon.exe.config
|
Binary file not shown.
4
AsPerfMon/AsPerfMon/packages.config
Normal file
4
AsPerfMon/AsPerfMon/packages.config
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="Microsoft.AnalysisServices.AdomdClient" version="12.0.2000.8" targetFramework="net452" />
|
||||||
|
</packages>
|
21
AsPerfMon/LICENSE
Normal file
21
AsPerfMon/LICENSE
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) Microsoft Corporation
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
4
AsPerfMon/README.md
Normal file
4
AsPerfMon/README.md
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Monitor Analysis Services memory usage broken out by database and other high-level allocations in a stacked bar that increments at set interval. Useful during processing especially with multiple databases on same server.
|
||||||
|
|
||||||
|
![alt text](AsPerfMon.png "Stacked bar by memory allocation")
|
||||||
|
|
Binary file not shown.
@ -1,10 +0,0 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
# Visual Studio 14
|
|
||||||
VisualStudioVersion = 14.0.25420.1
|
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
Loading…
Reference in New Issue
Block a user