private void LoadTestStarting(object sender, EventArgs e) { // Delete the category if already exists if (PerformanceCounterCategory.Exists("AMSStressCounterSet")) { PerformanceCounterCategory.Delete("AMSStressCounterSet"); } CounterCreationDataCollection counters = new CounterCreationDataCollection(); // 1. counter for counting totals: PerformanceCounterType.NumberOfItems32 CounterCreationData totalOps = new CounterCreationData(); totalOps.CounterName = "# operations executed"; totalOps.CounterHelp = "Total number of operations executed"; totalOps.CounterType = PerformanceCounterType.NumberOfItems32; counters.Add(totalOps); // 2. counter for counting operations per second: // PerformanceCounterType.RateOfCountsPerSecond32 CounterCreationData opsPerSecond = new CounterCreationData(); opsPerSecond.CounterName = "# operations / sec"; opsPerSecond.CounterHelp = "Number of operations executed per second"; opsPerSecond.CounterType = PerformanceCounterType.RateOfCountsPerSecond32; counters.Add(opsPerSecond); // create new category with the counters above PerformanceCounterCategory.Create("AMSStressCounterSet", "KeyDelivery Stress Counters", PerformanceCounterCategoryType.SingleInstance, counters); }
/// <summary> /// Gets the or create counter category. /// </summary> /// <param name="categoryInfo">The category information.</param> /// <param name="counters">The counters.</param> /// <returns>PerformanceCounterCategory.</returns> private static PerformanceCounterCategory GetOrCreateCounterCategory( PerformanceCounterCategoryInfo categoryInfo, CounterCreationData[] counters) { var creationPending = true; var categoryExists = false; var categoryName = categoryInfo.CategoryName; var counterNames = new HashSet<string>(counters.Select(info => info.CounterName)); PerformanceCounterCategory category = null; if (PerformanceCounterCategory.Exists(categoryName)) { categoryExists = true; category = new PerformanceCounterCategory(categoryName); var counterList = category.GetCounters(); if (category.CategoryType == categoryInfo.CategoryType && counterList.Length == counterNames.Count) { creationPending = counterList.Any(x => !counterNames.Contains(x.CounterName)); } } if (!creationPending) return category; if (categoryExists) PerformanceCounterCategory.Delete(categoryName); var counterCollection = new CounterCreationDataCollection(counters); category = PerformanceCounterCategory.Create( categoryInfo.CategoryName, categoryInfo.CategoryHelp, categoryInfo.CategoryType, counterCollection); return category; }
internal static void CreatePerformanceCounters() { // Create a collection of type CounterCreationDataCollection. CounterCreationDataCollection CounterDatas = new CounterCreationDataCollection(); // Create the counters and set their properties. System.Diagnostics.CounterCreationData totalReceivedByteCounter = new System.Diagnostics.CounterCreationData(); totalReceivedByteCounter.CounterName = "Bytes Received Total"; totalReceivedByteCounter.CounterHelp = "The total number of bytes received from service clients since the last execution"; totalReceivedByteCounter.CounterType = PerformanceCounterType.NumberOfItems64; System.Diagnostics.CounterCreationData perSecReceivedByteCounter = new System.Diagnostics.CounterCreationData(); perSecReceivedByteCounter.CounterName = "Bytes Received Per Second"; perSecReceivedByteCounter.CounterHelp = "Number of bytes received per second"; perSecReceivedByteCounter.CounterType = PerformanceCounterType.RateOfCountsPerSecond32; // Add both counters to the collection. CounterDatas.Add(totalReceivedByteCounter); CounterDatas.Add(perSecReceivedByteCounter); // Create the category and pass the collection to it. System.Diagnostics.PerformanceCounterCategory.Create ( "SharpOpen Tcp Soft Router", "Performance Diagnostics for SharpOpen Tcp Soft Router Service", PerformanceCounterCategoryType.SingleInstance, CounterDatas ); P1 = new PerformanceCounter("SharpOpen Tcp Soft Router", "Bytes Received Total", false); P2 = new PerformanceCounter("SharpOpen Tcp Soft Router", "Bytes Received Per Second", false); }
private bool SetupCategory() { // PerformanceCounterCategory.Delete("DCC2012"); if (!PerformanceCounterCategory.Exists(this.categoryName)) { CounterCreationDataCollection counterDataCollection = new CounterCreationDataCollection(); // Add the counter. CounterCreationData averageCount64 = new CounterCreationData(); averageCount64.CounterType = PerformanceCounterType.NumberOfItems32; averageCount64.CounterName = "GetData Call Count"; counterDataCollection.Add(averageCount64); CounterCreationData averageCount641 = new CounterCreationData(); averageCount641.CounterType = PerformanceCounterType.CounterTimer; averageCount641.CounterName = "GetData Execution Time"; counterDataCollection.Add(averageCount641); // Create the category. PerformanceCounterCategory.Create("DCC2012", "Desert Code Camp.", PerformanceCounterCategoryType.SingleInstance, counterDataCollection); return (true); } else { Console.WriteLine("Category exists - AverageCounter64SampleCategory"); return (false); } }
/// <summary> /// Starts the install /// </summary> public static void InstallCounters() { Logger.Debug("Starting installation of PerformanceCounters "); var categoryName = "NServiceBus"; var counterName = "Critical Time"; if (PerformanceCounterCategory.Exists(categoryName)) { Logger.Warn("Category " + categoryName + " already exist, going to delete first"); PerformanceCounterCategory.Delete(categoryName); } var data = new CounterCreationDataCollection(); var c1 = new CounterCreationData(counterName, "Age of the oldest message in the queue", PerformanceCounterType.NumberOfItems32); data.Add(c1); PerformanceCounterCategory.Create(categoryName, "NServiceBus statistics", PerformanceCounterCategoryType.MultiInstance, data); Logger.Debug("Installation of PerformanceCounters successful."); }
public static void CreateCounter() { CounterCreationDataCollection col = new CounterCreationDataCollection(); // Create two custom counter objects. CounterCreationData addCounter = new CounterCreationData(); addCounter.CounterName = "AddCounter"; addCounter.CounterHelp = "Custom Add counter "; addCounter.CounterType = PerformanceCounterType.NumberOfItemsHEX32; // Add custom counter objects to CounterCreationDataCollection. col.Add(addCounter); // Bind the counters to a PerformanceCounterCategory // Check if the category already exists or not. if (!PerformanceCounterCategory.Exists("MyCategory")) { PerformanceCounterCategory category = PerformanceCounterCategory.Create("MyCategory", "My Perf Category Description ", PerformanceCounterCategoryType.Unknown, col); } else { Console.WriteLine("Counter already exists"); } }
static void Main(string[] args) { if (PerformanceCounterCategory.Exists("DontStayIn")) PerformanceCounterCategory.Delete("DontStayIn"); // Create the collection container CounterCreationDataCollection counters = new CounterCreationDataCollection(); // Create counter #1 and add it to the collection CounterCreationData dsiPages = new CounterCreationData(); dsiPages.CounterName = "DsiPages per sec"; dsiPages.CounterHelp = "Total number of dsi pages per second."; dsiPages.CounterType = PerformanceCounterType.RateOfCountsPerSecond32; counters.Add(dsiPages); // Create counter #3 and add it to the collection CounterCreationData genTime = new CounterCreationData(); genTime.CounterName = "DsiPage generation time"; genTime.CounterHelp = "Average time to generate a page."; genTime.CounterType = PerformanceCounterType.AverageTimer32; counters.Add(genTime); CounterCreationData genTimeBase = new CounterCreationData(); genTimeBase.CounterName = "DsiPage generation time base"; genTimeBase.CounterHelp = "Average time to generate a page base."; genTimeBase.CounterType = PerformanceCounterType.AverageBase; counters.Add(genTimeBase); // Create the category and all of the counters. PerformanceCounterCategory.Create("DontStayIn", "Performance counters for DontStayIn.", PerformanceCounterCategoryType.SingleInstance, counters); Console.WriteLine("Done!"); Console.ReadLine(); }
private static void InitializeCounters() { try { var counterDatas = new CounterCreationDataCollection(); // Create the counters and set their properties. var cdCounter1 = new CounterCreationData(); var cdCounter2 = new CounterCreationData(); cdCounter1.CounterName = "Total Requests Handled"; cdCounter1.CounterHelp = "Total number of requests handled"; cdCounter1.CounterType = PerformanceCounterType.NumberOfItems64; cdCounter2.CounterName = "Requests Per Secpmd"; cdCounter2.CounterHelp = "Average number of requests per second."; cdCounter2.CounterType = PerformanceCounterType.RateOfCountsPerSecond64; // Add both counters to the collection. counterDatas.Add(cdCounter1); counterDatas.Add(cdCounter2); // Create the category and pass the collection to it. PerformanceCounterCategory.Create( "Socket Service Data Stats", "Stats for the socket service.", PerformanceCounterCategoryType.MultiInstance, counterDatas); } catch (Exception ex) { Logger.Error(ex.ToString()); } }
private void InstallPerformanceCounters() { if (!PerformanceCounterCategory.Exists("nHydrate")) { var counters = new CounterCreationDataCollection(); // 1. counter for counting totals: PerformanceCounterType.NumberOfItems32 var totalAppointments = new CounterCreationData(); totalAppointments.CounterName = "# appointments processed"; totalAppointments.CounterHelp = "Total number of appointments processed."; totalAppointments.CounterType = PerformanceCounterType.NumberOfItems32; counters.Add(totalAppointments); // 2. counter for counting operations per second: // PerformanceCounterType.RateOfCountsPerSecond32 var appointmentsPerSecond = new CounterCreationData(); appointmentsPerSecond.CounterName = "# appointments / sec"; appointmentsPerSecond.CounterHelp = "Number of operations executed per second"; appointmentsPerSecond.CounterType = PerformanceCounterType.RateOfCountsPerSecond32; counters.Add(appointmentsPerSecond); // create new category with the counters above PerformanceCounterCategory.Create("nHydrate", "nHydrate Category", counters); } }
private static void CreateCounters(string groupName) { if (PerformanceCounterCategory.Exists(groupName)) { PerformanceCounterCategory.Delete(groupName); } var counters = new CounterCreationDataCollection(); var totalOps = new CounterCreationData { CounterName = "Messages Read", CounterHelp = "Total number of messages read", CounterType = PerformanceCounterType.NumberOfItems32 }; counters.Add(totalOps); var opsPerSecond = new CounterCreationData { CounterName = "Messages Read / Sec", CounterHelp = "Messages read per second", CounterType = PerformanceCounterType.RateOfCountsPerSecond32 }; counters.Add(opsPerSecond); PerformanceCounterCategory.Create(groupName, "PVC", PerformanceCounterCategoryType.SingleInstance, counters); }
/// <summary> /// install thge perfmon counters /// </summary> public static void InstallCounters() { if (!PerformanceCounterCategory.Exists(BabaluCounterDescriptions.CounterCategory)) { //Create the collection that will hold // the data for the counters we are // creating. CounterCreationDataCollection counterData = new CounterCreationDataCollection(); //Create the CreationData object. foreach (string counter in BabaluCounterDescriptions.BabaluCounters) { CounterCreationData BabaluCounter = new CounterCreationData(); // Set the counter's type to NumberOfItems32 BabaluCounter.CounterType = PerformanceCounterType.NumberOfItems32; //Set the counter's name BabaluCounter.CounterName = counter; //Add the CreationData object to our //collection counterData.Add(BabaluCounter); } //Create the counter in the system using the collection. PerformanceCounterCategory.Create(BabaluCounterDescriptions.CounterCategory, BabaluCounterDescriptions.CategoryDescription, PerformanceCounterCategoryType.SingleInstance, counterData); } }
private static void SetupCategory() { if (PerformanceCounterCategory.Exists(CategoryName)) { PerformanceCounterCategory.Delete(CategoryName); } if (!PerformanceCounterCategory.Exists(CategoryName)) { CounterCreationDataCollection creationDataCollection = new CounterCreationDataCollection(); CounterCreationData ctrCreationData = new CounterCreationData(); ctrCreationData.CounterType = PerformanceCounterType.RateOfCountsPerSecond32; ctrCreationData.CounterName = SpeedCounterName; creationDataCollection.Add(ctrCreationData); CounterCreationData ctrCreationData2 = new CounterCreationData(); ctrCreationData2.CounterType = PerformanceCounterType.RateOfCountsPerSecond64; ctrCreationData2.CounterName = SpeedBytesCounterName; creationDataCollection.Add(ctrCreationData2); PerformanceCounterCategory.Create(CategoryName, "Sample TransVault category", PerformanceCounterCategoryType.MultiInstance, creationDataCollection); } }
private void InitializeClicked(object sender, RoutedEventArgs e) { if (PerformanceCounterCategory.Exists(CategoryName)) { PerformanceCounterCategory.Delete(CategoryName); } if (!PerformanceCounterCategory.Exists(CategoryName)) { CounterCreationDataCollection creationDataCollection = new CounterCreationDataCollection(); CounterCreationData ctrCreationData = new CounterCreationData(); ctrCreationData.CounterType = PerformanceCounterType.RateOfCountsPerSecond32; ctrCreationData.CounterName = SpeedCounterName; creationDataCollection.Add(ctrCreationData); CounterCreationData ctrCreationData2 = new CounterCreationData(); ctrCreationData2.CounterType = PerformanceCounterType.RateOfCountsPerSecond64; ctrCreationData2.CounterName = SpeedBytesCounterName; creationDataCollection.Add(ctrCreationData2); PerformanceCounterCategory.Create(CategoryName, "Sample Custom category", PerformanceCounterCategoryType.MultiInstance, creationDataCollection); } currentContainer = new CountersContainer() { BytesPerSecCounter = SetupCounter(CategoryName, SpeedCounterName, "Task " + currentTask), ItemsPerSecCounter = SetupCounter(CategoryName, SpeedBytesCounterName, "Task " + currentTask) }; }
public void AddRange (CounterCreationData[] value) { foreach (CounterCreationData v in value) { Add (v); } }
public void CreatePerformanceCategory() { const string category = "MikePerfSpike"; if (!PerformanceCounterCategory.Exists(category)) { var counters = new CounterCreationDataCollection(); // 1. counter for counting values var totalOps = new CounterCreationData { CounterName = "# of operations executed", CounterHelp = "Total number of operations that have been executed", CounterType = PerformanceCounterType.NumberOfItems32 }; counters.Add(totalOps); // 2. counter for counting operations per second var opsPerSecond = new CounterCreationData { CounterName = "# of operations/second", CounterHelp = "Number of operations per second", CounterType = PerformanceCounterType.RateOfCountsPerSecond32 }; counters.Add(opsPerSecond); PerformanceCounterCategory.Create( category, "An experiment", PerformanceCounterCategoryType.MultiInstance, counters); } }
public CustomInstaller() { string loadPerf = Environment.GetFolderPath(Environment.SpecialFolder.System) + @"\loadperf.dll"; if (File.Exists(loadPerf)) { // add in a perf mon installer PerformanceCounterInstaller p = new PerformanceCounterInstaller(); p.CategoryName = Resources.PerfMonCategoryName; p.CategoryHelp = Resources.PerfMonCategoryHelp; p.CategoryType = PerformanceCounterCategoryType.SingleInstance; CounterCreationData ccd1 = new CounterCreationData( Resources.PerfMonHardProcName, Resources.PerfMonHardProcHelp, PerformanceCounterType.NumberOfItems32); CounterCreationData ccd2 = new CounterCreationData( Resources.PerfMonSoftProcName, Resources.PerfMonSoftProcHelp, PerformanceCounterType.RateOfCountsPerSecond32); p.Counters.Add(ccd1); p.Counters.Add(ccd2); perfMonIndex = Installers.Add(p); } }
void CreateCategories() { try { if (System.Diagnostics.PerformanceCounterCategory.Exists(counterCategory)) { return; } // Create a collection of type CounterCreationDataCollection. System.Diagnostics.CounterCreationDataCollection CounterDatas = new System.Diagnostics.CounterCreationDataCollection(); // Create the counters and set their properties. System.Diagnostics.CounterCreationData cdCounter1 = new System.Diagnostics.CounterCreationData() { CounterName = "In Call", CounterHelp = "Number of simultaneous messages submitted from the BizTalk Benchmark Wizard application", CounterType = System.Diagnostics.PerformanceCounterType.NumberOfItems64 }; System.Diagnostics.CounterCreationData cdCounter2 = new System.Diagnostics.CounterCreationData() { CounterName = "Call Time", CounterHelp = "Elasped time for call (msecs)", CounterType = System.Diagnostics.PerformanceCounterType.NumberOfItems64 }; System.Diagnostics.CounterCreationData cdCounter3 = new System.Diagnostics.CounterCreationData() { CounterName = "Total Calls", CounterHelp = "Total number of messages submitted from the BizTalk Benchmark Wizard application", CounterType = System.Diagnostics.PerformanceCounterType.NumberOfItems64 }; System.Diagnostics.CounterCreationData cdCounter4 = new System.Diagnostics.CounterCreationData() { CounterName = "Calls/sec", CounterHelp = "Number of messages submitted from the BizTalk Benchmark Wizard application", CounterType = System.Diagnostics.PerformanceCounterType.RateOfCountsPerSecond32 }; // Add both counters to the collection. CounterDatas.Add(cdCounter1); CounterDatas.Add(cdCounter2); CounterDatas.Add(cdCounter3); CounterDatas.Add(cdCounter4); // Create the category and pass the collection to it. //if (System.Diagnostics.PerformanceCounterCategory.Exists(counterCategory)) // System.Diagnostics.PerformanceCounterCategory.Delete(counterCategory); PerformanceCounterCategory cat = System.Diagnostics.PerformanceCounterCategory.Create( counterCategory, counterCategory, PerformanceCounterCategoryType.MultiInstance, CounterDatas); } catch (Exception ex) { throw ex; } }
private static CounterCreationData CreateCountingCounterCreationData(string counterName, string counterHelp) { CounterCreationData totalOps = new CounterCreationData(); totalOps.CounterName = counterName; totalOps.CounterHelp = counterHelp; totalOps.CounterType = PerformanceCounterType.NumberOfItems32; return totalOps; }
void CreateCategory(CounterCreationData[] counters) { PerformanceCounterCategory.Create( _categoryName, _categoryHelp, PerformanceCounterCategoryType.MultiInstance, new CounterCreationDataCollection(counters)); }
/// <devdoc> /// <para>[To be supplied.]</para> /// </devdoc> public void AddRange(CounterCreationData[] value) { if (value == null) { throw new ArgumentNullException("value"); } for (int i = 0; ((i) < (value.Length)); i = ((i) + (1))) { this.Add(value[i]); } }
public void AddCounterToCollection(CounterCreationDataCollection counterData) { var counterCreationData = new CounterCreationData( _name, _help, _counterType); counterData.Add(counterCreationData); }
public void AddCounterToCollection(CounterCreationDataCollection counterData) { CounterCreationData counterCreationData = new CounterCreationData( _counterName, _counterHelp, _pcType); counterData.Add(counterCreationData); }
/// <summary> /// Initializes a new instance of the <see cref="PerformanceCounterManager" /> class. /// </summary> /// <param name="categoryInfo">The category information.</param> /// <param name="counterDefinitions">The counter definitions.</param> protected PerformanceCounterManager(PerformanceCounterCategoryInfo categoryInfo, CounterCreationData[] counterDefinitions) { var category = GetOrCreateCounterCategory(categoryInfo, counterDefinitions); foreach (var counter in category.GetCounters()) { counter.ReadOnly = false; _counterMap.Add(counter.CounterName, new SafePerformanceCounter(counter)); } }
private static CounterCreationData[] CreationDataFor(PerformanceCounterSpec[] performanceCounterSpecs) { var creationData = new CounterCreationData[performanceCounterSpecs.Length]; for (var i = 0; i < performanceCounterSpecs.Length; i++) { creationData[i] = performanceCounterSpecs[i].CounterCreationData(); } return creationData; }
public void CanLogPerformanceData() { var counterCollector = default(PerformanceCounterCollector); var logger = default(TestLogger); var totalOperations = default(PerformanceCounter); "Given I am collecting performance counter data" .Context(() => { if(PerformanceCounterCategory.Exists("TestCategory")) PerformanceCounterCategory.Delete("TestCategory"); var counters = new CounterCreationDataCollection(); var totalOps = new CounterCreationData(); totalOps.CounterName = "# operations executed"; totalOps.CounterHelp = "Total number of operations executed"; totalOps.CounterType = PerformanceCounterType.NumberOfItems32; counters.Add(totalOps); PerformanceCounterCategory.Create("TestCategory", "Test category", PerformanceCounterCategoryType.SingleInstance, counters); totalOperations = new PerformanceCounter(); totalOperations.CategoryName = "TestCategory"; totalOperations.CounterName = "# operations executed"; totalOperations.MachineName = "."; totalOperations.ReadOnly = false; logger = new TestLogger(); var counter = new PerformanceCounterElement(); counter.Name = "# operations executed"; var category = new PerformanceCounterCategoryElement(); category.Name = "TestCategory"; category.PerformanceCounters.Add(counter); var collectorConfiguration = new CounterConfiguration(); collectorConfiguration.Categories.Add(category); collectorConfiguration.CollectionFrequency = "1"; counterCollector = new PerformanceCounterCollector(collectorConfiguration); }); "When I begin collecting".Do(() => { counterCollector.Collect(logger); totalOperations.IncrementBy(20); System.Threading.Thread.Sleep(TimeSpan.FromSeconds(2)); counterCollector.Dispose(); PerformanceCounterCategory.Delete("TestCategory"); }); "Performance data will be collected".Observation(() => logger.LogItems[0].Data["Value"].ToString().Should().Be("20")); "The performance category will be collected".Observation(() => logger.LogItems[0].Data["CategoryName"].Should().Be("TestCategory")); "The performance counter name will be collected".Observation(() => logger.LogItems[0].Data["CounterName"].Should().Be("# operations executed")); }
public override void RegisterIn(CounterCreationDataCollection collection) { var numberOfItems = new CounterCreationData { CounterType = PerformanceCounterType.NumberOfItems64, CounterName = Name, }; collection.Add(numberOfItems); }
// Add a range of elements to this collection. public void AddRange(CounterCreationData[] value) { if(value == null) { throw new ArgumentNullException("value"); } foreach(CounterCreationData val in value) { Add(val); } }
public void AddRange(CounterCreationData[] value) { if (value == null) { throw new ArgumentNullException("value"); } for (int i = 0; i < value.Length; i++) { this.Add(value[i]); } }
protected override CounterCreationData[] DoGetCreationData() { var counterCreationDatas = new CounterCreationData[1]; counterCreationDatas[0] = new CounterCreationData() { CounterType = PerformanceCounterType.RateOfCountsPerSecond32, CounterName = Name, CounterHelp = "# of operations / sec" }; return counterCreationDatas; }
protected override CounterCreationData[] DoGetCreationData() { var counterCreationDatas = new CounterCreationData[1]; counterCreationDatas[0] = new CounterCreationData() { CounterType = PerformanceCounterType.NumberOfItems32, CounterName = Name, CounterHelp = "Time in ms to run last request" }; return counterCreationDatas; }
/// <summary/> /// <param name="eventSource"/> /// <param name="counterCategory"/> /// <param name="counterCategoryHelp"/> /// <param name="counterData"/> /// <exclude/> protected ProjectInstallerBase(string eventSource, string counterCategory, string counterCategoryHelp, CounterCreationData[] counterData) { this.counterCategory = counterCategory; this.counterCategoryHelp = counterCategoryHelp; this.counterData = counterData; EventLogInstaller eventlogInstaller = new EventLogInstaller(); eventlogInstaller.Log = "Application"; eventlogInstaller.Source = eventSource; Installers.Add(eventlogInstaller); }
protected override CounterCreationData[] DoGetCreationData() { var counterCreationDatas = new CounterCreationData[1]; counterCreationDatas[0] = new CounterCreationData() { CounterType = PerformanceCounterType.NumberOfItems32, CounterName = Name, CounterHelp = _filter.Description }; return counterCreationDatas; }
private static void createCounterIfNotExist(string categoryName, string counterName, string counterHelp, System.Diagnostics.PerformanceCounterType type, System.Diagnostics.CounterCreationDataCollection counterDatas) { if (!System.Diagnostics.PerformanceCounterCategory.Exists(categoryName) || !System.Diagnostics.PerformanceCounterCategory.CounterExists(counterName, categoryName)) { System.Diagnostics.CounterCreationData counter = new System.Diagnostics.CounterCreationData(); counter.CounterName = counterName; counter.CounterHelp = counterHelp; counter.CounterType = type; counterDatas.Add(counter); } }
public static void installPerformanceCounter() { CounterCreationDataCollection CounterDatas = new System.Diagnostics.CounterCreationDataCollection(); CounterCreationData cdCounter1 = new System.Diagnostics.CounterCreationData(); try { cdCounter1.CounterName = "Messages Per Second"; cdCounter1.CounterType = PerformanceCounterType.RateOfCountsPerSecond64; CounterDatas.Add(cdCounter1); if (!((PerformanceCounterCategory.Exists("netSmtpMail")))) { PerformanceCounterCategory.Create("netSmtpMail", "", CounterDatas); } } catch (Exception e) { throw (e); } }
/// <include file='doc\PerformanceCounterCategory.uex' path='docs/doc[@for="PerformanceCounterCategory.Create2"]/*' /> /// <devdoc> /// Registers one extensible performance category of type NumberOfItems32 with the system /// </devdoc> public static PerformanceCounterCategory Create(string categoryName, string categoryHelp, string counterName, string counterHelp) { CounterCreationData customData = new CounterCreationData(counterName, categoryHelp, PerformanceCounterType.NumberOfItems32); return(Create(categoryName, categoryHelp, new CounterCreationDataCollection(new CounterCreationData [] { customData }), ".", null)); }
public int Add(CounterCreationData value) { return(List.Add(value)); }
public bool Contains(CounterCreationData value) { return(List.Contains(value)); }
public int IndexOf(CounterCreationData value) { return(List.IndexOf(value)); }
public void Insert(int index, CounterCreationData value) { List.Insert(index, value); }
public virtual void Remove(CounterCreationData value) { List.Remove(value); }
public static PerformanceCounterCategory Create(string categoryName, string categoryHelp, PerformanceCounterCategoryType categoryType, string counterName, string counterHelp) { CounterCreationData data = new CounterCreationData(counterName, counterHelp, PerformanceCounterType.NumberOfItems32); return(Create(categoryName, categoryHelp, categoryType, new CounterCreationDataCollection(new CounterCreationData[] { data }))); }