Presentation is loading. Please wait.

Presentation is loading. Please wait.

Instrumentation And Performance Microsoft ® Corporation.

Similar presentations


Presentation on theme: "Instrumentation And Performance Microsoft ® Corporation."— Presentation transcript:

1

2 Instrumentation And Performance Microsoft ® Corporation

3

4

5

6 Performance CountersEvents Example Usages Expose processing rates Measure performance General notifications Errors and warnings Trace actions for debugging Data TypesStrictly NumericalNo restriction Data Consumption Polled in real-time Written to a log file Delivered in real-time Written to a log file Buffered in memory Applications can make use of both Performance Counters and Events

7

8

9

10

11 var counters = new CounterCreationDataCollection (); counters.Add(new CounterCreationData(...)); PerformanceCounterCategory.Create(..., counters); PC instance = new PerformanceCounter(...); instance.RawValue = 128; var counters = new CounterCreationDataCollection (); counters.Add(new CounterCreationData(...)); PerformanceCounterCategory.Create(..., counters); PC instance = new PerformanceCounter(...); instance.RawValue = 128;

12

13

14 Event Audience Developer; IT ProfessionalSystem Administrator TechnologyETWEvent Log Event ControlManualAlways On Event Rate High (10^4 / sec)Medium (10^2 - 10^4 / sec) Features Declaratively defined in manifests Programmatic Consumption Discoverability Localizable Strings Flexible Data Model Same Features of ETW plus: Remote Collection Data Query Support Admin Focused Tools Centralized event logs Reduced logging rate Common API Set and Development Model

15 Providers are automatically enabled to the Event Log if they log to channels

16 typedefstruct _EVENT_DESCRIPTOR { USHORT Id; UCHAR Version; UCHAR Channel; UCHAR Level; UCHAR Opcode; USHORT Task; ULONGLONG Keyword; } EVENT_DESCRIPTOR, *PEVENT_DESCRIPTOR; typedefstruct _EVENT_DESCRIPTOR { USHORT Id; UCHAR Version; UCHAR Channel; UCHAR Level; UCHAR Opcode; USHORT Task; ULONGLONG Keyword; } EVENT_DESCRIPTOR, *PEVENT_DESCRIPTOR;

17

18

19

20

21

22

23

24 Design 1 1 Create Instrumentation Manifest (ECMangen) Create Instrumentation Manifest (ECMangen) XML Manifest XML Manifest 2 2 CTRPP / MC preprocessors CTRPP / MC preprocessors.rc.c.h 3 3 Instrument provider APIs Instrument provider APIs New provider code New provider code 4 4 Build New Provider New Provider 5 5

25 Status = EventRegisterMyProvider(); … EventWriteMyEvent(42, 3.14, “My String”); … EventUnregisterMyProvider(); Status = EventRegisterMyProvider(); … EventWriteMyEvent(42, 3.14, “My String”); … EventUnregisterMyProvider();

26 MyProvidersimplePrvdr = new MyProvider(); … simplePrvdr.EventWriteMyEvent( 42, 3.14, “My String”); … MyProvidersimplePrvdr = new MyProvider(); … simplePrvdr.EventWriteMyEvent( 42, 3.14, “My String”); …

27

28

29 Design your application’s events and counters with a goal in mind

30

31

32

33 Set WMI = GetObject("winmgmts:“...) Set products = WMI.ExecQuery _ ("Select * from Win32_WindowsProductActivation") For Each product in products product.ActivateOnline() Next Set WMI = GetObject("winmgmts:“...) Set products = WMI.ExecQuery _ ("Select * from Win32_WindowsProductActivation") For Each product in products product.ActivateOnline() Next

34 ManagementObjectSearcher s = new ManagementObjectSearcher(...,"SELECT * FROM Win32_Share"); foreach (var share in s.Get()) { Console.WriteLine(share. GetPropertyValue("Path0")); } ManagementObjectSearcher s = new ManagementObjectSearcher(...,"SELECT * FROM Win32_Share"); foreach (var share in s.Get()) { Console.WriteLine(share. GetPropertyValue("Path0")); }

35 [InstrumentationClass( InstrumentationType.Event)] public class CpuTemperatureTooHighEvent { public float Temperature {... } public static void Publish(float f) { Instrumentation.Fire( new CpuTemperatureTooHighEvent(f)); } [InstrumentationClass( InstrumentationType.Event)] public class CpuTemperatureTooHighEvent { public float Temperature {... } public static void Publish(float f) { Instrumentation.Fire( new CpuTemperatureTooHighEvent(f)); }

36

37

38

39

40

41

42

43

44

45

46

47 Trouble- shooting Pack Resolution Scripts Verification Scripts Localized Resources

48

49

50 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.


Download ppt "Instrumentation And Performance Microsoft ® Corporation."

Similar presentations


Ads by Google