diff options
author | Craig Tiller <ctiller@google.com> | 2016-03-29 09:41:28 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-03-29 09:41:28 -0700 |
commit | 8f8e9f9b53dee850c5ec7769df926fd6cad2a62e (patch) | |
tree | be2c48d3b42a1f88d4141c9d86ff9441aad9f224 /src/core | |
parent | 3113ef48ab8ae6e8c879cfb15ef0ccfe9a7cc824 (diff) |
Build Census as a grpc plugin
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/ext/census/README.md (renamed from src/core/lib/census/README.md) | 0 | ||||
-rw-r--r-- | src/core/ext/census/aggregation.h (renamed from src/core/lib/census/aggregation.h) | 0 | ||||
-rw-r--r-- | src/core/ext/census/census_init.c (renamed from src/core/lib/statistics/census_init.c) | 6 | ||||
-rw-r--r-- | src/core/ext/census/census_interface.h (renamed from src/core/lib/statistics/census_interface.h) | 0 | ||||
-rw-r--r-- | src/core/ext/census/census_log.c (renamed from src/core/lib/statistics/census_log.c) | 2 | ||||
-rw-r--r-- | src/core/ext/census/census_log.h (renamed from src/core/lib/statistics/census_log.h) | 0 | ||||
-rw-r--r-- | src/core/ext/census/census_rpc_stats.c (renamed from src/core/lib/statistics/census_rpc_stats.c) | 10 | ||||
-rw-r--r-- | src/core/ext/census/census_rpc_stats.h (renamed from src/core/lib/statistics/census_rpc_stats.h) | 2 | ||||
-rw-r--r-- | src/core/ext/census/census_tracing.c (renamed from src/core/lib/statistics/census_tracing.c) | 6 | ||||
-rw-r--r-- | src/core/ext/census/census_tracing.h (renamed from src/core/lib/statistics/census_tracing.h) | 2 | ||||
-rw-r--r-- | src/core/ext/census/context.c (renamed from src/core/lib/census/context.c) | 0 | ||||
-rw-r--r-- | src/core/ext/census/grpc_context.c (renamed from src/core/lib/census/grpc_context.c) | 0 | ||||
-rw-r--r-- | src/core/ext/census/grpc_filter.c (renamed from src/core/lib/census/grpc_filter.c) | 6 | ||||
-rw-r--r-- | src/core/ext/census/grpc_filter.h (renamed from src/core/lib/census/grpc_filter.h) | 0 | ||||
-rw-r--r-- | src/core/ext/census/grpc_plugin.c (renamed from src/core/lib/census/grpc_plugin.c) | 6 | ||||
-rw-r--r-- | src/core/ext/census/hash_table.c (renamed from src/core/lib/statistics/hash_table.c) | 2 | ||||
-rw-r--r-- | src/core/ext/census/hash_table.h (renamed from src/core/lib/statistics/hash_table.h) | 0 | ||||
-rw-r--r-- | src/core/ext/census/initialize.c (renamed from src/core/lib/census/initialize.c) | 0 | ||||
-rw-r--r-- | src/core/ext/census/mlog.c (renamed from src/core/lib/census/mlog.c) | 2 | ||||
-rw-r--r-- | src/core/ext/census/mlog.h (renamed from src/core/lib/census/mlog.h) | 0 | ||||
-rw-r--r-- | src/core/ext/census/operation.c (renamed from src/core/lib/census/operation.c) | 0 | ||||
-rw-r--r-- | src/core/ext/census/placeholders.c (renamed from src/core/lib/census/placeholders.c) | 0 | ||||
-rw-r--r-- | src/core/ext/census/rpc_metric_id.h (renamed from src/core/lib/census/rpc_metric_id.h) | 0 | ||||
-rw-r--r-- | src/core/ext/census/tracing.c (renamed from src/core/lib/census/tracing.c) | 0 | ||||
-rw-r--r-- | src/core/ext/census/window_stats.c (renamed from src/core/lib/statistics/window_stats.c) | 2 | ||||
-rw-r--r-- | src/core/ext/census/window_stats.h (renamed from src/core/lib/statistics/window_stats.h) | 0 | ||||
-rw-r--r-- | src/core/ext/transport/chttp2/client/insecure/channel_create.c | 2 | ||||
-rw-r--r-- | src/core/lib/census/grpc_plugin.h | 40 | ||||
-rw-r--r-- | src/core/lib/surface/init.c | 4 | ||||
-rw-r--r-- | src/core/plugin_registry/grpc_plugin_registry.c | 4 | ||||
-rw-r--r-- | src/core/plugin_registry/grpc_unsecure_plugin_registry.c | 4 |
31 files changed, 31 insertions, 69 deletions
diff --git a/src/core/lib/census/README.md b/src/core/ext/census/README.md index fb615a2194..fb615a2194 100644 --- a/src/core/lib/census/README.md +++ b/src/core/ext/census/README.md diff --git a/src/core/lib/census/aggregation.h b/src/core/ext/census/aggregation.h index f353368b97..f353368b97 100644 --- a/src/core/lib/census/aggregation.h +++ b/src/core/ext/census/aggregation.h diff --git a/src/core/lib/statistics/census_init.c b/src/core/ext/census/census_init.c index bbecd62764..40bca0511c 100644 --- a/src/core/lib/statistics/census_init.c +++ b/src/core/ext/census/census_init.c @@ -31,11 +31,11 @@ * */ -#include "src/core/lib/statistics/census_interface.h" +#include "src/core/ext/census/census_interface.h" #include <grpc/support/log.h> -#include "src/core/lib/statistics/census_rpc_stats.h" -#include "src/core/lib/statistics/census_tracing.h" +#include "src/core/ext/census/census_rpc_stats.h" +#include "src/core/ext/census/census_tracing.h" void census_init(void) { census_tracing_init(); diff --git a/src/core/lib/statistics/census_interface.h b/src/core/ext/census/census_interface.h index b3b3439072..b3b3439072 100644 --- a/src/core/lib/statistics/census_interface.h +++ b/src/core/ext/census/census_interface.h diff --git a/src/core/lib/statistics/census_log.c b/src/core/ext/census/census_log.c index 1fb942a78a..c659f81268 100644 --- a/src/core/lib/statistics/census_log.c +++ b/src/core/ext/census/census_log.c @@ -89,7 +89,7 @@ include the name of the structure, which will be passed as the first argument. E.g. cl_block_initialize() will initialize a cl_block. */ -#include "src/core/lib/statistics/census_log.h" +#include "src/core/ext/census/census_log.h" #include <grpc/support/alloc.h> #include <grpc/support/atm.h> #include <grpc/support/cpu.h> diff --git a/src/core/lib/statistics/census_log.h b/src/core/ext/census/census_log.h index c3fbd555ba..c3fbd555ba 100644 --- a/src/core/lib/statistics/census_log.h +++ b/src/core/ext/census/census_log.h diff --git a/src/core/lib/statistics/census_rpc_stats.c b/src/core/ext/census/census_rpc_stats.c index 2182561668..200c3385b0 100644 --- a/src/core/lib/statistics/census_rpc_stats.c +++ b/src/core/ext/census/census_rpc_stats.c @@ -36,11 +36,11 @@ #include <grpc/support/alloc.h> #include <grpc/support/log.h> #include <grpc/support/sync.h> -#include "src/core/lib/statistics/census_interface.h" -#include "src/core/lib/statistics/census_rpc_stats.h" -#include "src/core/lib/statistics/census_tracing.h" -#include "src/core/lib/statistics/hash_table.h" -#include "src/core/lib/statistics/window_stats.h" +#include "src/core/ext/census/census_interface.h" +#include "src/core/ext/census/census_rpc_stats.h" +#include "src/core/ext/census/census_tracing.h" +#include "src/core/ext/census/hash_table.h" +#include "src/core/ext/census/window_stats.h" #include "src/core/lib/support/murmur_hash.h" #include "src/core/lib/support/string.h" diff --git a/src/core/lib/statistics/census_rpc_stats.h b/src/core/ext/census/census_rpc_stats.h index 00bb48205e..ef8573047f 100644 --- a/src/core/lib/statistics/census_rpc_stats.h +++ b/src/core/ext/census/census_rpc_stats.h @@ -35,7 +35,7 @@ #define GRPC_CORE_LIB_STATISTICS_CENSUS_RPC_STATS_H #include <grpc/support/port_platform.h> -#include "src/core/lib/statistics/census_interface.h" +#include "src/core/ext/census/census_interface.h" #ifdef __cplusplus extern "C" { diff --git a/src/core/lib/statistics/census_tracing.c b/src/core/ext/census/census_tracing.c index b58ae733fc..601e2a0d35 100644 --- a/src/core/lib/statistics/census_tracing.c +++ b/src/core/ext/census/census_tracing.c @@ -31,8 +31,8 @@ * */ -#include "src/core/lib/statistics/census_tracing.h" -#include "src/core/lib/statistics/census_interface.h" +#include "src/core/ext/census/census_tracing.h" +#include "src/core/ext/census/census_interface.h" #include <stdio.h> #include <string.h> @@ -41,7 +41,7 @@ #include <grpc/support/log.h> #include <grpc/support/port_platform.h> #include <grpc/support/sync.h> -#include "src/core/lib/statistics/hash_table.h" +#include "src/core/ext/census/hash_table.h" #include "src/core/lib/support/string.h" void census_trace_obj_destroy(census_trace_obj *obj) { diff --git a/src/core/lib/statistics/census_tracing.h b/src/core/ext/census/census_tracing.h index a101abf3cb..a9a7e4485b 100644 --- a/src/core/lib/statistics/census_tracing.h +++ b/src/core/ext/census/census_tracing.h @@ -35,7 +35,7 @@ #define GRPC_CORE_LIB_STATISTICS_CENSUS_TRACING_H #include <grpc/support/time.h> -#include "src/core/lib/statistics/census_rpc_stats.h" +#include "src/core/ext/census/census_rpc_stats.h" /* WARNING: The data structures and APIs provided by this file are for GRPC library's internal use ONLY. They might be changed in backward-incompatible diff --git a/src/core/lib/census/context.c b/src/core/ext/census/context.c index 5a118f46a9..5a118f46a9 100644 --- a/src/core/lib/census/context.c +++ b/src/core/ext/census/context.c diff --git a/src/core/lib/census/grpc_context.c b/src/core/ext/census/grpc_context.c index 457c176355..457c176355 100644 --- a/src/core/lib/census/grpc_context.c +++ b/src/core/ext/census/grpc_context.c diff --git a/src/core/lib/census/grpc_filter.c b/src/core/ext/census/grpc_filter.c index d27d789aa1..cc997dc79c 100644 --- a/src/core/lib/census/grpc_filter.c +++ b/src/core/ext/census/grpc_filter.c @@ -31,7 +31,7 @@ * */ -#include "src/core/lib/census/grpc_filter.h" +#include "src/core/ext/census/grpc_filter.h" #include <stdio.h> #include <string.h> @@ -43,8 +43,8 @@ #include <grpc/support/time.h> #include "src/core/lib/channel/channel_stack.h" -#include "src/core/lib/statistics/census_interface.h" -#include "src/core/lib/statistics/census_rpc_stats.h" +#include "src/core/ext/census/census_interface.h" +#include "src/core/ext/census/census_rpc_stats.h" #include "src/core/lib/transport/static_metadata.h" typedef struct call_data { diff --git a/src/core/lib/census/grpc_filter.h b/src/core/ext/census/grpc_filter.h index 7ceafe56e4..7ceafe56e4 100644 --- a/src/core/lib/census/grpc_filter.h +++ b/src/core/ext/census/grpc_filter.h diff --git a/src/core/lib/census/grpc_plugin.c b/src/core/ext/census/grpc_plugin.c index 12aca76745..4de441a4d1 100644 --- a/src/core/lib/census/grpc_plugin.c +++ b/src/core/ext/census/grpc_plugin.c @@ -31,13 +31,11 @@ * */ -#include "src/core/lib/census/grpc_plugin.h" - #include <limits.h> #include <grpc/census.h> -#include "src/core/lib/census/grpc_filter.h" +#include "src/core/ext/census/grpc_filter.h" #include "src/core/lib/channel/channel_stack_builder.h" #include "src/core/lib/surface/channel_init.h" @@ -67,4 +65,4 @@ void census_grpc_plugin_init(void) { maybe_add_census_filter, NULL); } -void census_grpc_plugin_destroy(void) { census_shutdown(); } +void census_grpc_plugin_shutdown(void) { census_shutdown(); } diff --git a/src/core/lib/statistics/hash_table.c b/src/core/ext/census/hash_table.c index 18b7442a0c..3ceddf7fc3 100644 --- a/src/core/lib/statistics/hash_table.c +++ b/src/core/ext/census/hash_table.c @@ -31,7 +31,7 @@ * */ -#include "src/core/lib/statistics/hash_table.h" +#include "src/core/ext/census/hash_table.h" #include <stddef.h> #include <stdio.h> diff --git a/src/core/lib/statistics/hash_table.h b/src/core/ext/census/hash_table.h index 8f74ec82aa..8f74ec82aa 100644 --- a/src/core/lib/statistics/hash_table.h +++ b/src/core/ext/census/hash_table.h diff --git a/src/core/lib/census/initialize.c b/src/core/ext/census/initialize.c index ce7ec09b89..ce7ec09b89 100644 --- a/src/core/lib/census/initialize.c +++ b/src/core/ext/census/initialize.c diff --git a/src/core/lib/census/mlog.c b/src/core/ext/census/mlog.c index 9d47e80297..bcc1aba8be 100644 --- a/src/core/lib/census/mlog.c +++ b/src/core/ext/census/mlog.c @@ -88,7 +88,7 @@ // include the name of the structure, which will be passed as the first // argument. E.g. cl_block_initialize() will initialize a cl_block. -#include "src/core/lib/census/mlog.h" +#include "src/core/ext/census/mlog.h" #include <grpc/support/alloc.h> #include <grpc/support/atm.h> #include <grpc/support/cpu.h> diff --git a/src/core/lib/census/mlog.h b/src/core/ext/census/mlog.h index 7fbdeda986..7fbdeda986 100644 --- a/src/core/lib/census/mlog.h +++ b/src/core/ext/census/mlog.h diff --git a/src/core/lib/census/operation.c b/src/core/ext/census/operation.c index 315f9c3534..315f9c3534 100644 --- a/src/core/lib/census/operation.c +++ b/src/core/ext/census/operation.c diff --git a/src/core/lib/census/placeholders.c b/src/core/ext/census/placeholders.c index fe23d13971..fe23d13971 100644 --- a/src/core/lib/census/placeholders.c +++ b/src/core/ext/census/placeholders.c diff --git a/src/core/lib/census/rpc_metric_id.h b/src/core/ext/census/rpc_metric_id.h index aad0588fb3..aad0588fb3 100644 --- a/src/core/lib/census/rpc_metric_id.h +++ b/src/core/ext/census/rpc_metric_id.h diff --git a/src/core/lib/census/tracing.c b/src/core/ext/census/tracing.c index e508996af3..e508996af3 100644 --- a/src/core/lib/census/tracing.c +++ b/src/core/ext/census/tracing.c diff --git a/src/core/lib/statistics/window_stats.c b/src/core/ext/census/window_stats.c index 53427a24bc..49cdc183f7 100644 --- a/src/core/lib/statistics/window_stats.c +++ b/src/core/ext/census/window_stats.c @@ -31,7 +31,7 @@ * */ -#include "src/core/lib/statistics/window_stats.h" +#include "src/core/ext/census/window_stats.h" #include <grpc/support/alloc.h> #include <grpc/support/log.h> #include <grpc/support/time.h> diff --git a/src/core/lib/statistics/window_stats.h b/src/core/ext/census/window_stats.h index 8dec50d620..8dec50d620 100644 --- a/src/core/lib/statistics/window_stats.h +++ b/src/core/ext/census/window_stats.h diff --git a/src/core/ext/transport/chttp2/client/insecure/channel_create.c b/src/core/ext/transport/chttp2/client/insecure/channel_create.c index cf987a02e0..1102a74949 100644 --- a/src/core/ext/transport/chttp2/client/insecure/channel_create.c +++ b/src/core/ext/transport/chttp2/client/insecure/channel_create.c @@ -41,7 +41,7 @@ #include <grpc/support/slice_buffer.h> #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" -#include "src/core/lib/census/grpc_filter.h" +#include "src/core/ext/census/grpc_filter.h" #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/client_channel.h" #include "src/core/lib/channel/compress_filter.h" diff --git a/src/core/lib/census/grpc_plugin.h b/src/core/lib/census/grpc_plugin.h deleted file mode 100644 index 33e5f0b701..0000000000 --- a/src/core/lib/census/grpc_plugin.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * Copyright 2015-2016, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef GRPC_CORE_LIB_CENSUS_GRPC_PLUGIN_H -#define GRPC_CORE_LIB_CENSUS_GRPC_PLUGIN_H - -void census_grpc_plugin_init(void); -void census_grpc_plugin_destroy(void); - -#endif /* GRPC_CORE_LIB_CENSUS_GRPC_PLUGIN_H */ diff --git a/src/core/lib/surface/init.c b/src/core/lib/surface/init.c index d59323b2bc..432c7590b2 100644 --- a/src/core/lib/surface/init.c +++ b/src/core/lib/surface/init.c @@ -39,9 +39,7 @@ #include <grpc/grpc.h> #include <grpc/support/alloc.h> #include <grpc/support/time.h> -/* TODO(ctiller): find another way? - better not to include census here */ #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" -#include "src/core/lib/census/grpc_plugin.h" #include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/channel/client_channel.h" #include "src/core/lib/channel/compress_filter.h" @@ -85,8 +83,6 @@ static int g_initializations; static void do_basic_init(void) { gpr_mu_init(&g_init_mu); grpc_register_built_in_plugins(); - /* TODO(ctiller): ideally remove this strict linkage */ - grpc_register_plugin(census_grpc_plugin_init, census_grpc_plugin_destroy); g_initializations = 0; } diff --git a/src/core/plugin_registry/grpc_plugin_registry.c b/src/core/plugin_registry/grpc_plugin_registry.c index 3e3c214c22..422d3c92b8 100644 --- a/src/core/plugin_registry/grpc_plugin_registry.c +++ b/src/core/plugin_registry/grpc_plugin_registry.c @@ -37,10 +37,14 @@ extern void grpc_lb_policy_pick_first_init(void); extern void grpc_lb_policy_pick_first_shutdown(void); extern void grpc_lb_policy_round_robin_init(void); extern void grpc_lb_policy_round_robin_shutdown(void); +extern void census_grpc_plugin_init(void); +extern void census_grpc_plugin_shutdown(void); void grpc_register_built_in_plugins(void) { grpc_register_plugin(grpc_lb_policy_pick_first_init, grpc_lb_policy_pick_first_shutdown); grpc_register_plugin(grpc_lb_policy_round_robin_init, grpc_lb_policy_round_robin_shutdown); + grpc_register_plugin(census_grpc_plugin_init, + census_grpc_plugin_shutdown); } diff --git a/src/core/plugin_registry/grpc_unsecure_plugin_registry.c b/src/core/plugin_registry/grpc_unsecure_plugin_registry.c index 3e3c214c22..422d3c92b8 100644 --- a/src/core/plugin_registry/grpc_unsecure_plugin_registry.c +++ b/src/core/plugin_registry/grpc_unsecure_plugin_registry.c @@ -37,10 +37,14 @@ extern void grpc_lb_policy_pick_first_init(void); extern void grpc_lb_policy_pick_first_shutdown(void); extern void grpc_lb_policy_round_robin_init(void); extern void grpc_lb_policy_round_robin_shutdown(void); +extern void census_grpc_plugin_init(void); +extern void census_grpc_plugin_shutdown(void); void grpc_register_built_in_plugins(void) { grpc_register_plugin(grpc_lb_policy_pick_first_init, grpc_lb_policy_pick_first_shutdown); grpc_register_plugin(grpc_lb_policy_round_robin_init, grpc_lb_policy_round_robin_shutdown); + grpc_register_plugin(census_grpc_plugin_init, + census_grpc_plugin_shutdown); } |