Exemplo n.º 1
0
        public void InitPerfCounters_AppFabric(string scenario, string server)
        {
            string counterCategory = "BizTalk Benchmark Wizard";

            try
            {
                PerfCounter perfCounter = new PerfCounter();
                _performanceCounterLogger = new PerformanceCounterLogger(PerformanceCounterLogger.ServiceType.Both);

                perfCounter.ReceivedCounters.Add(_performanceCounterLogger.CallPerSecondTransmitCounter);
                perfCounter.CPUCounters1.Add(new PerformanceCounter("Processor", "% Processor Time", "_Total"));
                perfCounter.HasReceiveCounter = true;
                PerfCounters.Add(perfCounter);

                perfCounter.ProcessedCounters.Add(_performanceCounterLogger.CallPerSecondProcessedCounter);
                perfCounter.CPUCounters1.Add(new PerformanceCounter("Processor", "% Processor Time", "_Total", server));
                perfCounter.HasProcessingCounter = true;
                PerfCounters.Add(perfCounter);

                MainWindow.DoEvents();

                RaiseInitiateStepEvent("InitPerfCounters");
            }
            catch (Exception ex)
            {
                //InstallUtil /i /assemblyname "Microsoft.BizTalk.MsgBoxPerfCounters, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                throw new ApplicationException(@"Unable to find PerfMon Counter. Make sure all BBW* host instances are started. If you lost the counters, this post might help you recover counters: ""http://blogs.msdn.com/biztalkperformance/archive/2007/09/30/how-to-manually-recreate-missing-biztalk-performance-counters.aspx""");
            }
        }
Exemplo n.º 2
0
        public void InitPerfCounters_BizTalk(string scenario, List <HostMaping> hostmappings, Server msgBoxServer)
        {
            try
            {
                foreach (HostMaping hostMapping in hostmappings)
                {
                    PerfCounter perfCounter = new PerfCounter();
                    perfCounter.Server = hostMapping.SelectedHost;

                    switch (hostMapping.HostName)
                    {
                    case "BBW_RxHost":

                        UpdateServiceAddress(hostMapping.SelectedHost, scenario);

                        perfCounter.ReceivedCounters.Add(new PerformanceCounter("BizTalk:Messaging", "Documents received/Sec", "BBW_RxHost", hostMapping.SelectedHost));
                        perfCounter.CPUCounters1.Add(new PerformanceCounter("Processor", "% Processor Time", "_Total", hostMapping.SelectedHost));
                        perfCounter.HasReceiveCounter = true;
                        break;

                    case "BBW_PxHost":
                        break;

                    case "BBW_TxHost":
                        perfCounter.ProcessedCounters.Add(new PerformanceCounter("BizTalk:Messaging", "Documents processed/Sec", "BBW_TxHost", hostMapping.SelectedHost));
                        perfCounter.CPUCounters2.Add(new PerformanceCounter("Processor", "% Processor Time", "_Total", hostMapping.SelectedHost));
                        perfCounter.HasProcessingCounter = true;
                        break;
                    }
                    PerfCounters.Add(perfCounter);
                    MainWindow.DoEvents();
                }

                PerfCounter sqlPerfCounter = new PerfCounter();
                sqlPerfCounter.Server = msgBoxServer.Name;
                sqlPerfCounter.CPUCounters3.Add(new PerformanceCounter("Processor", "% Processor Time", "_Total", msgBoxServer.Name));
                PerfCounters.Add(sqlPerfCounter);

                string rcvHost = hostmappings.First(h => h.HostName == "BBW_RxHost").SelectedHost;

                RaiseInitiateStepEvent("InitPerfCounters");
                //_loadGenClients.Add(CreateAndStartLoadGenClient(CreateLoadGenScript(environment.LoadGenScriptFile, rcvHost), rcvHost));
            }
            catch (Exception)
            {
                //InstallUtil /i /assemblyname "Microsoft.BizTalk.MsgBoxPerfCounters, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                throw new ApplicationException(@"Unable to find PerfMon Counter. Make sure all BBW* host instances are started. If you lost the counters, this post might help you recover counters: ""http://blogs.msdn.com/biztalkperformance/archive/2007/09/30/how-to-manually-recreate-missing-biztalk-performance-counters.aspx""");
            }
        }