ContainerTracer  0.1
Public Member Functions | Static Public Member Functions | Data Fields | Private Member Functions | Static Private Attributes
web.package.container_tracer.ContainerTracer Class Reference

Runner class for container-tracer run in multithread. More...

Inheritance diagram for web.package.container_tracer.ContainerTracer:
Inheritance graph
Collaboration diagram for web.package.container_tracer.ContainerTracer:
Collaboration graph

Public Member Functions

def __init__
 Initialize with socketio before run container-tracer. More...
 
def set_global_config
 Set global configuration object by this function. More...
 
def container_tracer_free (self)
 Free memory after running container-trace. More...
 
def run_all_container_tracer (self)
 Run container-tracer. More...
 

Static Public Member Functions

def get_valid_filename
 Check the validation of the filename. More...
 

Data Fields

 socketio
 
 libc
 
 nr_tasks
 
 global_config
 
 driver
 

Private Member Functions

def _set_config
 Set proper options before running run_all_container_tracer(). More...
 
def _container_tracer_run (self)
 Call runner module with config options at set_config(). More...
 
def _get_interval_result
 Receive container-tracer interval result. More...
 
def _get_total_result (self)
 Get total result from runner library. More...
 
def _refresh (self)
 Refresh frontend chart by a interval with container-tracer async. More...
 
def _update_interval_results
 Send container-tracer interval result to frontend chart. More...
 
def _container_tracer_driver (self)
 Run container-tracer and refresh frontend chart in multithread with selected driver. More...
 

Static Private Attributes

string _libc_path = "librunner.so"
 

Detailed Description

Runner class for container-tracer run in multithread.

Set container-tracer options and run container-tracer. Print result by a interval async. Usage: Pass the socketio for communicate with frontend at creation. Set config with set_config(config). Run container-tracer with run_all_container_tracer().

Constructor & Destructor Documentation

◆ __init__()

def web.package.container_tracer.ContainerTracer.__init__ (   self,
  socketio 
)

Initialize with socketio before run container-tracer.

Parameters
[in]socketioWant to communicate frontend socketio.
[in]configConfig options from frontend.

Member Function Documentation

◆ _container_tracer_driver()

def web.package.container_tracer.ContainerTracer._container_tracer_driver (   self,
  None 
)
private

Run container-tracer and refresh frontend chart in multithread with selected driver.

Here is the call graph for this function:

◆ _container_tracer_run()

def web.package.container_tracer.ContainerTracer._container_tracer_run (   self,
  None 
)
private

Call runner module with config options at set_config().

Here is the call graph for this function:

◆ _get_interval_result()

def web.package.container_tracer.ContainerTracer._get_interval_result (   self,
  key 
)
private

Receive container-tracer interval result.

Run async with container-tracer. If there are no result, pending.

Parameters
[in]keyCertain group's key that want to receive.

◆ _get_total_result()

def web.package.container_tracer.ContainerTracer._get_total_result (   self,
  None 
)
private

Get total result from runner library.

Here is the call graph for this function:

◆ _refresh()

def web.package.container_tracer.ContainerTracer._refresh (   self,
  None 
)
private

Refresh frontend chart by a interval with container-tracer async.

Send result via chart module.

◆ _set_config()

def web.package.container_tracer.ContainerTracer._set_config (   self,
  config 
)
private

Set proper options before running run_all_container_tracer().

Parameters
[in]configConfig options from frontend.

◆ _update_interval_results()

def web.package.container_tracer.ContainerTracer._update_interval_results (   self,
  interval_results 
)
private

Send container-tracer interval result to frontend chart.

Parameters
[in]interval_resultContainer-traacer interval result want to send to frontend chart.

◆ container_tracer_free()

def web.package.container_tracer.ContainerTracer.container_tracer_free (   self,
  None 
)

Free memory after running container-trace.

Must call container_tracer_free after running run_all_container_tracer(). If don't, Error must be occur at next phase.

Here is the call graph for this function:

◆ get_valid_filename()

def web.package.container_tracer.ContainerTracer.get_valid_filename (   filename)
static

Check the validation of the filename.

And if it is not valid, then attach number 1, 2, 3...

Parameters
strFilename which I want to output.
Returns
Valid filename string.

◆ run_all_container_tracer()

def web.package.container_tracer.ContainerTracer.run_all_container_tracer (   self,
  None 
)

Run container-tracer.

No waiting with seperating thread. Must be called with sudo, call set_config() before running this.

◆ set_global_config()

def web.package.container_tracer.ContainerTracer.set_global_config (   self,
  config 
)

Set global configuration object by this function.

Parameters
Configglobal configuration object
Note
This method is called by set_options() in web/package/main/events.py

Field Documentation

◆ _libc_path

string web.package.container_tracer.ContainerTracer._libc_path = "librunner.so"
staticprivate

◆ driver

web.package.container_tracer.ContainerTracer.driver

◆ global_config

web.package.container_tracer.ContainerTracer.global_config

◆ libc

web.package.container_tracer.ContainerTracer.libc

◆ nr_tasks

web.package.container_tracer.ContainerTracer.nr_tasks

◆ socketio

web.package.container_tracer.ContainerTracer.socketio

The documentation for this class was generated from the following file: