| Code Coverage: vinyl-cache/lib/libvsc/VSC_waiter.c |
| |
| 82217aa4fc7094b3610340078afaf78cd95a8ec9 |
| |
| 0 |
|
/* |
| 1 |
|
* NB: This file is machine generated, DO NOT EDIT! |
| 2 |
|
* |
| 3 |
|
* Edit waiter.vsc and run lib/libvsc/vsctool.py instead. |
| 4 |
|
*/ |
| 5 |
|
|
| 6 |
|
#include "config.h" |
| 7 |
|
#include <stdio.h> |
| 8 |
|
#include <stdarg.h> |
| 9 |
|
#include "vdef.h" |
| 10 |
|
#include "vas.h" |
| 11 |
|
#include "vrt.h" |
| 12 |
|
#include "VSC_waiter.h" |
| 13 |
|
|
| 14 |
|
static const char vsc_waiter_name[] = "WAITER"; |
| 15 |
|
|
| 16 |
|
#define PARANOIA(a,n) \ |
| 17 |
|
v_static_assert( \ |
| 18 |
|
offsetof(struct VSC_waiter, a) == n, \ |
| 19 |
|
"VSC element '" #a "' at wrong offset") |
| 20 |
|
|
| 21 |
|
PARANOIA(conns, 0); |
| 22 |
|
PARANOIA(remclose, 8); |
| 23 |
|
PARANOIA(timeout, 16); |
| 24 |
|
PARANOIA(action, 24); |
| 25 |
|
#undef PARANOIA |
| 26 |
|
|
| 27 |
|
static const unsigned char vsc_waiter_json[1083] = { |
| 28 |
|
123,34,118,101,114,115,105,111,110,34,58,34,49,34,44,34,110,97,109,101, |
| 29 |
|
34,58,34,119,97,105,116,101,114,34,44,34,111,110,101,108,105,110,101, |
| 30 |
|
114,34,58,34,87,97,105,116,101,114,32,99,111,117,110,116,101,114,115, |
| 31 |
|
34,44,34,111,114,100,101,114,34,58,56,48,44,34,100,111,99,115,34,58, |
| 32 |
|
34,34,44,34,101,108,101,109,101,110,116,115,34,58,52,44,34,101,108,101, |
| 33 |
|
109,34,58,123,34,99,111,110,110,115,34,58,123,34,116,121,112,101,34, |
| 34 |
|
58,34,103,97,117,103,101,34,44,34,99,116,121,112,101,34,58,34,117,105, |
| 35 |
|
110,116,54,52,95,116,34,44,34,108,101,118,101,108,34,58,34,100,101,98, |
| 36 |
|
117,103,34,44,34,111,110,101,108,105,110,101,114,34,58,34,78,117,109, |
| 37 |
|
98,101,114,32,111,102,32,105,100,108,101,32,99,111,110,110,101,99,116, |
| 38 |
|
105,111,110,115,34,44,34,102,111,114,109,97,116,34,58,34,105,110,116, |
| 39 |
|
101,103,101,114,34,44,34,105,110,100,101,120,34,58,48,44,34,110,97,109, |
| 40 |
|
101,34,58,34,99,111,110,110,115,34,44,34,100,111,99,115,34,58,34,92, |
| 41 |
|
116,78,117,109,98,101,114,32,111,102,32,105,100,108,101,32,99,111,110, |
| 42 |
|
110,101,99,116,105,111,110,115,32,98,101,105,110,103,32,119,97,105,116, |
| 43 |
|
101,100,32,111,118,101,114,46,34,125,44,34,114,101,109,99,108,111,115, |
| 44 |
|
101,34,58,123,34,116,121,112,101,34,58,34,99,111,117,110,116,101,114, |
| 45 |
|
34,44,34,99,116,121,112,101,34,58,34,117,105,110,116,54,52,95,116,34, |
| 46 |
|
44,34,108,101,118,101,108,34,58,34,100,101,98,117,103,34,44,34,111,110, |
| 47 |
|
101,108,105,110,101,114,34,58,34,78,117,109,98,101,114,32,111,102,32, |
| 48 |
|
105,100,108,101,32,99,111,110,110,101,99,116,105,111,110,115,32,99,108, |
| 49 |
|
111,115,101,100,32,98,121,32,112,101,101,114,34,44,34,102,111,114,109, |
| 50 |
|
97,116,34,58,34,105,110,116,101,103,101,114,34,44,34,105,110,100,101, |
| 51 |
|
120,34,58,56,44,34,110,97,109,101,34,58,34,114,101,109,99,108,111,115, |
| 52 |
|
101,34,44,34,100,111,99,115,34,58,34,92,116,78,117,109,98,101,114,32, |
| 53 |
|
111,102,32,105,100,108,101,32,99,111,110,110,101,99,116,105,111,110, |
| 54 |
|
115,32,116,104,97,116,32,101,120,112,101,114,105,101,110,99,101,100, |
| 55 |
|
32,99,108,111,115,117,114,101,32,98,121,32,112,101,101,114,32,119,104, |
| 56 |
|
105,108,101,32,98,101,105,110,103,92,110,92,116,119,97,105,116,101,100, |
| 57 |
|
32,102,111,114,46,34,125,44,34,116,105,109,101,111,117,116,34,58,123, |
| 58 |
|
34,116,121,112,101,34,58,34,99,111,117,110,116,101,114,34,44,34,99,116, |
| 59 |
|
121,112,101,34,58,34,117,105,110,116,54,52,95,116,34,44,34,108,101,118, |
| 60 |
|
101,108,34,58,34,100,101,98,117,103,34,44,34,111,110,101,108,105,110, |
| 61 |
|
101,114,34,58,34,78,117,109,98,101,114,32,111,102,32,105,100,108,101, |
| 62 |
|
32,99,111,110,110,101,99,116,105,111,110,115,32,116,105,109,101,111, |
| 63 |
|
117,116,34,44,34,102,111,114,109,97,116,34,58,34,105,110,116,101,103, |
| 64 |
|
101,114,34,44,34,105,110,100,101,120,34,58,49,54,44,34,110,97,109,101, |
| 65 |
|
34,58,34,116,105,109,101,111,117,116,34,44,34,100,111,99,115,34,58,34, |
| 66 |
|
92,116,78,117,109,98,101,114,32,111,102,32,105,100,108,101,32,99,111, |
| 67 |
|
110,110,101,99,116,105,111,110,115,32,116,104,97,116,32,101,120,112, |
| 68 |
|
101,114,105,101,110,99,101,100,32,97,32,116,105,109,101,111,117,116, |
| 69 |
|
32,101,118,101,110,116,32,119,104,105,108,101,32,98,101,105,110,103, |
| 70 |
|
92,110,92,116,119,97,105,116,101,100,32,102,111,114,46,34,125,44,34, |
| 71 |
|
97,99,116,105,111,110,34,58,123,34,116,121,112,101,34,58,34,99,111,117, |
| 72 |
|
110,116,101,114,34,44,34,99,116,121,112,101,34,58,34,117,105,110,116, |
| 73 |
|
54,52,95,116,34,44,34,108,101,118,101,108,34,58,34,100,101,98,117,103, |
| 74 |
|
34,44,34,111,110,101,108,105,110,101,114,34,58,34,78,117,109,98,101, |
| 75 |
|
114,32,111,102,32,105,100,108,101,32,99,111,110,110,101,99,116,105,111, |
| 76 |
|
110,115,32,114,101,97,100,32,101,118,101,110,116,115,34,44,34,102,111, |
| 77 |
|
114,109,97,116,34,58,34,105,110,116,101,103,101,114,34,44,34,105,110, |
| 78 |
|
100,101,120,34,58,50,52,44,34,110,97,109,101,34,58,34,97,99,116,105, |
| 79 |
|
111,110,34,44,34,100,111,99,115,34,58,34,92,116,78,117,109,98,101,114, |
| 80 |
|
32,111,102,32,105,100,108,101,32,99,111,110,110,101,99,116,105,111,110, |
| 81 |
|
115,32,116,104,97,116,32,101,120,112,101,114,105,101,110,99,101,100, |
| 82 |
|
32,97,32,114,101,97,100,32,101,118,101,110,116,32,119,104,105,108,101, |
| 83 |
|
32,98,101,105,110,103,92,110,92,116,119,97,105,116,101,100,32,102,111, |
| 84 |
|
114,46,34,125,125,125,0 |
| 85 |
|
}; |
| 86 |
|
|
| 87 |
|
// { |
| 88 |
|
// "version": "1", |
| 89 |
|
// "name": "waiter", |
| 90 |
|
// "oneliner": "Waiter counters", |
| 91 |
|
// "order": 80, |
| 92 |
|
// "docs": "", |
| 93 |
|
// "elements": 4, |
| 94 |
|
// "elem": { |
| 95 |
|
// "conns": { |
| 96 |
|
// "type": "gauge", |
| 97 |
|
// "ctype": "uint64_t", |
| 98 |
|
// "level": "debug", |
| 99 |
|
// "oneliner": "Number of idle connections", |
| 100 |
|
// "format": "integer", |
| 101 |
|
// "index": 0, |
| 102 |
|
// "name": "conns", |
| 103 |
|
// "docs": "\tNumber of idle connections being waited over." |
| 104 |
|
// }, |
| 105 |
|
// "remclose": { |
| 106 |
|
// "type": "counter", |
| 107 |
|
// "ctype": "uint64_t", |
| 108 |
|
// "level": "debug", |
| 109 |
|
// "oneliner": "Number of idle connections closed by peer", |
| 110 |
|
// "format": "integer", |
| 111 |
|
// "index": 8, |
| 112 |
|
// "name": "remclose", |
| 113 |
|
// "docs": "\tNumber of idle connections that experienced closure [...] |
| 114 |
|
// }, |
| 115 |
|
// "timeout": { |
| 116 |
|
// "type": "counter", |
| 117 |
|
// "ctype": "uint64_t", |
| 118 |
|
// "level": "debug", |
| 119 |
|
// "oneliner": "Number of idle connections timeout", |
| 120 |
|
// "format": "integer", |
| 121 |
|
// "index": 16, |
| 122 |
|
// "name": "timeout", |
| 123 |
|
// "docs": "\tNumber of idle connections that experienced a timeou[...] |
| 124 |
|
// }, |
| 125 |
|
// "action": { |
| 126 |
|
// "type": "counter", |
| 127 |
|
// "ctype": "uint64_t", |
| 128 |
|
// "level": "debug", |
| 129 |
|
// "oneliner": "Number of idle connections read events", |
| 130 |
|
// "format": "integer", |
| 131 |
|
// "index": 24, |
| 132 |
|
// "name": "action", |
| 133 |
|
// "docs": "\tNumber of idle connections that experienced a read e[...] |
| 134 |
|
// } |
| 135 |
|
// } |
| 136 |
|
// } |
| 137 |
|
|
| 138 |
|
|
| 139 |
|
struct VSC_waiter* |
| 140 |
|
VSC_waiter_New(struct vsmw_cluster *vc, |
| 141 |
|
struct vsc_seg **sg, const char *fmt, ...) |
| 142 |
2038 |
{ |
| 143 |
2038 |
va_list ap; |
| 144 |
2038 |
struct VSC_waiter *retval; |
| 145 |
|
|
| 146 |
2038 |
va_start(ap, fmt); |
| 147 |
2038 |
retval = VRT_VSC_Allocv(vc, sg, vsc_waiter_name, VSC_waiter_size, |
| 148 |
2038 |
vsc_waiter_json, sizeof vsc_waiter_json, fmt, ap); |
| 149 |
2038 |
va_end(ap); |
| 150 |
2038 |
return(retval); |
| 151 |
2038 |
} |
| 152 |
|
|
| 153 |
|
void |
| 154 |
|
VSC_waiter_Destroy(struct vsc_seg **sg) |
| 155 |
0 |
{ |
| 156 |
0 |
struct vsc_seg *p; |
| 157 |
|
|
| 158 |
0 |
AN(sg); |
| 159 |
0 |
p = *sg; |
| 160 |
|
*sg = NULL; |
| 161 |
0 |
VRT_VSC_Destroy(vsc_waiter_name, p); |
| 162 |
0 |
} |