libtasks Documentation  1.6
stats Class Reference

#include <echoserver.h>

Inheritance diagram for stats:
Collaboration diagram for stats:

Public Member Functions

 stats ()
 
bool handle_event (tasks::worker *, int revents)
 
 stats ()
 
bool handle_event (tasks::worker *, int revents)
 
 stats ()
 
bool handle_event (tasks::worker *, int revents)
 
- Public Member Functions inherited from tasks::timer_task
 timer_task (double after, double repeat)
 
virtual ~timer_task ()
 
std::string get_string () const
 
ev_timer * watcher () const
 
double after () const
 
double repeat () const
 
void init_watcher ()
 Initialize the underlying watcher object. More...
 
void start_watcher (worker *worker)
 Activate the underlying watcher to listen for I/O or timer events. More...
 
void stop_watcher (worker *worker)
 Deactivate the underlying watcher. More...
 
- Public Member Functions inherited from tasks::event_task
virtual ~event_task ()
 
workerassigned_worker () const
 Returns a pointer to the assigned worker. More...
 
void assign_worker (worker *worker)
 
void notify_error (worker *worker=nullptr)
 
void on_error (error_func_worker_t f)
 
void on_error (error_func_void_t f)
 Install an error callback. More...
 
- Public Member Functions inherited from tasks::task
virtual ~task ()
 
bool auto_delete () const
 Returns true if auto deletion is active. More...
 
void disable_auto_delete ()
 Call this to deactivate auto deletion. More...
 
void finish (worker *worker=nullptr)
 Called by a worker when a task has auto_deletion enabled. More...
 
void on_finish (finish_func_worker_t f)
 
void on_finish (finish_func_void_t f)
 
- Public Member Functions inherited from tasks::error_base
 error_base ()
 
virtual ~error_base ()
 
bool error () const
 Return true if an error occured. More...
 
tasks_error error_code () const
 Return the error code. More...
 
const std::string & error_message () const
 Return the error message. More...
 
int sys_errno () const
 Return the errno if available. More...
 
std::string sys_errno_str () const
 Return the errno description if available. More...
 
const tasks_exceptionexception () const
 Return the underlying exception object. More...
 
void set_exception (tasks_exception &e)
 Set an exception to report an error. More...
 
void reset_error ()
 Reset the error state. More...
 

Static Public Member Functions

static void inc_req ()
 
static void inc_clients ()
 
static void dec_clients ()
 
static void inc_req ()
 
static void inc_clients ()
 
static void dec_clients ()
 
static void inc_req ()
 
static void inc_clients ()
 
static void dec_clients ()
 

Private Attributes

std::time_t m_last
 

Static Private Attributes

static std::atomic< int > m_req_count
 
static std::atomic< int > m_clients
 

Additional Inherited Members

- Public Types inherited from tasks::event_task
typedef std::function< void(worker
*worker, const tasks_exception
&e)> 
error_func_worker_t
 
typedef std::function< void(const
tasks_exception &e)> 
error_func_void_t
 
- Public Types inherited from tasks::task
typedef std::function< void(worker
*worker)> 
finish_func_worker_t
 
typedef std::function< void()> finish_func_void_t
 

Detailed Description

Definition at line 19 of file echoserver.h.

Constructor & Destructor Documentation

stats::stats ( )
inline

Definition at line 21 of file echoserver.h.

stats::stats ( )
inline

Definition at line 17 of file thrift_server/stats.h.

stats::stats ( )
inline

Definition at line 17 of file uwsgi/stats.h.

Member Function Documentation

static void stats::dec_clients ( )
inlinestatic

Definition at line 25 of file thrift_server/stats.h.

static void stats::dec_clients ( )
inlinestatic

Definition at line 25 of file uwsgi/stats.h.

static void stats::dec_clients ( )
inlinestatic

Definition at line 29 of file echoserver.h.

Here is the caller graph for this function:

bool stats::handle_event ( tasks::worker worker,
int  events 
)
virtual

Will be called for each I/O or timer event.

Each task needs to implement the handle_event method. Returns true if the task stays active and false otherwise. The task will be deleted if false is returned and auto_delete() returns true.

Parameters
workerThe worker thread executing the task.
eventsThe events bitmask.
Returns
True to continue execution. False to remove the task.

Implements tasks::event_task.

bool stats::handle_event ( tasks::worker worker,
int  events 
)
virtual

Will be called for each I/O or timer event.

Each task needs to implement the handle_event method. Returns true if the task stays active and false otherwise. The task will be deleted if false is returned and auto_delete() returns true.

Parameters
workerThe worker thread executing the task.
eventsThe events bitmask.
Returns
True to continue execution. False to remove the task.

Implements tasks::event_task.

bool stats::handle_event ( tasks::worker worker,
int  events 
)
virtual

Will be called for each I/O or timer event.

Each task needs to implement the handle_event method. Returns true if the task stays active and false otherwise. The task will be deleted if false is returned and auto_delete() returns true.

Parameters
workerThe worker thread executing the task.
eventsThe events bitmask.
Returns
True to continue execution. False to remove the task.

Implements tasks::event_task.

Definition at line 72 of file echoserver.cpp.

Here is the call graph for this function:

static void stats::inc_clients ( )
inlinestatic

Definition at line 23 of file uwsgi/stats.h.

static void stats::inc_clients ( )
inlinestatic

Definition at line 23 of file thrift_server/stats.h.

static void stats::inc_clients ( )
inlinestatic

Definition at line 27 of file echoserver.h.

Here is the caller graph for this function:

static void stats::inc_req ( )
inlinestatic

Definition at line 21 of file uwsgi/stats.h.

static void stats::inc_req ( )
inlinestatic

Definition at line 21 of file thrift_server/stats.h.

static void stats::inc_req ( )
inlinestatic

Definition at line 25 of file echoserver.h.

Here is the caller graph for this function:

Member Data Documentation

static std::atomic< int > stats::m_clients
staticprivate

Definition at line 33 of file echoserver.h.

std::time_t stats::m_last
private

Definition at line 34 of file echoserver.h.

static std::atomic< int > stats::m_req_count
staticprivate

Definition at line 32 of file echoserver.h.


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