change aggregation_ops to internal type

pull/3107/head
Alistair Veitch 10 years ago
parent aafe9725b0
commit 1c09accaad
  1. 3
      BUILD
  2. 1
      build.json
  3. 2
      gRPC.podspec
  4. 32
      include/grpc/census.h
  5. 66
      src/core/census/aggregation.h
  6. 1
      tools/doxygen/Doxyfile.core.internal
  7. 4
      tools/run_tests/sources_and_headers.json
  8. 1
      vsprojects/grpc/grpc.vcxproj
  9. 3
      vsprojects/grpc/grpc.vcxproj.filters
  10. 1
      vsprojects/grpc_unsecure/grpc_unsecure.vcxproj
  11. 3
      vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters

@ -245,6 +245,7 @@ cc_library(
"src/core/transport/stream_op.h",
"src/core/transport/transport.h",
"src/core/transport/transport_impl.h",
"src/core/census/aggregation.h",
"src/core/census/context.h",
"src/core/census/rpc_metric_id.h",
"src/core/httpcli/httpcli_security_connector.c",
@ -514,6 +515,7 @@ cc_library(
"src/core/transport/stream_op.h",
"src/core/transport/transport.h",
"src/core/transport/transport_impl.h",
"src/core/census/aggregation.h",
"src/core/census/context.h",
"src/core/census/rpc_metric_id.h",
"src/core/surface/init_unsecure.c",
@ -1271,6 +1273,7 @@ objc_library(
"src/core/transport/stream_op.h",
"src/core/transport/transport.h",
"src/core/transport/transport_impl.h",
"src/core/census/aggregation.h",
"src/core/census/context.h",
"src/core/census/rpc_metric_id.h",
],

@ -18,6 +18,7 @@
"include/grpc/census.h"
],
"headers": [
"src/core/census/aggregation.h",
"src/core/census/context.h",
"src/core/census/rpc_metric_id.h"
],

@ -247,6 +247,7 @@ Pod::Spec.new do |s|
'src/core/transport/stream_op.h',
'src/core/transport/transport.h',
'src/core/transport/transport_impl.h',
'src/core/census/aggregation.h',
'src/core/census/context.h',
'src/core/census/rpc_metric_id.h',
'grpc/grpc_security.h',
@ -520,6 +521,7 @@ Pod::Spec.new do |s|
'src/core/transport/stream_op.h',
'src/core/transport/transport.h',
'src/core/transport/transport_impl.h',
'src/core/census/aggregation.h',
'src/core/census/context.h',
'src/core/census/rpc_metric_id.h'

@ -411,34 +411,10 @@ typedef struct {
void census_record_values(census_context *context, census_value *values,
size_t nvalues);
/** Structure used to describe an aggregation type. */
typedef struct {
/* Create a new aggregation. The pointer returned can be used in future calls
to clone(), free(), record(), data() and reset(). */
void *(*create)(const void *create_arg);
/* Make a copy of an aggregation created by create() */
void *(*clone)(const void *aggregation);
/* Destroy an aggregation created by create() */
void (*free)(void *aggregation);
/* Record a new value against aggregation. */
void (*record)(void *aggregation, double value);
/* Return current aggregation data. The caller must cast this object into
the correct type for the aggregation result. The object returned can be
freed by using free_data(). */
void *(*data)(const void *aggregation);
/* free data returned by data() */
void (*free_data)(void *data);
/* Reset an aggregation to default (zero) values. */
void (*reset)(void *aggregation);
/* Merge 'from' aggregation into 'to'. Both aggregations must be compatible */
void (*merge)(void *to, const void *from);
/* Fill buffer with printable string version of aggregation contents. For
debugging only. Returns the number of bytes added to buffer (a value == n
implies the buffer was of insufficient size). */
size_t (*print)(const void *aggregation, char *buffer, size_t n);
} census_aggregation_ops;
/* Predefined aggregation types. */
/** Type representing a particular aggregation */
typedef struct census_aggregation_ops census_aggregation_ops;
/* Predefined aggregation types, for use with census_view_create(). */
extern census_aggregation_ops census_agg_sum;
extern census_aggregation_ops census_agg_distribution;
extern census_aggregation_ops census_agg_histogram;

@ -0,0 +1,66 @@
/*
*
* Copyright 2015, 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.
*
*/
#include <stddef.h>
#ifndef GRPC_INTERNAL_CORE_CENSUS_AGGREGATION_H
#define GRPC_INTERNAL_CORE_CENSUS_AGGREGATION_H
/** Structure used to describe an aggregation type. */
struct census_aggregation_ops {
/* Create a new aggregation. The pointer returned can be used in future calls
to clone(), free(), record(), data() and reset(). */
void *(*create)(const void *create_arg);
/* Make a copy of an aggregation created by create() */
void *(*clone)(const void *aggregation);
/* Destroy an aggregation created by create() */
void (*free)(void *aggregation);
/* Record a new value against aggregation. */
void (*record)(void *aggregation, double value);
/* Return current aggregation data. The caller must cast this object into
the correct type for the aggregation result. The object returned can be
freed by using free_data(). */
void *(*data)(const void *aggregation);
/* free data returned by data() */
void (*free_data)(void *data);
/* Reset an aggregation to default (zero) values. */
void (*reset)(void *aggregation);
/* Merge 'from' aggregation into 'to'. Both aggregations must be compatible */
void (*merge)(void *to, const void *from);
/* Fill buffer with printable string version of aggregation contents. For
debugging only. Returns the number of bytes added to buffer (a value == n
implies the buffer was of insufficient size). */
size_t (*print)(const void *aggregation, char *buffer, size_t n);
};
#endif /* GRPC_INTERNAL_CORE_CENSUS_AGGREGATION_H */

@ -881,6 +881,7 @@ src/core/transport/metadata.h \
src/core/transport/stream_op.h \
src/core/transport/transport.h \
src/core/transport/transport_impl.h \
src/core/census/aggregation.h \
src/core/census/context.h \
src/core/census/rpc_metric_id.h \
src/core/httpcli/httpcli_security_connector.c \

@ -12229,6 +12229,7 @@
"include/grpc/grpc.h",
"include/grpc/grpc_security.h",
"include/grpc/status.h",
"src/core/census/aggregation.h",
"src/core/census/context.h",
"src/core/census/grpc_filter.h",
"src/core/census/rpc_metric_id.h",
@ -12356,6 +12357,7 @@
"include/grpc/grpc.h",
"include/grpc/grpc_security.h",
"include/grpc/status.h",
"src/core/census/aggregation.h",
"src/core/census/context.c",
"src/core/census/context.h",
"src/core/census/grpc_context.c",
@ -12707,6 +12709,7 @@
"include/grpc/compression.h",
"include/grpc/grpc.h",
"include/grpc/status.h",
"src/core/census/aggregation.h",
"src/core/census/context.h",
"src/core/census/grpc_filter.h",
"src/core/census/rpc_metric_id.h",
@ -12820,6 +12823,7 @@
"include/grpc/compression.h",
"include/grpc/grpc.h",
"include/grpc/status.h",
"src/core/census/aggregation.h",
"src/core/census/context.c",
"src/core/census/context.h",
"src/core/census/grpc_context.c",

@ -343,6 +343,7 @@
<ClInclude Include="..\..\src\core\transport\stream_op.h" />
<ClInclude Include="..\..\src\core\transport\transport.h" />
<ClInclude Include="..\..\src\core\transport\transport_impl.h" />
<ClInclude Include="..\..\src\core\census\aggregation.h" />
<ClInclude Include="..\..\src\core\census\context.h" />
<ClInclude Include="..\..\src\core\census\rpc_metric_id.h" />
</ItemGroup>

@ -791,6 +791,9 @@
<ClInclude Include="..\..\src\core\transport\transport_impl.h">
<Filter>src\core\transport</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\census\aggregation.h">
<Filter>src\core\census</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\census\context.h">
<Filter>src\core\census</Filter>
</ClInclude>

@ -326,6 +326,7 @@
<ClInclude Include="..\..\src\core\transport\stream_op.h" />
<ClInclude Include="..\..\src\core\transport\transport.h" />
<ClInclude Include="..\..\src\core\transport\transport_impl.h" />
<ClInclude Include="..\..\src\core\census\aggregation.h" />
<ClInclude Include="..\..\src\core\census\context.h" />
<ClInclude Include="..\..\src\core\census\rpc_metric_id.h" />
</ItemGroup>

@ -689,6 +689,9 @@
<ClInclude Include="..\..\src\core\transport\transport_impl.h">
<Filter>src\core\transport</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\census\aggregation.h">
<Filter>src\core\census</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\census\context.h">
<Filter>src\core\census</Filter>
</ClInclude>

Loading…
Cancel
Save