Which of the following actions should you take FIRST?

You work as a developer at ABC.com. The ABC.com network consists of a single domain named
ABC.com.
You have been tasked with creating an application that processes numerous objects in a single
second. You want to include a performance counter to examine these processes.
Which of the following actions should you take FIRST?

You work as a developer at ABC.com. The ABC.com network consists of a single domain named
ABC.com.
You have been tasked with creating an application that processes numerous objects in a single
second. You want to include a performance counter to examine these processes.
Which of the following actions should you take FIRST?

A.
You should consider writing code that passes the collection to the Create() method of the
PerformanceCounterCategory.

B.
You should consider writing code that creates a CounterCreationDataCollection.

C.
You should consider writing code thatevokes the Create() method of the
PerformanceCounterCategory class.

D.
You should consider writing code that creates counters as CounterCreationData objects.

Explanation:



Leave a Reply 5

Your email address will not be published. Required fields are marked *


bob

bob

Answer is B or D or C. I prefer B as one of the PerformanceCounterCategory.Create overloads needs the CounterCreationDataCollection as the last parameter it is logical to create the CounterCreationDataCollection first. But in this example by Microsoft, they do D by creating the CounterCreationData objects before the CounterCreationDataCollection then the PerfromanceCounterCategory.Create!
Or am I missing something in the question?

j

j

B

CounterCreationDataCollection counters = new CounterCreationDataCollection();

CounterCreationData totalOrders = new CounterCreationData();
totalOrders.CounterName = “# Orders”;
totalOrders.CounterHelp = “Total number of orders placed”;
totalOrders.CounterType = PerformanceCounterType.NumberOfItems32;
counters.Add(totalOrders);

CounterCreationData ordersPerSecond = new CounterCreationData();
ordersPerSecond.CounterName = “# Orders/Sec”;
ordersPerSecond.CounterHelp = “Number of orders placed per second”;
ordersPerSecond.CounterType = PerformanceCounterType.RateOfCountsPerSecond32;
counters.Add(ordersPerSecond);

PerformanceCounterCategory.Create(“FourthCoffeeOrders”, “A custom category for demonstration”, PerformanceCounterCategoryType.SingleInstance, counters);

Herman McConnell

Herman McConnell

B !!!