diff options
author | Alistair Veitch <aveitch@google.com> | 2015-07-17 15:13:04 -0700 |
---|---|---|
committer | Alistair Veitch <aveitch@google.com> | 2015-07-17 15:13:04 -0700 |
commit | 4d1589ace07d0080abfc2f40132f4f111f5484d7 (patch) | |
tree | 00367253154ab05b30641345020a728b64257b10 /src/core/census | |
parent | 5a9674c0e7683f60bdd55f938e57dceb0a85a9e8 (diff) |
add record_stat API
Diffstat (limited to 'src/core/census')
-rw-r--r-- | src/core/census/record_stat.c | 38 | ||||
-rw-r--r-- | src/core/census/resource_id.h | 48 |
2 files changed, 86 insertions, 0 deletions
diff --git a/src/core/census/record_stat.c b/src/core/census/record_stat.c new file mode 100644 index 0000000000..7d5a350c49 --- /dev/null +++ b/src/core/census/record_stat.c @@ -0,0 +1,38 @@ +/* + * + * 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 <grpc/census.h> +#include "src/core/census/resource_id.h" + +void census_record_stat(census_context *context, int resource_id, + double value) {} diff --git a/src/core/census/resource_id.h b/src/core/census/resource_id.h new file mode 100644 index 0000000000..89c31df311 --- /dev/null +++ b/src/core/census/resource_id.h @@ -0,0 +1,48 @@ +/* + * + * 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. + * + */ + +#ifndef CENSUS_RESOURCE_ID_H +#define CENSUS_RESOURCE_ID_H + +/* Resource ID's used for census measurements. */ +#define RESOURCE_INVALID 0 /* Make default be invalid. */ +#define RESOURCE_RPC_CLIENT_REQUESTS 1 /* Count of client requests sent. */ +#define RESOURCE_RPC_SERVER_REQUESTS 2 /* Count of server requests sent. */ +#define RESOURCE_RPC_CLIENT_ERRORS 3 /* Client error counts. */ +#define RESOURCE_RPC_SERVER_ERRORS 4 /* Server error counts. */ +#define RESOURCE_RPC_CLIENT_LATENCY 5 /* Client side request latency. */ +#define RESOURCE_RPC_SERVER_LATENCY 6 /* Server side request latency. */ +#define RESOURCE_RPC_CLIENT_CPU 7 /* Client CPU processing time. */ +#define RESOURCE_RPC_SERVER_CPU 8 /* Server CPU processing time. */ + +#endif /* CENSUS_RESOURCE_ID_H */ |