aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/load_reporting
diff options
context:
space:
mode:
authorGravatar David Garcia Quintas <dgq@google.com>2016-07-26 19:52:13 -0700
committerGravatar David Garcia Quintas <dgq@google.com>2016-07-26 19:52:13 -0700
commitfa30de9b392a29b58bca2065f86b9be8ff8ebaa0 (patch)
tree49c4e41e8ad95a6aa5fd2bdd64d52cb796e22ec3 /src/core/ext/load_reporting
parent824363dc2f521d0712ab7d6bc03f15939ea51aa5 (diff)
removed some bits from invalid LR design
Diffstat (limited to 'src/core/ext/load_reporting')
-rw-r--r--src/core/ext/load_reporting/load_reporting.h2
-rw-r--r--src/core/ext/load_reporting/load_reporting_filter.c33
2 files changed, 14 insertions, 21 deletions
diff --git a/src/core/ext/load_reporting/load_reporting.h b/src/core/ext/load_reporting/load_reporting.h
index c3161bebb7..e37817d8c2 100644
--- a/src/core/ext/load_reporting/load_reporting.h
+++ b/src/core/ext/load_reporting/load_reporting.h
@@ -38,9 +38,11 @@
#include "src/core/lib/channel/channel_stack.h"
/** Metadata key for initial metadata coming from clients */
+/* TODO(dgq): change to the final value TBD */
#define GRPC_LOAD_REPORTING_INITIAL_MD_KEY "load-reporting-initial"
/** Metadata key for trailing metadata from servers */
+/* TODO(dgq): change to the final value TBD */
#define GRPC_LOAD_REPORTING_TRAILING_MD_KEY "load-reporting-trailing"
/** Identifiers for the invocation point of the users LR callback */
diff --git a/src/core/ext/load_reporting/load_reporting_filter.c b/src/core/ext/load_reporting/load_reporting_filter.c
index 65aba2a650..99b560ae27 100644
--- a/src/core/ext/load_reporting/load_reporting_filter.c
+++ b/src/core/ext/load_reporting/load_reporting_filter.c
@@ -43,11 +43,6 @@
#include "src/core/lib/profiling/timers.h"
#include "src/core/lib/transport/static_metadata.h"
-void (*g_load_reporting_fn)(const grpc_load_reporting_call_data *call_data);
-
-/* The function to be defined */
-void load_reporting_fn(const grpc_load_reporting_call_data *call_data) {}
-
typedef struct call_data {
intptr_t id; /**< an id unique to the call */
char *trailing_md_string;
@@ -68,15 +63,6 @@ typedef struct channel_data {
intptr_t id; /**< an id unique to the channel */
} channel_data;
-static void invoke_lr_fn(grpc_load_reporting_call_data *lr_call_data) {
- if (g_load_reporting_fn == NULL) {
- g_load_reporting_fn = load_reporting_fn;
- }
- GPR_TIMER_BEGIN("load_reporting_fn", 0);
- g_load_reporting_fn(lr_call_data);
- GPR_TIMER_END("load_reporting_fn", 0);
-}
-
typedef struct {
grpc_call_element *elem;
grpc_exec_ctx *exec_ctx;
@@ -91,6 +77,7 @@ static grpc_mdelem *recv_md_filter(void *user_data, grpc_mdelem *md) {
calld->service_method = grpc_mdstr_as_c_string(md->value);
} else if (md->key == GRPC_MDSTR_LOAD_REPORTING_INITIAL) {
calld->initial_md_string = gpr_strdup(grpc_mdstr_as_c_string(md->value));
+ return NULL;
}
return md;
@@ -122,13 +109,14 @@ static void on_initial_md_ready(grpc_exec_ctx *exec_ctx, void *user_data,
/* Constructor for call_data */
static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
grpc_call_element_args *args) {
- channel_data *chand = elem->channel_data;
call_data *calld = elem->call_data;
memset(calld, 0, sizeof(call_data));
calld->id = (intptr_t)args->call_stack;
grpc_closure_init(&calld->on_initial_md_ready, on_initial_md_ready, elem);
+ /* TODO(dgq): do something with the data
+ channel_data *chand = elem->channel_data;
grpc_load_reporting_call_data lr_call_data = {GRPC_LR_POINT_CALL_CREATION,
(intptr_t)chand->id,
(intptr_t)calld->id,
@@ -136,16 +124,17 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
NULL,
NULL,
NULL};
- invoke_lr_fn(&lr_call_data);
+ */
}
/* Destructor for call_data */
static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
const grpc_call_final_info *final_info,
void *ignored) {
- channel_data *chand = elem->channel_data;
call_data *calld = elem->call_data;
+ /* TODO(dgq): do something with the data
+ channel_data *chand = elem->channel_data;
grpc_load_reporting_call_data lr_call_data = {GRPC_LR_POINT_CALL_DESTRUCTION,
(intptr_t)chand->id,
(intptr_t)calld->id,
@@ -153,8 +142,7 @@ static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
calld->initial_md_string,
calld->trailing_md_string,
calld->service_method};
-
- invoke_lr_fn(&lr_call_data);
+ */
gpr_free(calld->initial_md_string);
gpr_free(calld->trailing_md_string);
@@ -171,6 +159,7 @@ static void init_channel_elem(grpc_exec_ctx *exec_ctx,
chand->id = (intptr_t)args->channel_stack;
+ /* TODO(dgq): do something with the data
grpc_load_reporting_call_data lr_call_data = {GRPC_LR_POINT_CHANNEL_CREATION,
(intptr_t)chand,
0,
@@ -178,12 +167,13 @@ static void init_channel_elem(grpc_exec_ctx *exec_ctx,
NULL,
NULL,
NULL};
- invoke_lr_fn(&lr_call_data);
+ */
}
/* Destructor for channel data */
static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
grpc_channel_element *elem) {
+ /* TODO(dgq): do something with the data
channel_data *chand = elem->channel_data;
grpc_load_reporting_call_data lr_call_data = {
GRPC_LR_POINT_CHANNEL_DESTRUCTION,
@@ -193,7 +183,7 @@ static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
NULL,
NULL,
NULL};
- invoke_lr_fn(&lr_call_data);
+ */
}
static grpc_mdelem *lr_trailing_md_filter(void *user_data, grpc_mdelem *md) {
@@ -202,6 +192,7 @@ static grpc_mdelem *lr_trailing_md_filter(void *user_data, grpc_mdelem *md) {
if (md->key == GRPC_MDSTR_LOAD_REPORTING_TRAILING) {
calld->trailing_md_string = gpr_strdup(grpc_mdstr_as_c_string(md->value));
+ return NULL;
}
return md;