From 9fb759fb17bce7d6e19a213475c702457d00cc40 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 14 Feb 2009 11:55:37 -0800 Subject: [PATCH] mv tools/PerfBrowser http://github.com/dougm/csharp-perfbrowser --- tools/PerfBrowser/App.ico | Bin 1078 -> 0 bytes tools/PerfBrowser/AssemblyInfo.cs | 76 ----- tools/PerfBrowser/MainForm.cs | 307 --------------------- tools/PerfBrowser/MainForm.resx | 102 ------- tools/PerfBrowser/PerfBrowser.csproj | 112 -------- tools/PerfBrowser/PerfBrowser.csproj.user | 48 ---- tools/PerfBrowser/PerfBrowser.exe.manifest | 22 -- tools/PerfBrowser/PerfBrowser.sln | 21 -- tools/PerfBrowser/default.build | 20 -- 9 files changed, 708 deletions(-) delete mode 100644 tools/PerfBrowser/App.ico delete mode 100644 tools/PerfBrowser/AssemblyInfo.cs delete mode 100644 tools/PerfBrowser/MainForm.cs delete mode 100644 tools/PerfBrowser/MainForm.resx delete mode 100644 tools/PerfBrowser/PerfBrowser.csproj delete mode 100644 tools/PerfBrowser/PerfBrowser.csproj.user delete mode 100644 tools/PerfBrowser/PerfBrowser.exe.manifest delete mode 100644 tools/PerfBrowser/PerfBrowser.sln delete mode 100644 tools/PerfBrowser/default.build diff --git a/tools/PerfBrowser/App.ico b/tools/PerfBrowser/App.ico deleted file mode 100644 index 3a5525fd794f7a7c5c8e6187f470ea3af38cd2b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1078 zcmeHHJr05}7=1t!Hp3A*8IHkVf+j?-!eHY14Gtcw1Eb*_9>Bq^zETJ@GKj{_2j4$w zo9}xCh!8{T3=X##Skq>ikMjsvB|y%crWBM2iW(4pI}c%z6%lW!=~4v77#3{z!dmB1 z__&l)-{KUYR+|8|;wB^R|9ET$J@(@=#rd^=)qs85?vAy(PSF5CyNkus435LVkZ$rj zNw|JG-P7^hF<(;#o*Vk}5R#e|^13tBbQkeF?djULtvqyxd3<{9 diff --git a/tools/PerfBrowser/AssemblyInfo.cs b/tools/PerfBrowser/AssemblyInfo.cs deleted file mode 100644 index 355c6b1d..00000000 --- a/tools/PerfBrowser/AssemblyInfo.cs +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. - * This file is part of SIGAR. - * - * SIGAR is free software; you can redistribute it and/or modify - * it under the terms version 2 of the GNU General Public License as - * published by the Free Software Foundation. This program is distributed - * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - */ - -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// 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("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// 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 Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.0.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("")] -[assembly: AssemblyKeyName("")] diff --git a/tools/PerfBrowser/MainForm.cs b/tools/PerfBrowser/MainForm.cs deleted file mode 100644 index d89112a2..00000000 --- a/tools/PerfBrowser/MainForm.cs +++ /dev/null @@ -1,307 +0,0 @@ -/* - * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. - * This file is part of SIGAR. - * - * SIGAR is free software; you can redistribute it and/or modify - * it under the terms version 2 of the GNU General Public License as - * published by the Free Software Foundation. This program is distributed - * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - */ - -using System; -using System.Diagnostics; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -using System.Data; - -namespace PerfBrowser -{ - /// - /// Summary description for Form1. - /// - public class MainForm : System.Windows.Forms.Form - { - private System.Windows.Forms.ColumnHeader col1; - private System.Windows.Forms.ColumnHeader col2; - private System.Windows.Forms.ComboBox comboBox; - private System.Windows.Forms.ListView lvCounters; - private System.Windows.Forms.TreeView tvCategories; - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.Splitter splitter2; - private System.Windows.Forms.Panel panel2; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - - public MainForm() - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if (components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.lvCounters = new System.Windows.Forms.ListView(); - this.col1 = new System.Windows.Forms.ColumnHeader(); - this.col2 = new System.Windows.Forms.ColumnHeader(); - this.comboBox = new System.Windows.Forms.ComboBox(); - this.tvCategories = new System.Windows.Forms.TreeView(); - this.panel1 = new System.Windows.Forms.Panel(); - this.splitter2 = new System.Windows.Forms.Splitter(); - this.panel2 = new System.Windows.Forms.Panel(); - this.panel1.SuspendLayout(); - this.panel2.SuspendLayout(); - this.SuspendLayout(); - // - // lvCounters - // - this.lvCounters.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right); - this.lvCounters.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.col1, - this.col2}); - this.lvCounters.Cursor = System.Windows.Forms.Cursors.Default; - this.lvCounters.Location = new System.Drawing.Point(0, 36); - this.lvCounters.MultiSelect = false; - this.lvCounters.Name = "lvCounters"; - this.lvCounters.Size = new System.Drawing.Size(468, 324); - this.lvCounters.Sorting = System.Windows.Forms.SortOrder.Ascending; - this.lvCounters.TabIndex = 2; - this.lvCounters.View = System.Windows.Forms.View.Details; - // - // col1 - // - this.col1.Text = "Name"; - this.col1.Width = 314; - // - // col2 - // - this.col2.Text = "Value"; - this.col2.Width = 150; - // - // comboBox - // - this.comboBox.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right); - this.comboBox.Location = new System.Drawing.Point(8, 8); - this.comboBox.Name = "comboBox"; - this.comboBox.Size = new System.Drawing.Size(688, 21); - this.comboBox.TabIndex = 2; - this.comboBox.Text = "."; - this.comboBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.comboBox_KeyDown); - // - // tvCategories - // - this.tvCategories.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right); - this.tvCategories.ImageIndex = -1; - this.tvCategories.Location = new System.Drawing.Point(8, 36); - this.tvCategories.Name = "tvCategories"; - this.tvCategories.SelectedImageIndex = -1; - this.tvCategories.Size = new System.Drawing.Size(212, 324); - this.tvCategories.Sorted = true; - this.tvCategories.TabIndex = 3; - this.tvCategories.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvCategories_AfterSelect); - // - // panel1 - // - this.panel1.Controls.AddRange(new System.Windows.Forms.Control[] { - this.tvCategories}); - this.panel1.Dock = System.Windows.Forms.DockStyle.Left; - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(220, 369); - this.panel1.TabIndex = 0; - // - // splitter2 - // - this.splitter2.Location = new System.Drawing.Point(220, 0); - this.splitter2.Name = "splitter2"; - this.splitter2.Size = new System.Drawing.Size(8, 369); - this.splitter2.TabIndex = 1; - this.splitter2.TabStop = false; - // - // panel2 - // - this.panel2.Controls.AddRange(new System.Windows.Forms.Control[] { - this.lvCounters}); - this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel2.Location = new System.Drawing.Point(228, 0); - this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(476, 369); - this.panel2.TabIndex = 3; - // - // MainForm - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(704, 369); - this.Controls.AddRange(new System.Windows.Forms.Control[] { - this.comboBox, - this.panel2, - this.splitter2, - this.panel1}); - this.Name = "MainForm"; - this.Text = "Performance Browser"; - this.Load += new System.EventHandler(this.MainForm_Load); - this.panel1.ResumeLayout(false); - this.panel2.ResumeLayout(false); - this.ResumeLayout(false); - - } - #endregion - - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.Run(new MainForm()); - } - - private void RefreshContent() - { - // Clear everthing currently displayed in the app - this.tvCategories.Nodes.Clear(); - this.lvCounters.Items.Clear(); - this.Refresh(); - - // Suspend drawing until we're done - this.tvCategories.BeginUpdate(); - - try - { - PerformanceCounterCategory[] aPerfCat = PerformanceCounterCategory.GetCategories(this.comboBox.Text); - - foreach(PerformanceCounterCategory perfcat in aPerfCat) - { - TreeNode nodeCat = new TreeNode(perfcat.CategoryName); - this.tvCategories.Nodes.Add(nodeCat); - - try - { - String[] astrInstNames = perfcat.GetInstanceNames(); - - foreach(String strInstName in astrInstNames) - nodeCat.Nodes.Add(new TreeNode(strInstName)); - } - catch(Exception ex) - { - Console.WriteLine(ex); - } - } - - //this.tvCategories.SelectedNode.Index = 0; - } - catch(Exception) - { - this.lvCounters.Items.Add("Machine not found."); - } - - // Resume drawing - this.tvCategories.EndUpdate(); - } - - private void MainForm_Load(object sender, System.EventArgs e) - { - this.comboBox.Text = SystemInformation.ComputerName; - this.RefreshContent(); - } - - private void comboBox_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) - { - if(e.KeyCode == Keys.Enter) - this.RefreshContent(); - } - - private void tvCategories_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e) - { - // Clear the listview to prep it for new data - this.lvCounters.Items.Clear(); - - // If a category was selected, that has multiple instances skip everything - if(e.Node.Parent == null && e.Node.GetNodeCount(false) > 0) - return; - - // If there are no instances just get the category name, otherwise get category and instance name - String strCategory; - String strInstance = null; - - if(e.Node.Parent == null) - { - strCategory = e.Node.Text; - } - else - { - strCategory = e.Node.Parent.Text; - strInstance = e.Node.Text; - } - - // Suspend drawing until we're done - this.lvCounters.BeginUpdate(); - - // Get the selected category - PerformanceCounterCategory perfcat = new PerformanceCounterCategory(strCategory, this.comboBox.Text); - - try - { - InstanceDataCollectionCollection datacollcoll = perfcat.ReadCategory(); - - foreach(InstanceDataCollection datacoll in datacollcoll.Values) - { - foreach(InstanceData data in datacoll.Values) - { - if(strInstance == null || data.InstanceName == strInstance) - { - ListViewItem item = new ListViewItem(datacoll.CounterName); - item.SubItems.Add(data.RawValue.ToString()); - this.lvCounters.Items.Add(item); - break; - } - } - } - } - catch(Exception ex) - { - Console.WriteLine(ex); - } - - // Result drawing - this.lvCounters.EndUpdate(); - } - } -} diff --git a/tools/PerfBrowser/MainForm.resx b/tools/PerfBrowser/MainForm.resx deleted file mode 100644 index d4899948..00000000 --- a/tools/PerfBrowser/MainForm.resx +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - MainForm - - \ No newline at end of file diff --git a/tools/PerfBrowser/PerfBrowser.csproj b/tools/PerfBrowser/PerfBrowser.csproj deleted file mode 100644 index 60535259..00000000 --- a/tools/PerfBrowser/PerfBrowser.csproj +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/PerfBrowser/PerfBrowser.csproj.user b/tools/PerfBrowser/PerfBrowser.csproj.user deleted file mode 100644 index c8340eaa..00000000 --- a/tools/PerfBrowser/PerfBrowser.csproj.user +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - diff --git a/tools/PerfBrowser/PerfBrowser.exe.manifest b/tools/PerfBrowser/PerfBrowser.exe.manifest deleted file mode 100644 index fe84ad9e..00000000 --- a/tools/PerfBrowser/PerfBrowser.exe.manifest +++ /dev/null @@ -1,22 +0,0 @@ - - - -PerfBrowser - - - - - - diff --git a/tools/PerfBrowser/PerfBrowser.sln b/tools/PerfBrowser/PerfBrowser.sln deleted file mode 100644 index 5acd8dd3..00000000 --- a/tools/PerfBrowser/PerfBrowser.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 7.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PerfBrowser", "PerfBrowser.csproj", "{00B4B56E-53CA-4E24-A937-4503D19E993C}" -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - ConfigName.0 = Debug - ConfigName.1 = Release - EndGlobalSection - GlobalSection(ProjectDependencies) = postSolution - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {00B4B56E-53CA-4E24-A937-4503D19E993C}.Debug.ActiveCfg = Debug|.NET - {00B4B56E-53CA-4E24-A937-4503D19E993C}.Debug.Build.0 = Debug|.NET - {00B4B56E-53CA-4E24-A937-4503D19E993C}.Release.ActiveCfg = Release|.NET - {00B4B56E-53CA-4E24-A937-4503D19E993C}.Release.Build.0 = Release|.NET - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/tools/PerfBrowser/default.build b/tools/PerfBrowser/default.build deleted file mode 100644 index f39075dd..00000000 --- a/tools/PerfBrowser/default.build +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - -