38 #ifndef CENSUS_CENSUS_H
39 #define CENSUS_CENSUS_H
236 const char *buffer,
gpr_int64 rpc_name_id,
266 const char *name,
int trace_mask);
279 #define CENSUS_TRACE_RECORD_START_OP ((gpr_uint32)0)
280 #define CENSUS_TRACE_RECORD_END_OP ((gpr_uint32)1)
290 const char *buffer,
size_t n);
328 #define CENSUS_MAX_TAG_KEY_LENGTH 20
330 #define CENSUS_MAX_TAG_VALUE_LENGTH 50
445 size_t naggregations);
const census_tag_set * tags
Definition: census.h:465
census_aggregation_ops census_agg_histogram
const census_view_data * census_view_get_data(const census_view *view)
Get data from aggregations associated with a view.
void census_tag_set_destroy(census_tag_set *tags)
int census_get_trace_record(census_trace_record *trace_record)
Get a trace record.
census_tag_set * census_tag_set_create(size_t size_hint)
size_t census_view_naggregations(const census_view *view)
Number of aggregations associated with view.
size_t census_view_metric(const census_view *view)
Metric ID associated with a view.
struct census_aggregation_ops census_aggregation_ops
Type representing a particular aggregation.
Definition: census.h:415
double value
Definition: census.h:407
struct census_view census_view
A census view type.
Definition: census.h:432
Holds all the aggregation data for a particular view instantiation.
Definition: census.h:464
const void ** data
Definition: census.h:466
const census_view_aggregation_data * data
Definition: census.h:472
census_context * census_start_op(census_context *context, const char *family, const char *name, int trace_mask)
Start a new, non-RPC operation.
census_tag_set_iterator * census_tag_set_open(census_tag_set *tags)
void census_trace_scan_end()
End a scan previously started by census_trace_scan_start()
Information needed to instantiate a new aggregation.
Definition: census.h:425
int census_tag_set_add(census_tag_set *tags, const char *key, const char *value)
int census_initialize(int features)
Shutdown and startup census subsystem.
Trace record.
Definition: census.h:293
census_trace_mask_values
Definition: census.h:97
census_timestamp census_start_rpc_op_timestamp(void)
Mark the beginning of an RPC operation.
Represent functions to map RPC name ID to service/method names.
Definition: census.h:168
void census_trace_print(census_context *context, gpr_uint32 type, const char *buffer, size_t n)
Insert a trace record into the trace stream.
void census_shutdown(void)
const census_aggregation_ops * ops
Definition: census.h:426
census_context * census_start_server_rpc_op(const char *buffer, gpr_int64 rpc_name_id, const census_rpc_name_info *rpc_name_info, const char *peer, int trace_mask, census_timestamp *start_time)
Start a server RPC operation.
int census_trace_scan_start(int consume)
Start a scan of existing trace records.
void census_set_trace_mask(int trace_mask)
Set the trace mask associated with a context.
void census_tag_set_close(census_tag_set_iterator *it)
int census_tag_set_next(census_tag_set_iterator *it, census_tag_const *tag)
void census_view_delete(census_view *view)
Destroy a previously created view.
int census_trace_mask(const census_context *context)
Get the current trace mask associated with this context.
census_view * census_view_create(gpr_uint32 metric_id, const census_tag_set *tags, const census_aggregation *aggregations, size_t naggregations)
Create a new view.
const census_aggregation * census_view_aggregrations(const census_view *view)
Get aggregation descriptors associated with a view.
size_t n_tag_sets
Definition: census.h:471
census_timestamp timestamp
Definition: census.h:294
gpr_timespec ts
Definition: census.h:138
census_aggregation_ops census_agg_distribution
struct census_tag_set census_tag_set
Definition: census.h:335
This structure represents a timestamp as used by census to record the time at which an operation begi...
Definition: census.h:135
const char * key
Definition: census.h:362
int census_supported(void)
Return the features supported by the current census implementation (not all features will be availabl...
census_aggregation_ops census_agg_sum
const census_tag_set * census_view_tags(const census_view *view)
Get tags associated with view.
gpr_uint32 metric_id
Definition: census.h:406
void census_view_reset(census_view *view)
Reset all view data to zero for the specified view.
census_context * census_start_client_rpc_op(const census_context *context, gpr_int64 rpc_name_id, const census_rpc_name_info *rpc_name_info, const char *peer, int trace_mask, const census_timestamp *start_time)
Start a client rpc operation.
census_tag_set * census_context_tag_set(census_context *context)
const char * value
Definition: census.h:364
gpr_uint64 op_id
Definition: census.h:296
Census view data as returned by census_view_get_data().
Definition: census.h:470
census_features
Definition: census.h:48
void census_record_values(census_context *context, census_value *values, size_t nvalues)
void census_end_op(census_context *context, int status)
End an operation started by any of the census_start_*_op*() calls.
struct census_tag_set_iterator census_tag_set_iterator
Definition: census.h:368
const void * create_arg
Definition: census.h:428
void census_set_rpc_client_peer(census_context *context, const char *peer)
Add peer information to a context representing a client RPC operation.
int census_enabled(void)
Return the census features currently enabled.
size_t value_len
Definition: census.h:363
const char * buffer
Definition: census.h:298
size_t buf_size
Definition: census.h:299
size_t key_len
Definition: census.h:361
census_aggregation_ops census_agg_window
size_t census_context_serialize(const census_context *context, char *buffer, size_t buf_size)
gpr_uint64 trace_id
Definition: census.h:295
struct census_context census_context
Context is a handle used by census to represent the current tracing and tagging information.
Definition: census.h:80
gpr_uint32 type
Definition: census.h:297