libtasks Documentation
1.6
Main Page
Namespaces
Classes
Files
File List
File Members
uwsgi/stats.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2013-2014 ADTECH GmbH
3
* Licensed under MIT (https://github.com/adtechlabs/libtasks/blob/master/COPYING)
4
*
5
* Author: Andreas Pohl
6
*/
7
8
#ifndef _STATS_H_
9
#define _STATS_H_
10
11
#include <
tasks/timer_task.h
>
12
#include <atomic>
13
#include <ctime>
14
15
class
stats
:
public
tasks::timer_task
{
16
public
:
17
stats
() :
timer_task
(10., 10.) {
m_last
= std::time(
nullptr
); }
18
19
bool
handle_event
(
tasks::worker
*,
int
revents);
20
21
static
void
inc_req
() {
m_req_count
++; }
22
23
static
void
inc_clients
() {
m_clients
++; }
24
25
static
void
dec_clients
() {
m_clients
--; }
26
27
private
:
28
static
std::atomic<int>
m_req_count
;
29
static
std::atomic<int>
m_clients
;
30
std::time_t
m_last
;
31
};
32
33
#endif // _STATS_H_
stats::inc_clients
static void inc_clients()
Definition:
uwsgi/stats.h:23
tasks::worker
Definition:
worker.h:55
stats::handle_event
bool handle_event(tasks::worker *, int revents)
Definition:
echoserver.cpp:72
timer_task.h
tasks::timer_task
Definition:
timer_task.h:20
stats::m_req_count
static std::atomic< int > m_req_count
Definition:
echoserver.h:32
stats::m_clients
static std::atomic< int > m_clients
Definition:
echoserver.h:33
stats
Definition:
echoserver.h:19
stats::stats
stats()
Definition:
uwsgi/stats.h:17
stats::inc_req
static void inc_req()
Definition:
uwsgi/stats.h:21
stats::m_last
std::time_t m_last
Definition:
echoserver.h:34
tasks::timer_task::timer_task
timer_task(double after, double repeat)
Definition:
timer_task.cpp:15
stats::dec_clients
static void dec_clients()
Definition:
uwsgi/stats.h:25
examples
uwsgi
stats.h
Generated by
1.8.6