initial minimal stack configurator sketch

reviewable/pr10449/r1
Craig Tiller 8 years ago
parent 9c54a0c12c
commit c7527415e0
  1. 3
      include/grpc/impl/codegen/grpc_types.h
  2. 2
      src/core/ext/census/grpc_plugin.c
  3. 7
      src/core/lib/channel/channel_args.c
  4. 2
      src/core/lib/channel/channel_args.h

@ -152,6 +152,9 @@ typedef struct {
#define GRPC_ARG_ENABLE_CENSUS "grpc.census"
/** If non-zero, enable load reporting. */
#define GRPC_ARG_ENABLE_LOAD_REPORTING "grpc.loadreporting"
/** Request that optional features default to off (regardless of what they
usually default to) - to enable tight control over what gets enabled */
#define GRPC_ARG_MINIMAL_STACK "grpc.minimal_stack"
/** Maximum number of concurrent incoming streams to allow on a http2
connection. Int valued. */
#define GRPC_ARG_MAX_CONCURRENT_STREAMS "grpc.max_concurrent_streams"

@ -48,7 +48,7 @@ static bool is_census_enabled(const grpc_channel_args *a) {
return a->args[i].value.integer != 0 && census_enabled();
}
}
return census_enabled();
return census_enabled() && !grpc_channel_args_want_minimal_stack(a);
}
static bool maybe_add_census_filter(grpc_exec_ctx *exec_ctx,

@ -346,3 +346,10 @@ int grpc_channel_arg_get_integer(grpc_arg *arg, grpc_integer_options options) {
}
return arg->value.integer;
}
bool grpc_channel_args_want_minimal_stack(const grpc_channel_args *args) {
const grpc_arg *arg = grpc_channel_args_find(args, GRPC_ARG_MINIMAL_STACK);
if (arg == NULL) return false;
if (arg->type == GRPC_ARG_INTEGER && arg->value.integer == 0) return false;
return true;
}

@ -113,6 +113,8 @@ grpc_channel_args *grpc_channel_args_set_socket_mutator(
const grpc_arg *grpc_channel_args_find(const grpc_channel_args *args,
const char *name);
bool grpc_channel_args_want_minimal_stack(const grpc_channel_args *args);
typedef struct grpc_integer_options {
int default_value; // Return this if value is outside of expected bounds.
int min_value;

Loading…
Cancel
Save