24RCSID(
"$Id: f74cbdd3f3fa786b6c0de96479d8b4df912dadb4 $")
26#include <freeradius-devel/server/client.h>
27#include <freeradius-devel/server/request.h>
28#include <freeradius-devel/server/stats.h>
29#include <freeradius-devel/util/debug.h>
31#include <freeradius-devel/util/misc.h>
32#include <freeradius-devel/util/time.h>
33#include <freeradius-devel/radius/defs.h>
36#define EMA_SCALE (100)
37#define F_EMA_SCALE (1000000)
39#define FR_STATS_INIT { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
40 { 0, 0, 0, 0, 0, 0, 0, 0 }}
47 if (request->counted)
return;
50 if (!request->listener)
return;
51 if (!request->client)
return;
52 if (!request->packet)
return;
65#define INC_AUTH(_x) do { radius_auth_stats._x++;request->client->auth._x++; } while (0)
68#define INC_ACCT(_x) do { radius_acct_stats._x++;request->client->acct._x++; } while (0)
89 request->packet->timestamp,
90 request->reply->timestamp);
92 request->packet->timestamp,
93 request->reply->timestamp);
107 request->packet->timestamp,
108 request->reply->timestamp);
116 switch (request->packet->code) {
118 if (request->reply->id == -1) {
127 if (request->reply->id == -1) {
143 request->counted =
true;
172 for (i = 0; i < 7; i++) {
@ FR_RADIUS_CODE_ACCESS_CHALLENGE
RFC2865 - Access-Challenge.
@ FR_RADIUS_CODE_ACCESS_REQUEST
RFC2865 - Access-Request.
@ FR_RADIUS_CODE_STATUS_SERVER
RFC2865/RFC5997 - Status Server (request)
@ FR_RADIUS_CODE_ACCESS_ACCEPT
RFC2865 - Access-Accept.
@ FR_RADIUS_CODE_ACCOUNTING_RESPONSE
RFC2866 - Accounting-Response.
@ FR_RADIUS_CODE_ACCOUNTING_REQUEST
RFC2866 - Accounting-Request.
@ FR_RADIUS_CODE_ACCESS_REJECT
RFC2865 - Access-Reject.
void fr_stats_bins(fr_stats_t *stats, fr_time_t start, fr_time_t end)
Sort latency times into bins.
void request_stats_final(request_t *request)
fr_stats_t radius_auth_stats
fr_stats_t radius_acct_stats
static fr_time_delta_t fr_time_delta_from_sec(int64_t sec)
static int64_t fr_time_delta_to_usec(fr_time_delta_t delta)
#define fr_time_delta_gteq(_a, _b)
#define fr_time_sub(_a, _b)
Subtract one time from another.
#define fr_time_lt(_a, _b)
A time delta, a difference in time measured in nanoseconds.