aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/statistics/census_tracing.h
diff options
context:
space:
mode:
authorGravatar Hongyu Chen <hongyu@google.com>2015-02-04 10:36:04 -0800
committerGravatar Hongyu Chen <hongyu@google.com>2015-02-04 10:36:04 -0800
commit1ef06e6285364a16517cb9d7ac8ce6ab6c1d35c4 (patch)
treeb004b6b8f86c1bf159d5ad37ac6354827792e7b6 /src/core/statistics/census_tracing.h
parent484bc53582ee89a5412bab46ddb21d2cb5acabf2 (diff)
V0 implementation of census_get_active_ops().
Diffstat (limited to 'src/core/statistics/census_tracing.h')
-rw-r--r--src/core/statistics/census_tracing.h33
1 files changed, 31 insertions, 2 deletions
diff --git a/src/core/statistics/census_tracing.h b/src/core/statistics/census_tracing.h
index f356c9424d..58333f7f6b 100644
--- a/src/core/statistics/census_tracing.h
+++ b/src/core/statistics/census_tracing.h
@@ -34,12 +34,35 @@
#ifndef __GRPC_INTERNAL_STATISTICS_CENSUS_TRACING_H_
#define __GRPC_INTERNAL_STATISTICS_CENSUS_TRACING_H_
+#include <grpc/support/time.h>
+#include "src/core/statistics/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
+ ways and are not subject to any deprecation policy.
+ They are not recommended for external use.
+ */
#ifdef __cplusplus
extern "C" {
#endif
-/* Opaque structure for trace object */
-typedef struct trace_obj trace_obj;
+/* Struct for a trace annotation. */
+typedef struct annotation {
+ gpr_timespec ts; /* timestamp of the annotation */
+ char txt[CENSUS_MAX_ANNOTATION_LENGTH + 1]; /* actual txt annotation */
+ struct annotation* next;
+} annotation;
+
+typedef struct trace_obj {
+ census_op_id id;
+ gpr_timespec ts;
+ census_rpc_stats rpc_stats;
+ char* method;
+ annotation* annotations;
+} trace_obj;
+
+/* Deletes trace object. */
+void trace_obj_destroy(trace_obj* obj);
/* Initializes trace store. This function is thread safe. */
void census_tracing_init(void);
@@ -60,6 +83,12 @@ void census_internal_unlock_trace_store(void);
/* Gets method tag name associated with the input trace object. */
const char* census_get_trace_method_name(const trace_obj* trace);
+/* Returns an array of pointers to trace objects of currently active operations
+ and fills in number of active operations. Returns NULL if there's no active
+ operations.
+ Caller owns the returned objects. */
+trace_obj** census_get_active_ops(int* num_active_ops);
+
#ifdef __cplusplus
}
#endif