-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update twemcache admin * update slimcache * update pingserver
- Loading branch information
Yao Yue
authored
Feb 26, 2017
1 parent
eb1d4b6
commit 23ba44e
Showing
19 changed files
with
76 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
set(SOURCE | ||
format.c | ||
compose.c | ||
parse.c | ||
request.c | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#include "compose.h" | ||
#include "format.h" | ||
#include "parse.h" | ||
#include "process.h" | ||
#include "request.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "format.h" | ||
|
||
#include <cc_print.h> | ||
|
||
size_t | ||
print_stats(char *buf, size_t cap, struct metric *metrics, unsigned int nmetric) | ||
{ | ||
size_t offset = 0; | ||
|
||
/* TODO: report error if running out of space in buf */ | ||
for (int i = 0; i < nmetric; ++i) { | ||
offset += metric_print(buf + offset, cap - offset, METRIC_PRINT_FMT, | ||
&metrics[i]); | ||
} | ||
offset += cc_scnprintf(buf + offset, cap - offset, METRIC_END); | ||
|
||
return offset; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#pragma once | ||
|
||
#include <cc_metric.h> | ||
|
||
#define METRIC_PRINT_FMT "STAT %s %s\r\n" | ||
#define METRIC_PRINT_LEN 64 /* > 5("STAT ") + 32 (name) + 20 (value) + CRLF */ | ||
#define METRIC_DESCRIBE_FMT "%33s %15s %s\r\n" | ||
#define METRIC_DESCRIBE_LEN 120 /* 34 (name) + 16 (type) + 68 (description) + CRLF */ | ||
#define METRIC_END "END\r\n" | ||
#define METRIC_END_LEN (sizeof(METRIC_END) - 1) | ||
|
||
#define VERSION_PRINTED "VERSION " VERSION_STRING "\r\n" | ||
|
||
size_t print_stats(char *buf, size_t cap, struct metric *metrics, unsigned int nmetric); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,4 @@ | ||
#pragma once | ||
|
||
#include <cc_metric.h> | ||
|
||
/* name type description */ | ||
#define ADMIN_PROCESS_METRIC(ACTION) \ | ||
ACTION( stats, METRIC_COUNTER, "# stats requests" )\ | ||
ACTION( stats_ex, METRIC_COUNTER, "# stats errors" )\ | ||
ACTION( version, METRIC_COUNTER, "# version requests" ) | ||
|
||
typedef struct { | ||
ADMIN_PROCESS_METRIC(METRIC_DECLARE) | ||
} admin_process_metrics_st; | ||
|
||
void admin_process_setup(admin_process_metrics_st *metrics); | ||
void admin_process_setup(void); | ||
void admin_process_teardown(void); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,4 @@ | ||
#pragma once | ||
|
||
#include <cc_metric.h> | ||
|
||
/* name type description */ | ||
#define ADMIN_PROCESS_METRIC(ACTION) \ | ||
ACTION( stats, METRIC_COUNTER, "# stats requests" )\ | ||
ACTION( stats_ex, METRIC_COUNTER, "# stats errors" )\ | ||
ACTION( version, METRIC_COUNTER, "# version requests" ) | ||
|
||
typedef struct { | ||
ADMIN_PROCESS_METRIC(METRIC_DECLARE) | ||
} admin_process_metrics_st; | ||
|
||
void admin_process_setup(admin_process_metrics_st *metrics); | ||
void admin_process_setup(void); | ||
void admin_process_teardown(void); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.