Date post: | 19-Dec-2015 |
Category: |
Documents |
View: | 214 times |
Download: | 0 times |
Presented By:
Shatsman Yuri
Leibovitz Amit
Supervised By:
Oved Itzhak
Generic Enhancement to Application Dynamic Behavior
Monitoring
Winter 2009/10Networked Software Systems Lab, EE Department,
Technion – Israel Institute of Technology
2
IntroductionDesign
Sampling unit Algorithms Infrastructure GUI Entire system top-view
ResultsDemo
Presented by: Shatsman Yuri & Leibovitz Amit
Agenda
3Presented by: Shatsman Yuri & Leibovitz Amit
Background: Performance CountersProvide information on the dynamic behavior of
an application.Built-in standardized support in Windows.
The problem:The application’s developers choose what
information to expose, and it’s impossible to manipulate this data.
A system administrator might want to manipulate the data provided.
No built-in tool allows this behavior...
Introduction
4Presented by: Shatsman Yuri & Leibovitz Amit
Existing solutionA. Svetlit & D. Nasi, 2008 (supervised by Oved Itzhak).Problem with Rate counters due to implementation in
C# - a .NET language.
Our GoalsAllow the user to perform arbitrary manipulations on
existing performance data.Allow extensibility of the system to allow the user to
create personal algorithms. Implement a provider in a native language which could
determine when it is sampled.Wrap the entire system in a user friendly environment.
Introduction (cont.)
5
IntroductionDesign
Sampling unit Algorithms Infrastructure GUI Entire system top-view
ResultsDemo
Presented by: Shatsman Yuri & Leibovitz Amit
Agenda
6Presented by: Shatsman Yuri & Leibovitz Amit
The system was divided into 3 units:Sampling unit
Does the bulk of the workThe link to the framework
Algorithms InfrastructureAllows extensibility of the
systemPerforms the manipulations
GUIP.A.TAllows management of the
entire system
Design
deployment Block Deployment
System Deployment (Components)
Operating System (Windows)
Our System
PDH
GUI
Sampeling Unit
«extensible»Algorithms
Registry
7
IntroductionDesign
Sampling unit Algorithms Infrastructure GUI Entire system top-view
ResultsDemo
Presented by: Shatsman Yuri & Leibovitz Amit
Agenda
8Presented by: Shatsman Yuri & Leibovitz Amit
Consists of 3 componentsWorker DLLWrapper units
Provider DLLSampling Process
Design – Sampling Unitcmp Sampeling Unit
Sampling Unit
«library»Worker DLL
+ ClosePerformanceCounter() : DWORD+ CollectPerformaceData(LPDWORD, LPDWORD, LPVOID, LPWSTR) : DWORD+ OpenPerformanceCounter(LPWSTR) : DWORD+ Register(String, String) : DWORD+ Unregister(String) : DWORD
Trace
Prov ider DLL (Wrapper with minimal functionality)
+ SetDull() : void+ Open(LPWSTR) : void+ Collect(LPDWORD, LPDWORD, LPVOID*, LPWSTR) : DWORD+ Close() : DWORD
Sampling Process
Spawn new processSet up IPC
IPC link: Sample
Contains a dullified copyTo prevent recursive sampelings
Uses Sampeling functionality
«import»
1
1
1
1
9Presented by: Shatsman Yuri & Leibovitz Amit
Sampling Unit – Worker DLLProvides the core functionality of the entire
systemProvides category registration/un-registration
services for the GUI.Performs the actual
sampling and putsthe data in properformat for the OS.
uc Performance DLL
Performance DLL
GUI
Sampeling Process support PDH
Register
UnRegister
Open
Collect
Close
Parse Settings File
Get service from the PDH
Algorithm
Performs the actual computation
«include»
«include»
10Presented by: Shatsman Yuri & Leibovitz Amit
Provider DLLA shell providing the require API to the framework.Spawns the Sampling Process.Sets up an IPC channel.Forwards the sampling requests to the sampling
process.
Sampling ProcessDerived need from the frameworks constraints.Spawned by the Provider DLL.Wrapper to the Worker DLL.Propagates the data created by the worker DLL to the
provider DLL.
Sampling Unit – Wrapper Units
11
IntroductionDesign
Sampling unit Algorithms Infrastructure GUI Entire system top-view
ResultsDemo
Presented by: Shatsman Yuri & Leibovitz Amit
Agenda
12Presented by: Shatsman Yuri & Leibovitz Amit
Allows extensibility of the systemDefined interface.Defined descriptor files.Any DLL that conforms to
the Algorithm Interface and comes with a proper descriptor file can be used.User can implement new
algorithms.
Algorithms Infrastructure - Introduction
uc Algorithm
Algorithm
Worker DLL
Initialize
Calculate
Close
Encounter Error
Access Error Num
«include»
«extend»
«extend»
«extend»
13Presented by: Shatsman Yuri & Leibovitz Amit
Exponential Smoothing By the formula:Takes alpha as a parameter.Single input counter.
Summation AlgorithmSimple sum of an arbitrary set of inputs.Requires no parameters.Unbound number of inputs.
Implemented Algorithms
]1,0(111 nfxnf n
14
IntroductionDesign
Sampling unit Algorithms Infrastructure GUI Entire system top-view
ResultsDemo
Presented by: Shatsman Yuri & Leibovitz Amit
Agenda
15Presented by: Shatsman Yuri & Leibovitz Amit
P.A.T – Performance Analysis Tool.Manages the entire system.Designed to be intuitive and simple without
losing any of the systems functionalities.
Design – GUI
17Presented by: Shatsman Yuri & Leibovitz Amit
The GUI DatabaseThe light version.Represents the system
state.Can be serialized and
deserialized.allows saving the
system state.
Design – GUI (cont. 2)class DataStructure
GUI data structure
Algorithm
ParamInput
SerializableElement
Counter
Category
DataBase
*{ordered}
1
*{ordered}
1
*
1
*{ordered}
*
*
1
*
1
18Presented by: Shatsman Yuri & Leibovitz Amit
The GUI settings fileSerialization result.
Design – GUI (cont. 3)
cmp SettingFile
GUI Settings File
Algorithm List Block
- algorithms_num: int
Algorithm [algorithms_num instances]
- name_size: int- Algorithm_Name: wchar_t[name_size]- desc_size: int- Algorithm_Description: wchar_t[desc_size]- dll_path_size: int- DLL_Path: wchar_t[dll_path_size]- xml_path_size: int- XML_Path: wchar_t[xml_path_size]- max_inputs: int- inputs_num: int- parameters_num: int
Input Block [inputs_num instances]
- name_size: int- Input_Name: wchar_t[name_size]- desc_size: int- Input_Description: wchar_t[desc_size]
Categories List Block
- categories_num: int
Parameter Block [parameters_num instances]
- name_size: int- Param_Name: wchar_t[name_size]- desc_size: int- Parameter_Description: wchar_t[desc_size]- type: int- hasDefault: byte- default_value: double
Category Settings file structure [categories_num instances]
Header (Singleton)
- cat_name_size: int- Categoty_Name: wchar_t[cat_name_size]- cat_desc_size: int- Categoty_Description: wchar_t[cat_desc_size]- algorithms_num: int- number_of_counters: int
Counters (number_of_counters instances)
- name_size: int- Name_String: wchar_t[name_size]- description_size: int- Description_String: wchar_t[description_size]- Counter_Type: DWORD- Algorithm_Index: int
Algorithm Parameters
- parameter_count: int- parameters: double[parameter_count]
Input Counters
- number_of_inputs: int
Input Counter Instance (number_of_inputs instances)
- counter_path_size: int- Counter_Path_String: wchar_t[counter_path_size]
Algorithm Files (algorithms_num instances)
- algo_name_size: int- Algorithm_Name: wchar_t[algo_name_size]
cmp SettingFile
GUI Settings File
Algorithm List Block
- algorithms_num: int
Algorithm [algorithms_num instances]
- name_size: int- Algorithm_Name: wchar_t[name_size]- desc_size: int- Algorithm_Description: wchar_t[desc_size]- dll_path_size: int- DLL_Path: wchar_t[dll_path_size]- xml_path_size: int- XML_Path: wchar_t[xml_path_size]- max_inputs: int- inputs_num: int- parameters_num: int
Input Block [inputs_num instances]
- name_size: int- Input_Name: wchar_t[name_size]- desc_size: int- Input_Description: wchar_t[desc_size]
Categories List Block
- categories_num: int
Parameter Block [parameters_num instances]
- name_size: int- Param_Name: wchar_t[name_size]- desc_size: int- Parameter_Description: wchar_t[desc_size]- type: int- hasDefault: byte- default_value: double
Category Settings file structure [categories_num instances]
Header (Singleton)
- cat_name_size: int- Categoty_Name: wchar_t[cat_name_size]- cat_desc_size: int- Categoty_Description: wchar_t[cat_desc_size]- algorithms_num: int- number_of_counters: int
Counters (number_of_counters instances)
- name_size: int- Name_String: wchar_t[name_size]- description_size: int- Description_String: wchar_t[description_size]- Counter_Type: DWORD- Algorithm_Index: int
Algorithm Parameters
- parameter_count: int- parameters: double[parameter_count]
Input Counters
- number_of_inputs: int
Input Counter Instance (number_of_inputs instances)
- counter_path_size: int- Counter_Path_String: wchar_t[counter_path_size]
Algorithm Files (algorithms_num instances)
- algo_name_size: int- Algorithm_Name: wchar_t[algo_name_size]
The category serializes into the
Worker DLLs settings file
19
IntroductionDesign
Sampling unit Algorithms Infrastructure GUI Entire system top-view
ResultsDemo
Presented by: Shatsman Yuri & Leibovitz Amit
Agenda
20Presented by: Shatsman Yuri & Leibovitz Amit
Entire system top-view
deployment Full Deployment
System Deployment (Components)
Operating System (Windows)
Our System
«library»Worker DLL
+ ClosePerformanceCounter() : DWORD+ CollectPerformaceData(LPDWORD, LPDWORD, LPVOID, LPWSTR) : DWORD+ OpenPerformanceCounter(LPWSTR) : DWORD+ Register(String, String) : DWORD+ Unregister(String) : DWORD
«library»AlgorithmDLLs
Descriptor File
PDH
Setting fi le
GUI
Registry
- Settings File Path: String
Read: CountersAlgorithms & Parameters
Trace
Create & update
Read
Performance counterregistration
Use counterregistration functions
Prov ider DLL (Wrapper with minimal functionality)
+ SetDull() : void+ Open(LPWSTR) : void+ Collect(LPDWORD, LPDWORD, LPVOID*, LPWSTR) : DWORD+ Close() : DWORD
Sampling Process
Spawn new processSet up IPC
IPC link: Sample
Contains a dullified copyTo prevent recursive sampelings
Uses Sampeling functionality
Use sampeling API
(On open)Setting File Path
Contains Path
1
«use»
1..*
11
«import»
1
*
1
1
1
1
21Presented by: Shatsman Yuri & Leibovitz Amit
The initial system design was simpler.As it looked in the
mid-term presentation.The framework didn’t
support our usage.Doesn’t allow a
sampled process tosample others.
Solution: separatingthe providing and the consumption toseparate processes, as shown in the currentdesign.
Initial design and bumps in the road
deployment Deployment
System Deployment (Components)
Operating System (Windows)
Our System
«library»Performance DLL
+ ClosePerformanceCounter() : DWORD+ CollectPerformaceData(LPDWORD, LPDWORD, LPVOID*, LPWSTR) : DWORD+ OpenPerformanceCounter(LPWSTR) : DWORD+ Register(String, String) : DWORD+ Unregister(String) : DWORD
«library»AlgorithmDLLs
+ Initialize(Array, int) : ALGO_HANDLER+ CalculateAlgorithm(ALGO_HANDLER, Array, Array*) : Result+ CloseAlgorithm(ALGO_HANDLER) : void+ error_str() : char*
Descriptor File
PDH
Setting fi le
GUI
Registry
- Settings File Path: String
PDH Activates and uses the Open, Collect and Exit of Performance DLLPerformance DLL consumes counters using the PDH interface
CountersAlgorithms & Parameters
Trace
Create & update
Read
Performance counterregistration
Use counterregistration functions
1
1
1
«use»
1..*
22
IntroductionDesign
Sampling unit Algorithms Infrastructure GUI Entire system top-view
ResultsDemo
Presented by: Shatsman Yuri & Leibovitz Amit
Agenda
25Presented by: Shatsman Yuri & Leibovitz Amit
Rate exampleThis is the main advantage of our project over
the previous:Synchronized
sampling
Results
26Presented by: Shatsman Yuri & Leibovitz Amit
Existing solutionA. Svetlit & D. Nasi, 2008 (supervised by Oved Itzhak).Problem with Rate counters due to implementation in
managed language.
Our GoalsAllow the user to perform arbitrary manipulations on
existing performance data.Allow extensibility of the system to allow the user to
create personal algorithms. Implement a provider in a native language which could
determine when it is sampled.Wrap the entire system in a user friendly environment.
And just a reminder