diff --git a/BUILD b/BUILD index aa82a9cf4172a0aeed5098764565ae210319b39a..7511320a4ce09e44b7f7a463a2b48d7ffbf08c5e 100644 --- a/BUILD +++ b/BUILD @@ -245,8 +245,9 @@ 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_stat_id.h", + "src/core/census/rpc_metric_id.h", "src/core/httpcli/httpcli_security_connector.c", "src/core/security/base64.c", "src/core/security/client_auth_filter.c", @@ -387,7 +388,6 @@ cc_library( "src/core/census/context.c", "src/core/census/initialize.c", "src/core/census/operation.c", - "src/core/census/record_stat.c", "src/core/census/tracing.c", ], hdrs = [ @@ -515,8 +515,9 @@ 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_stat_id.h", + "src/core/census/rpc_metric_id.h", "src/core/surface/init_unsecure.c", "src/core/census/grpc_context.c", "src/core/census/grpc_filter.c", @@ -637,7 +638,6 @@ cc_library( "src/core/census/context.c", "src/core/census/initialize.c", "src/core/census/operation.c", - "src/core/census/record_stat.c", "src/core/census/tracing.c", ], hdrs = [ @@ -1152,7 +1152,6 @@ objc_library( "src/core/census/context.c", "src/core/census/initialize.c", "src/core/census/operation.c", - "src/core/census/record_stat.c", "src/core/census/tracing.c", ], hdrs = [ @@ -1277,8 +1276,9 @@ 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_stat_id.h", + "src/core/census/rpc_metric_id.h", ], includes = [ "include", diff --git a/Makefile b/Makefile index 9a0f9414ed6ca970bc0468460f0b6b55148fa3a3..b724ee2a7c9c3f4d3da3c17274b71d112ec18df2 100644 --- a/Makefile +++ b/Makefile @@ -4150,7 +4150,6 @@ LIBGRPC_SRC = \ src/core/census/context.c \ src/core/census/initialize.c \ src/core/census/operation.c \ - src/core/census/record_stat.c \ src/core/census/tracing.c \ PUBLIC_HEADERS_C += \ @@ -4426,7 +4425,6 @@ LIBGRPC_UNSECURE_SRC = \ src/core/census/context.c \ src/core/census/initialize.c \ src/core/census/operation.c \ - src/core/census/record_stat.c \ src/core/census/tracing.c \ PUBLIC_HEADERS_C += \ diff --git a/build.yaml b/build.yaml index 8465589bbd4719ce4779b928eff3e6ca190fc22d..183c0ae78fd84bf30ae3ccd4662b5578b9bdedad 100644 --- a/build.yaml +++ b/build.yaml @@ -7,9 +7,9 @@ settings: filegroups: - name: census public_headers: [include/grpc/census.h] - headers: [src/core/census/context.h, src/core/census/rpc_stat_id.h] + headers: [src/core/census/aggregation.h, src/core/census/context.h, src/core/census/rpc_metric_id.h] src: [src/core/census/context.c, src/core/census/initialize.c, src/core/census/operation.c, - src/core/census/record_stat.c, src/core/census/tracing.c] + src/core/census/tracing.c] - name: grpc++_base public_headers: [include/grpc++/channel.h, include/grpc++/client_context.h, include/grpc++/completion_queue.h, include/grpc++/create_channel.h, include/grpc++/generic/async_generic_service.h, diff --git a/examples/README.md b/examples/README.md index 6465115e1858773067d4ec17bf1603f00e1f1507..cc4b239f8e256ba6e71d4352bd1f29c473ebad43 100644 --- a/examples/README.md +++ b/examples/README.md @@ -10,16 +10,16 @@ Hello World example. You'll find more tutorials and reference docs in this repos <a name="quickstart"></a> ## Quick start You can find quick start guides for each language, including installation instructions, examples, and tutorials here: -* [C++](examples/cpp) +* [C++](cpp) * [Java](https://github.com/grpc/grpc-java/tree/master/examples) * [Go](https://github.com/grpc/grpc-go/tree/master/examples) -* [Ruby](examples/ruby) -* [Node.js](examples/node) -* [Android Java](examples/java/android) -* [Python](examples/python/helloworld) -* [C#](examples/csharp) -* [Objective-C](examples/objective-c/route_guide) -* [PHP](examples/php) +* [Ruby](ruby) +* [Node.js](node) +* [Android Java](https://github.com/grpc/grpc-java/tree/master/examples/android) +* [Python](python/helloworld) +* [C#](csharp) +* [Objective-C](objective-c/route_guide) +* [PHP](php) ## What's in this repository? diff --git a/examples/cpp/helloworld/greeter_async_client.cc b/examples/cpp/helloworld/greeter_async_client.cc index 875599e161e6979631d1294d92331179e51a15c8..605fb7fb3aea17f9de21fb8a33a4c99c1c3e533f 100644 --- a/examples/cpp/helloworld/greeter_async_client.cc +++ b/examples/cpp/helloworld/greeter_async_client.cc @@ -41,7 +41,7 @@ #include <grpc++/client_context.h> #include <grpc++/completion_queue.h> #include <grpc++/create_channel.h> -#include <grpc++/credentials.h> +#include <grpc++/security/credentials.h> #include "helloworld.grpc.pb.h" using grpc::Channel; diff --git a/examples/cpp/helloworld/greeter_async_server.cc b/examples/cpp/helloworld/greeter_async_server.cc index b8a0dbf0e2efe2865167262530e536b7e3a1fa31..189c3afe6dcb1c41ba7f8f1542ad1aaedf4ba8d0 100644 --- a/examples/cpp/helloworld/greeter_async_server.cc +++ b/examples/cpp/helloworld/greeter_async_server.cc @@ -39,10 +39,10 @@ #include <grpc/grpc.h> #include <grpc/support/log.h> #include <grpc++/completion_queue.h> +#include <grpc++/security/server_credentials.h> #include <grpc++/server.h> #include <grpc++/server_builder.h> #include <grpc++/server_context.h> -#include <grpc++/server_credentials.h> #include "helloworld.grpc.pb.h" using grpc::Server; diff --git a/examples/cpp/helloworld/greeter_client.cc b/examples/cpp/helloworld/greeter_client.cc index 3d2fcba610696c9730518be365d6c4d3989f5f75..bfb7c12724ff2d78ee1805629420569ba392573c 100644 --- a/examples/cpp/helloworld/greeter_client.cc +++ b/examples/cpp/helloworld/greeter_client.cc @@ -39,7 +39,7 @@ #include <grpc++/channel.h> #include <grpc++/client_context.h> #include <grpc++/create_channel.h> -#include <grpc++/credentials.h> +#include <grpc++/security/credentials.h> #include "helloworld.grpc.pb.h" using grpc::Channel; diff --git a/examples/cpp/helloworld/greeter_server.cc b/examples/cpp/helloworld/greeter_server.cc index c1efdf563c4aa11b5e85cb6e88534f53322cb863..b434752d874fc22f7f973ab9c9381bba8b4856b6 100644 --- a/examples/cpp/helloworld/greeter_server.cc +++ b/examples/cpp/helloworld/greeter_server.cc @@ -36,10 +36,10 @@ #include <string> #include <grpc/grpc.h> +#include <grpc++/security/server_credentials.h> #include <grpc++/server.h> #include <grpc++/server_builder.h> #include <grpc++/server_context.h> -#include <grpc++/server_credentials.h> #include "helloworld.grpc.pb.h" using grpc::Server; diff --git a/examples/cpp/route_guide/helper.cc b/examples/cpp/route_guide/helper.cc index c2415afdf7253562a569ab0bf4016dd89c2b3faf..f76990f6fce41e3941ef2007ee5d6b7d8fe5e019 100644 --- a/examples/cpp/route_guide/helper.cc +++ b/examples/cpp/route_guide/helper.cc @@ -40,7 +40,7 @@ #include <vector> #include "route_guide.grpc.pb.h" -namespace examples { +namespace routeguide { std::string GetDbFileContent(int argc, char** argv) { std::string db_path; @@ -174,5 +174,5 @@ void ParseDb(const std::string& db, std::vector<Feature>* feature_list) { } -} // namespace examples +} // namespace routeguide diff --git a/examples/cpp/route_guide/helper.h b/examples/cpp/route_guide/helper.h index 65c93c1d3477169c7f16893540848f213367211c..db36596f90c6e9254eb4bd533506af6579d895dc 100644 --- a/examples/cpp/route_guide/helper.h +++ b/examples/cpp/route_guide/helper.h @@ -37,14 +37,14 @@ #include <string> #include <vector> -namespace examples { +namespace routeguide { class Feature; std::string GetDbFileContent(int argc, char** argv); void ParseDb(const std::string& db, std::vector<Feature>* feature_list); -} // namespace examples +} // namespace routeguide #endif // GRPC_COMMON_CPP_ROUTE_GUIDE_HELPER_H_ diff --git a/examples/cpp/route_guide/route_guide_client.cc b/examples/cpp/route_guide/route_guide_client.cc index ec0a75e03939ca8fe11f8755e432f30328976a58..85173a393256832369a2ad701eed2e50c80b0a52 100644 --- a/examples/cpp/route_guide/route_guide_client.cc +++ b/examples/cpp/route_guide/route_guide_client.cc @@ -42,7 +42,7 @@ #include <grpc++/channel.h> #include <grpc++/client_context.h> #include <grpc++/create_channel.h> -#include <grpc++/credentials.h> +#include <grpc++/security/credentials.h> #include "helper.h" #include "route_guide.grpc.pb.h" @@ -52,12 +52,12 @@ using grpc::ClientReader; using grpc::ClientReaderWriter; using grpc::ClientWriter; using grpc::Status; -using examples::Point; -using examples::Feature; -using examples::Rectangle; -using examples::RouteSummary; -using examples::RouteNote; -using examples::RouteGuide; +using routeguide::Point; +using routeguide::Feature; +using routeguide::Rectangle; +using routeguide::RouteSummary; +using routeguide::RouteNote; +using routeguide::RouteGuide; Point MakePoint(long latitude, long longitude) { Point p; @@ -86,7 +86,7 @@ class RouteGuideClient { public: RouteGuideClient(std::shared_ptr<Channel> channel, const std::string& db) : stub_(RouteGuide::NewStub(channel)) { - examples::ParseDb(db, &feature_list_); + routeguide::ParseDb(db, &feature_list_); } void GetFeature() { @@ -99,7 +99,7 @@ class RouteGuideClient { } void ListFeatures() { - examples::Rectangle rect; + routeguide::Rectangle rect; Feature feature; ClientContext context; @@ -232,7 +232,7 @@ class RouteGuideClient { int main(int argc, char** argv) { // Expect only arg: --db_path=path/to/route_guide_db.json. - std::string db = examples::GetDbFileContent(argc, argv); + std::string db = routeguide::GetDbFileContent(argc, argv); RouteGuideClient guide( grpc::CreateChannel("localhost:50051", grpc::InsecureCredentials()), db); diff --git a/examples/cpp/route_guide/route_guide_server.cc b/examples/cpp/route_guide/route_guide_server.cc index b37539299a3b3702a5840ad003e7ae7a8e7b11c6..2be57428628e19ce4d0a7ba3646be927063c4eaa 100644 --- a/examples/cpp/route_guide/route_guide_server.cc +++ b/examples/cpp/route_guide/route_guide_server.cc @@ -42,7 +42,7 @@ #include <grpc++/server.h> #include <grpc++/server_builder.h> #include <grpc++/server_context.h> -#include <grpc++/server_credentials.h> +#include <grpc++/security/server_credentials.h> #include "helper.h" #include "route_guide.grpc.pb.h" @@ -53,12 +53,12 @@ using grpc::ServerReader; using grpc::ServerReaderWriter; using grpc::ServerWriter; using grpc::Status; -using examples::Point; -using examples::Feature; -using examples::Rectangle; -using examples::RouteSummary; -using examples::RouteNote; -using examples::RouteGuide; +using routeguide::Point; +using routeguide::Feature; +using routeguide::Rectangle; +using routeguide::RouteSummary; +using routeguide::RouteNote; +using routeguide::RouteGuide; using std::chrono::system_clock; @@ -99,7 +99,7 @@ std::string GetFeatureName(const Point& point, class RouteGuideImpl final : public RouteGuide::Service { public: explicit RouteGuideImpl(const std::string& db) { - examples::ParseDb(db, &feature_list_); + routeguide::ParseDb(db, &feature_list_); } Status GetFeature(ServerContext* context, const Point* point, @@ -110,7 +110,7 @@ class RouteGuideImpl final : public RouteGuide::Service { } Status ListFeatures(ServerContext* context, - const examples::Rectangle* rectangle, + const routeguide::Rectangle* rectangle, ServerWriter<Feature>* writer) override { auto lo = rectangle->lo(); auto hi = rectangle->hi(); @@ -195,7 +195,7 @@ void RunServer(const std::string& db_path) { int main(int argc, char** argv) { // Expect only arg: --db_path=path/to/route_guide_db.json. - std::string db = examples::GetDbFileContent(argc, argv); + std::string db = routeguide::GetDbFileContent(argc, argv); RunServer(db); return 0; diff --git a/examples/csharp/README.md b/examples/csharp/README.md index fcdcc735f9bac6cc4893a3f1fc30f84326869faa..3719080f4ae50904b79f545addafe9aec50d7277 100644 --- a/examples/csharp/README.md +++ b/examples/csharp/README.md @@ -69,4 +69,4 @@ On Linux or Mac, use `mono GreeterServer.exe` and `mono GreeterClient.exe` to ru Tutorial -------- -You can find a more detailed tutorial in [gRPC Basics: C#](examples/csharp/route_guide/README.md) +You can find a more detailed tutorial in [gRPC Basics: C#](route_guide/README.md) diff --git a/examples/csharp/route_guide/README.md b/examples/csharp/route_guide/README.md index c3262c9b8aeee88c859690b0ac4e9d167679fa15..ec9a0c048efe41a1787267263a3b9ac1e88e7a5d 100644 --- a/examples/csharp/route_guide/README.md +++ b/examples/csharp/route_guide/README.md @@ -18,7 +18,7 @@ With gRPC we can define our service once in a .proto file and implement clients ## Example code and setup -The example code for our tutorial is in [examples/csharp/route_guide](examples/csharp/route_guide). To download the example, clone this repository by running the following command: +The example code for our tutorial is in [examples/csharp/route_guide](.). To download the example, clone this repository by running the following command: ```shell $ git clone https://github.com/grpc/grpc.git ``` @@ -34,7 +34,7 @@ able to generate the server and client interface code and run the examples. Foll ## Defining the service -Our first step (as you'll know from [Getting started](https://github.com/grpc/grpc/tree/master/examples)) is to define the gRPC *service* and the method *request* and *response* types using [protocol buffers] (https://developers.google.com/protocol-buffers/docs/overview). You can see the complete .proto file in [`examples/csharp/route_guide/RouteGuide/protos/route_guide.proto`](examples/csharp/route_guide/RouteGuide/protos/route_guide.proto). +Our first step (as you'll know from [Getting started](https://github.com/grpc/grpc/tree/master/examples)) is to define the gRPC *service* and the method *request* and *response* types using [protocol buffers] (https://developers.google.com/protocol-buffers/docs/overview). You can see the complete .proto file in [`RouteGuide/protos/route_guide.proto`](RouteGuide/protos/route_guide.proto). To define a service, you specify a named `service` in your .proto file: @@ -127,7 +127,7 @@ There are two parts to making our `RouteGuide` service do its job: - Implementing the service interface generated from our service definition: doing the actual "work" of our service. - Running a gRPC server to listen for requests from clients and return the service responses. -You can find our example `RouteGuide` server in [examples/csharp/route_guide/RouteGuideServer/RouteGuideImpl.cs](examples/csharp/route_guide/RouteGuideServer/RouteGuideServerImpl.cs). Let's take a closer look at how it works. +You can find our example `RouteGuide` server in [RouteGuideServer/RouteGuideImpl.cs](RouteGuideServer/RouteGuideServerImpl.cs). Let's take a closer look at how it works. ### Implementing RouteGuide @@ -288,7 +288,7 @@ As you can see, we build and start our server using `Grpc.Core.Server` class. To <a name="client"></a> ## Creating the client -In this section, we'll look at creating a C# client for our `RouteGuide` service. You can see our complete example client code in [examples/csharp/route_guide/RouteGuideClient/Program.cs](examples/csharp/route_guide/RouteGuideClient/Program.cs). +In this section, we'll look at creating a C# client for our `RouteGuide` service. You can see our complete example client code in [RouteGuideClient/Program.cs](RouteGuideClient/Program.cs). ### Creating a stub diff --git a/examples/node/route_guide/README.md b/examples/node/route_guide/README.md index 2efc5a5da52dd04f9e649ad425b7ab861de36b11..1dbaac9f9ff5587f01829967f4d15f9f116a7273 100644 --- a/examples/node/route_guide/README.md +++ b/examples/node/route_guide/README.md @@ -17,7 +17,7 @@ With gRPC we can define our service once in a .proto file and implement clients ## Example code and setup -The example code for our tutorial is in [examples/node/route_guide](examples/node/route_guide). To download the example, clone this repository by running the following command: +The example code for our tutorial is in [examples/node/route_guide](.). To download the example, clone this repository by running the following command: ```shell $ git clone https://github.com/grpc/grpc.git ``` @@ -27,12 +27,12 @@ Then change your current directory to `examples/node/route_guide`: $ cd examples/node/route_guide ``` -You also should have the relevant tools installed to generate the server and client interface code - if you don't already, follow the setup instructions in [the Node.js quick start guide](examples/node). +You also should have the relevant tools installed to generate the server and client interface code - if you don't already, follow the setup instructions in [the Node.js quick start guide](..). ## Defining the service -Our first step (as you'll know from [Getting started](https://github.com/grpc/grpc/tree/master/examples)) is to define the gRPC *service* and the method *request* and *response* types using [protocol buffers] (https://developers.google.com/protocol-buffers/docs/overview). You can see the complete .proto file in [`examples/protos/route_guide.proto`](examples/protos/route_guide.proto). +Our first step (as you'll know from [Getting started](https://github.com/grpc/grpc/tree/master/examples)) is to define the gRPC *service* and the method *request* and *response* types using [protocol buffers] (https://developers.google.com/protocol-buffers/docs/overview). You can see the complete .proto file in [`examples/protos/route_guide.proto`](../../route_guide.proto). To define a service, you specify a named `service` in your .proto file: @@ -110,7 +110,7 @@ There are two parts to making our `RouteGuide` service do its job: - Implementing the service interface generated from our service definition: doing the actual "work" of our service. - Running a gRPC server to listen for requests from clients and return the service responses. -You can find our example `RouteGuide` server in [examples/node/route_guide/route_guide_server.js](examples/node/route_guide/route_guide_server.js). Let's take a closer look at how it works. +You can find our example `RouteGuide` server in [route_guide_server.js](route_guide_server.js). Let's take a closer look at how it works. ### Implementing RouteGuide @@ -244,7 +244,7 @@ As you can see, we build and start our server with the following steps: <a name="client"></a> ## Creating the client -In this section, we'll look at creating a Node.js client for our `RouteGuide` service. You can see our complete example client code in [examples/node/route_guide/route_guide_client.js](examples/node/route_guide/route_guide_client.js). +In this section, we'll look at creating a Node.js client for our `RouteGuide` service. You can see our complete example client code in [route_guide_client.js](route_guide_client.js). ### Creating a stub diff --git a/examples/objective-c/auth_sample/README.md b/examples/objective-c/auth_sample/README.md index 3dbe7e334cc41e8284e0ca6aa6238149e9bc71b5..5ae64526191d718d8e7d2bfb711e5a60d70e01d0 100644 --- a/examples/objective-c/auth_sample/README.md +++ b/examples/objective-c/auth_sample/README.md @@ -9,8 +9,8 @@ headers. - Read response metadata from a call, which is equivalent to HTTP response headers and trailers. It assumes you know the basics on how to make gRPC API calls using the Objective-C client library, -as shown in the [Hello World](examples/objective-c/helloworld) -or [Route Guide](examples/objective-c/route_guide) tutorials, +as shown in the [Hello World](../helloworld) +or [Route Guide](../route_guide) tutorials, and are familiar with OAuth2 concepts like _access token_. - [Example code and setup](#setup) @@ -22,7 +22,7 @@ and are familiar with OAuth2 concepts like _access token_. <a name="setup"></a> ## Example code and setup -The example code for our tutorial is in [examples/objective-c/auth_sample](examples/objective-c/auth_sample). +The example code for our tutorial is in [examples/objective-c/auth_sample](.). To download the example, clone this repository by running the following command: ```shell $ git clone https://github.com/grpc/grpc.git diff --git a/examples/objective-c/helloworld/README.md b/examples/objective-c/helloworld/README.md index 3b852f857fd2deaa1fe07da019dd117a1ef94464..75df1a7a26e95fa70c8b50894e4ee53857c7c778 100644 --- a/examples/objective-c/helloworld/README.md +++ b/examples/objective-c/helloworld/README.md @@ -8,7 +8,7 @@ testing). You can obtain the latter by following [these setup instructions](http ## Hello Objective-C gRPC! -Here's how to build and run the Objective-C implementation of the [Hello World](examples/protos/helloworld.proto) +Here's how to build and run the Objective-C implementation of the [Hello World](../../protos/helloworld.proto) example used in [Getting started](https://github.com/grpc/grpc/tree/master/examples). The example code for this and our other examples lives in the `examples` directory. Clone @@ -53,4 +53,4 @@ responds with a `HLWHelloResponse`, which contains a string that is then output ## Tutorial -You can find a more detailed tutorial in [gRPC Basics: Objective-C](examples/objective-c/route_guide/README.md). +You can find a more detailed tutorial in [gRPC Basics: Objective-C](../route_guide/README.md). diff --git a/examples/objective-c/route_guide/README.md b/examples/objective-c/route_guide/README.md index dd20a07995b5a8cc7d9bd86af6cf908f952358ad..15864c01f4b8b0b0c3c451ed186f7639edcaed2d 100644 --- a/examples/objective-c/route_guide/README.md +++ b/examples/objective-c/route_guide/README.md @@ -43,7 +43,7 @@ code is limited by the dynamic nature of the language. <a name="setup"></a> ## Example code and setup -The example code for our tutorial is in [examples/objective-c/route_guide](examples/objective-c/route_guide). +The example code for our tutorial is in [examples/objective-c/route_guide](.). To download the example, clone this repository by running the following command: ```shell $ git clone https://github.com/grpc/grpc.git @@ -97,7 +97,7 @@ a client library from it, and how to create an app that uses that library. First let's look at how the service we're using is defined. A gRPC *service* and its method *request* and *response* types using [protocol buffers](https://developers.google.com/protocol-buffers/docs/overview). -You can see the complete .proto file for our example in [`examples/protos/route_guide.proto`](examples/protos/route_guide.proto). +You can see the complete .proto file for our example in [`examples/protos/route_guide.proto`](../../protos/route_guide.proto). To define a service, you specify a named `service` in your .proto file: @@ -177,7 +177,7 @@ option objc_class_prefix = "RTG"; Next we need to generate the gRPC client interfaces from our .proto service definition. We do this using the protocol buffer compiler (`protoc`) with a special gRPC Objective-C plugin. -For simplicity, we've provided a [Podspec file](examples/objective-c/route_guide/RouteGuide.podspec) +For simplicity, we've provided a [Podspec file](RouteGuide.podspec) that runs `protoc` for you with the appropriate plugin, input, and output, and describes how to compile the generated files. You just need to run in this directory (`examples/objective-c/route_guide`): @@ -211,7 +211,7 @@ definition; just replace the name (matching the file name), version, and other m ## Creating the client In this section, we'll look at creating an Objective-C client for our `RouteGuide` service. You can -see our complete example client code in [examples/objective-c/route_guide/ViewControllers.m](examples/objective-c/route_guide/ViewControllers.m). +see our complete example client code in [ViewControllers.m](ViewControllers.m). (Note: In your apps, for maintainability and readability reasons, you shouldn't put all of your view controllers in a single file; it's done here only to simplify the learning process). diff --git a/examples/php/route_guide/README.md b/examples/php/route_guide/README.md index e5230ae4e438035a7c9dea6ff4221835071a0bad..00610ffb0916d091bc9dfa7c0aea5b75c0f00489 100644 --- a/examples/php/route_guide/README.md +++ b/examples/php/route_guide/README.md @@ -8,7 +8,7 @@ This tutorial provides a basic PHP programmer's introduction to working with gRP It assumes a passing familiarity with [protocol buffers](https://developers.google.com/protocol-buffers/docs/overview). Note that the example in this tutorial uses the proto2 version of the protocol buffers language. -Also note that currently you can only create clients in PHP for gRPC services - you can find out how to create gRPC servers in our other tutorials, e.g. [Node.js](examples/node/route_guide). +Also note that currently you can only create clients in PHP for gRPC services - you can find out how to create gRPC servers in our other tutorials, e.g. [Node.js](../node/route_guide). This isn't a comprehensive guide to using gRPC in PHP: more reference documentation is coming soon. @@ -29,7 +29,7 @@ With gRPC you can define your service once in a .proto file and implement client <a name="setup"></a> ## Example code and setup -The example code for our tutorial is in [examples/php/route_guide](examples/php/route_guide). To download the example, clone this repository by running the following command: +The example code for our tutorial is in [examples/php/route_guide](.). To download the example, clone this repository by running the following command: ```shell $ git clone https://github.com/grpc/grpc.git ``` @@ -68,7 +68,7 @@ The next sections guide you step-by-step through how this proto service is defin <a name="proto"></a> ## Defining the service -First let's look at how the service we're using is defined. A gRPC *service* and its method *request* and *response* types using [protocol buffers](https://developers.google.com/protocol-buffers/docs/overview). You can see the complete .proto file for our example in [`examples/protos/route_guide.proto`](examples/protos/route_guide.proto). +First let's look at how the service we're using is defined. A gRPC *service* and its method *request* and *response* types using [protocol buffers](https://developers.google.com/protocol-buffers/docs/overview). You can see the complete .proto file for our example in [`route_guide.proto`](route_guide.proto). To define a service, you specify a named `service` in your .proto file: @@ -153,20 +153,20 @@ require dirname(__FILE__) . '/route_guide.php'; The file contains: - All the protocol buffer code to populate, serialize, and retrieve our request and response message types. -- A class called `examples\RouteGuideClient` that lets clients call the methods defined in the `RouteGuide` service. +- A class called `routeguide\RouteGuideClient` that lets clients call the methods defined in the `RouteGuide` service. <a name="client"></a> ## Creating the client -In this section, we'll look at creating a PHP client for our `RouteGuide` service. You can see our complete example client code in [examples/php/route_guide/route_guide_client.php](examples/php/route_guide/route_guide_client.php). +In this section, we'll look at creating a PHP client for our `RouteGuide` service. You can see our complete example client code in [route_guide_client.php](route_guide_client.php). ### Constructing a client object To call service methods, we first need to create a client object, an instance of the generated `RouteGuideClient` class. The constructor of the class expects the server address and port we want to connect to: ```php -$client = new examples\RouteGuideClient(new Grpc\BaseStub('localhost:50051', [])); +$client = new routeguide\RouteGuideClient(new Grpc\BaseStub('localhost:50051', [])); ``` ### Calling service methods @@ -178,13 +178,13 @@ Now let's look at how we call our service methods. Calling the simple RPC `GetFeature` is nearly as straightforward as calling a local asynchronous method. ```php - $point = new examples\Point(); + $point = new routeguide\Point(); $point->setLatitude(409146138); $point->setLongitude(-746188906); list($feature, $status) = $client->GetFeature($point)->wait(); ``` -As you can see, we create and populate a request object, i.e. an `examples\Point` object. Then, we call the method on the stub, passing it the request object. If there is no error, then we can read the response information from the server from our response object, i.e. an `examples\Feature` object. +As you can see, we create and populate a request object, i.e. an `routeguide\Point` object. Then, we call the method on the stub, passing it the request object. If there is no error, then we can read the response information from the server from our response object, i.e. an `routeguide\Feature` object. ```php print sprintf("Found %s \n at %f, %f\n", $feature->getName(), @@ -197,15 +197,15 @@ As you can see, we create and populate a request object, i.e. an `examples\Point Now let's look at our streaming methods. Here's where we call the server-side streaming method `ListFeatures`, which returns a stream of geographical `Feature`s: ```php - $lo_point = new examples\Point(); - $hi_point = new examples\Point(); + $lo_point = new routeguide\Point(); + $hi_point = new routeguide\Point(); $lo_point->setLatitude(400000000); $lo_point->setLongitude(-750000000); $hi_point->setLatitude(420000000); $hi_point->setLongitude(-730000000); - $rectangle = new examples\Rectangle(); + $rectangle = new routeguide\Rectangle(); $rectangle->setLo($lo_point); $rectangle->setHi($hi_point); @@ -219,12 +219,12 @@ Now let's look at our streaming methods. Here's where we call the server-side st The `$call->responses()` method call returns an iterator. When the server sends a response, a `$feature` object will be returned in the `foreach` loop, until the server indiciates that there will be no more responses to be sent. -The client-side streaming method `RecordRoute` is similar, except there we pass the method an iterator and get back a `examples\RouteSummary`. +The client-side streaming method `RecordRoute` is similar, except there we pass the method an iterator and get back a `routeguide\RouteSummary`. ```php $points_iter = function($db) { for ($i = 0; $i < $num_points; $i++) { - $point = new examples\Point(); + $point = new routeguide\Point(); $point->setLatitude($lat); $point->setLongitude($long); yield $point; @@ -245,7 +245,7 @@ To write messages from the client: ```php foreach ($notes as $n) { - $route_note = new examples\RouteNote(); + $route_note = new routerguide\RouteNote(); $call->write($route_note); } $call->writesDone(); diff --git a/examples/php/route_guide/route_guide.php b/examples/php/route_guide/route_guide.php index a836e03b55bb2cb31c624ee5f4279cb0111a9cdb..76086f9772dfd3eb555b5915a7ef74f5d5d765be 100644 --- a/examples/php/route_guide/route_guide.php +++ b/examples/php/route_guide/route_guide.php @@ -1,9 +1,9 @@ <?php // DO NOT EDIT! Generated by Protobuf-PHP protoc plugin 1.0 // Source: route_guide.proto -// Date: 2015-06-12 00:32:41 +// Date: 2015-08-31 21:11:45 -namespace examples { +namespace routeguide { class Point extends \DrSlump\Protobuf\Message { @@ -19,7 +19,7 @@ namespace examples { public static function descriptor() { - $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'examples.Point'); + $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'routeguide.Point'); // OPTIONAL INT32 latitude = 1 $f = new \DrSlump\Protobuf\Field(); @@ -58,7 +58,7 @@ namespace examples { /** * Clear <latitude> value * - * @return \examples\Point + * @return \routeguide\Point */ public function clearLatitude(){ return $this->_clear(1); @@ -77,7 +77,7 @@ namespace examples { * Set <latitude> value * * @param int $value - * @return \examples\Point + * @return \routeguide\Point */ public function setLatitude( $value){ return $this->_set(1, $value); @@ -95,7 +95,7 @@ namespace examples { /** * Clear <longitude> value * - * @return \examples\Point + * @return \routeguide\Point */ public function clearLongitude(){ return $this->_clear(2); @@ -114,7 +114,7 @@ namespace examples { * Set <longitude> value * * @param int $value - * @return \examples\Point + * @return \routeguide\Point */ public function setLongitude( $value){ return $this->_set(2, $value); @@ -122,14 +122,14 @@ namespace examples { } } -namespace examples { +namespace routeguide { class Rectangle extends \DrSlump\Protobuf\Message { - /** @var \examples\Point */ + /** @var \routeguide\Point */ public $lo = null; - /** @var \examples\Point */ + /** @var \routeguide\Point */ public $hi = null; @@ -138,7 +138,7 @@ namespace examples { public static function descriptor() { - $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'examples.Rectangle'); + $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'routeguide.Rectangle'); // OPTIONAL MESSAGE lo = 1 $f = new \DrSlump\Protobuf\Field(); @@ -146,7 +146,7 @@ namespace examples { $f->name = "lo"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; - $f->reference = '\examples\Point'; + $f->reference = '\routeguide\Point'; $descriptor->addField($f); // OPTIONAL MESSAGE hi = 2 @@ -155,7 +155,7 @@ namespace examples { $f->name = "hi"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; - $f->reference = '\examples\Point'; + $f->reference = '\routeguide\Point'; $descriptor->addField($f); foreach (self::$__extensions as $cb) { @@ -177,7 +177,7 @@ namespace examples { /** * Clear <lo> value * - * @return \examples\Rectangle + * @return \routeguide\Rectangle */ public function clearLo(){ return $this->_clear(1); @@ -186,7 +186,7 @@ namespace examples { /** * Get <lo> value * - * @return \examples\Point + * @return \routeguide\Point */ public function getLo(){ return $this->_get(1); @@ -195,10 +195,10 @@ namespace examples { /** * Set <lo> value * - * @param \examples\Point $value - * @return \examples\Rectangle + * @param \routeguide\Point $value + * @return \routeguide\Rectangle */ - public function setLo(\examples\Point $value){ + public function setLo(\routeguide\Point $value){ return $this->_set(1, $value); } @@ -214,7 +214,7 @@ namespace examples { /** * Clear <hi> value * - * @return \examples\Rectangle + * @return \routeguide\Rectangle */ public function clearHi(){ return $this->_clear(2); @@ -223,7 +223,7 @@ namespace examples { /** * Get <hi> value * - * @return \examples\Point + * @return \routeguide\Point */ public function getHi(){ return $this->_get(2); @@ -232,23 +232,23 @@ namespace examples { /** * Set <hi> value * - * @param \examples\Point $value - * @return \examples\Rectangle + * @param \routeguide\Point $value + * @return \routeguide\Rectangle */ - public function setHi(\examples\Point $value){ + public function setHi(\routeguide\Point $value){ return $this->_set(2, $value); } } } -namespace examples { +namespace routeguide { class Feature extends \DrSlump\Protobuf\Message { /** @var string */ public $name = null; - /** @var \examples\Point */ + /** @var \routeguide\Point */ public $location = null; @@ -257,7 +257,7 @@ namespace examples { public static function descriptor() { - $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'examples.Feature'); + $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'routeguide.Feature'); // OPTIONAL STRING name = 1 $f = new \DrSlump\Protobuf\Field(); @@ -273,7 +273,7 @@ namespace examples { $f->name = "location"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; - $f->reference = '\examples\Point'; + $f->reference = '\routeguide\Point'; $descriptor->addField($f); foreach (self::$__extensions as $cb) { @@ -295,7 +295,7 @@ namespace examples { /** * Clear <name> value * - * @return \examples\Feature + * @return \routeguide\Feature */ public function clearName(){ return $this->_clear(1); @@ -314,7 +314,7 @@ namespace examples { * Set <name> value * * @param string $value - * @return \examples\Feature + * @return \routeguide\Feature */ public function setName( $value){ return $this->_set(1, $value); @@ -332,7 +332,7 @@ namespace examples { /** * Clear <location> value * - * @return \examples\Feature + * @return \routeguide\Feature */ public function clearLocation(){ return $this->_clear(2); @@ -341,7 +341,7 @@ namespace examples { /** * Get <location> value * - * @return \examples\Point + * @return \routeguide\Point */ public function getLocation(){ return $this->_get(2); @@ -350,20 +350,20 @@ namespace examples { /** * Set <location> value * - * @param \examples\Point $value - * @return \examples\Feature + * @param \routeguide\Point $value + * @return \routeguide\Feature */ - public function setLocation(\examples\Point $value){ + public function setLocation(\routeguide\Point $value){ return $this->_set(2, $value); } } } -namespace examples { +namespace routeguide { class RouteNote extends \DrSlump\Protobuf\Message { - /** @var \examples\Point */ + /** @var \routeguide\Point */ public $location = null; /** @var string */ @@ -375,7 +375,7 @@ namespace examples { public static function descriptor() { - $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'examples.RouteNote'); + $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'routeguide.RouteNote'); // OPTIONAL MESSAGE location = 1 $f = new \DrSlump\Protobuf\Field(); @@ -383,7 +383,7 @@ namespace examples { $f->name = "location"; $f->type = \DrSlump\Protobuf::TYPE_MESSAGE; $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; - $f->reference = '\examples\Point'; + $f->reference = '\routeguide\Point'; $descriptor->addField($f); // OPTIONAL STRING message = 2 @@ -413,7 +413,7 @@ namespace examples { /** * Clear <location> value * - * @return \examples\RouteNote + * @return \routeguide\RouteNote */ public function clearLocation(){ return $this->_clear(1); @@ -422,7 +422,7 @@ namespace examples { /** * Get <location> value * - * @return \examples\Point + * @return \routeguide\Point */ public function getLocation(){ return $this->_get(1); @@ -431,10 +431,10 @@ namespace examples { /** * Set <location> value * - * @param \examples\Point $value - * @return \examples\RouteNote + * @param \routeguide\Point $value + * @return \routeguide\RouteNote */ - public function setLocation(\examples\Point $value){ + public function setLocation(\routeguide\Point $value){ return $this->_set(1, $value); } @@ -450,7 +450,7 @@ namespace examples { /** * Clear <message> value * - * @return \examples\RouteNote + * @return \routeguide\RouteNote */ public function clearMessage(){ return $this->_clear(2); @@ -469,7 +469,7 @@ namespace examples { * Set <message> value * * @param string $value - * @return \examples\RouteNote + * @return \routeguide\RouteNote */ public function setMessage( $value){ return $this->_set(2, $value); @@ -477,7 +477,7 @@ namespace examples { } } -namespace examples { +namespace routeguide { class RouteSummary extends \DrSlump\Protobuf\Message { @@ -499,7 +499,7 @@ namespace examples { public static function descriptor() { - $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'examples.RouteSummary'); + $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'routeguide.RouteSummary'); // OPTIONAL INT32 point_count = 1 $f = new \DrSlump\Protobuf\Field(); @@ -556,7 +556,7 @@ namespace examples { /** * Clear <point_count> value * - * @return \examples\RouteSummary + * @return \routeguide\RouteSummary */ public function clearPointCount(){ return $this->_clear(1); @@ -575,7 +575,7 @@ namespace examples { * Set <point_count> value * * @param int $value - * @return \examples\RouteSummary + * @return \routeguide\RouteSummary */ public function setPointCount( $value){ return $this->_set(1, $value); @@ -593,7 +593,7 @@ namespace examples { /** * Clear <feature_count> value * - * @return \examples\RouteSummary + * @return \routeguide\RouteSummary */ public function clearFeatureCount(){ return $this->_clear(2); @@ -612,7 +612,7 @@ namespace examples { * Set <feature_count> value * * @param int $value - * @return \examples\RouteSummary + * @return \routeguide\RouteSummary */ public function setFeatureCount( $value){ return $this->_set(2, $value); @@ -630,7 +630,7 @@ namespace examples { /** * Clear <distance> value * - * @return \examples\RouteSummary + * @return \routeguide\RouteSummary */ public function clearDistance(){ return $this->_clear(3); @@ -649,7 +649,7 @@ namespace examples { * Set <distance> value * * @param int $value - * @return \examples\RouteSummary + * @return \routeguide\RouteSummary */ public function setDistance( $value){ return $this->_set(3, $value); @@ -667,7 +667,7 @@ namespace examples { /** * Clear <elapsed_time> value * - * @return \examples\RouteSummary + * @return \routeguide\RouteSummary */ public function clearElapsedTime(){ return $this->_clear(4); @@ -686,7 +686,7 @@ namespace examples { * Set <elapsed_time> value * * @param int $value - * @return \examples\RouteSummary + * @return \routeguide\RouteSummary */ public function setElapsedTime( $value){ return $this->_set(4, $value); @@ -694,38 +694,36 @@ namespace examples { } } -namespace examples { +namespace routeguide { - class RouteGuideClient{ + class RouteGuideClient extends \Grpc\BaseStub { - private $rpc_impl; - - public function __construct($rpc_impl) { - $this->rpc_impl = $rpc_impl; + public function __construct($hostname, $opts) { + parent::__construct($hostname, $opts); } /** - * @param examples\Point $input + * @param routeguide\Point $input */ - public function GetFeature(\examples\Point $argument, $metadata = array()) { - return $this->rpc_impl->_simpleRequest('/examples.RouteGuide/GetFeature', $argument, '\examples\Feature::deserialize', $metadata); + public function GetFeature(\routeguide\Point $argument, $metadata = array(), $options = array()) { + return $this->_simpleRequest('/routeguide.RouteGuide/GetFeature', $argument, '\routeguide\Feature::deserialize', $metadata, $options); } /** - * @param examples\Rectangle $input + * @param routeguide\Rectangle $input */ - public function ListFeatures($argument, $metadata = array()) { - return $this->rpc_impl->_serverStreamRequest('/examples.RouteGuide/ListFeatures', $argument, '\examples\Feature::deserialize', $metadata); + public function ListFeatures($argument, $metadata = array(), $options = array()) { + return $this->_serverStreamRequest('/routeguide.RouteGuide/ListFeatures', $argument, '\routeguide\Feature::deserialize', $metadata, $options); } /** - * @param examples\Point $input + * @param routeguide\Point $input */ - public function RecordRoute($arguments, $metadata = array()) { - return $this->rpc_impl->_clientStreamRequest('/examples.RouteGuide/RecordRoute', $arguments, '\examples\RouteSummary::deserialize', $metadata); + public function RecordRoute($metadata = array()) { + return $this->_clientStreamRequest('/routeguide.RouteGuide/RecordRoute', '\routeguide\RouteSummary::deserialize', $metadata); } /** - * @param examples\RouteNote $input + * @param routeguide\RouteNote $input */ public function RouteChat($metadata = array()) { - return $this->rpc_impl->_bidiRequest('/examples.RouteGuide/RouteChat', '\examples\RouteNote::deserialize', $metadata); + return $this->_bidiRequest('/routeguide.RouteGuide/RouteChat', '\routeguide\RouteNote::deserialize', $metadata); } } } diff --git a/examples/php/route_guide/route_guide.proto b/examples/php/route_guide/route_guide.proto index 0947184dbbd6a3fc711bbb3687726f2f9bff1966..d50f8a5169220c71de257279054eaf59ee1e2087 100644 --- a/examples/php/route_guide/route_guide.proto +++ b/examples/php/route_guide/route_guide.proto @@ -31,7 +31,7 @@ syntax = "proto2"; option java_package = "io.grpc.examples"; -package examples; +package routeguide; // Interface exported by the server. service RouteGuide { diff --git a/examples/php/route_guide/route_guide_client.php b/examples/php/route_guide/route_guide_client.php index 6d9ae58b66cad75a1f5ef04e8f46102a426cfff2..d21a080995de0c3baac398c3013cb208234b567b 100644 --- a/examples/php/route_guide/route_guide_client.php +++ b/examples/php/route_guide/route_guide_client.php @@ -37,7 +37,7 @@ require dirname(__FILE__) . '/route_guide.php'; define('COORD_FACTOR', 1e7); -$client = new examples\RouteGuideClient( +$client = new routeguide\RouteGuideClient( new Grpc\BaseStub('localhost:50051', [])); function printFeature($feature) { @@ -60,7 +60,7 @@ function runGetFeature() { print "Running GetFeature...\n"; global $client; - $point = new examples\Point(); + $point = new routeguide\Point(); $points = array( array(409146138, -746188906), array(0, 0), @@ -84,15 +84,15 @@ function runListFeatures() { print "Running ListFeatures...\n"; global $client; - $lo_point = new examples\Point(); - $hi_point = new examples\Point(); + $lo_point = new routeguide\Point(); + $hi_point = new routeguide\Point(); $lo_point->setLatitude(400000000); $lo_point->setLongitude(-750000000); $hi_point->setLatitude(420000000); $hi_point->setLongitude(-730000000); - $rectangle = new examples\Rectangle(); + $rectangle = new routeguide\Rectangle(); $rectangle->setLo($lo_point); $rectangle->setHi($hi_point); @@ -118,7 +118,7 @@ function runRecordRoute() { $num_points_in_db = count($db); $num_points = 10; for ($i = 0; $i < $num_points; $i++) { - $point = new examples\Point(); + $point = new routeguide\Point(); $index = rand(0, $num_points_in_db - 1); $lat = $db[$index]['location']['latitude']; $long = $db[$index]['location']['longitude']; @@ -163,11 +163,11 @@ function runRouteChat() { ); foreach ($notes as $n) { - $point = new examples\Point(); + $point = new routeguide\Point(); $point->setLatitude($lat = $n[0]); $point->setLongitude($long = $n[1]); - $route_note = new examples\RouteNote(); + $route_note = new routeguide\RouteNote(); $route_note->setLocation($point); $route_note->setMessage($message = $n[2]); diff --git a/examples/protos/route_guide.proto b/examples/protos/route_guide.proto index bfde5f1ead67cdac9055fb2e51ebc5145a1996e5..7a70040e1ce58d80f988592614e8a43482756261 100644 --- a/examples/protos/route_guide.proto +++ b/examples/protos/route_guide.proto @@ -32,7 +32,7 @@ syntax = "proto3"; option java_package = "ex.grpc"; option objc_class_prefix = "RTG"; -package examples; +package routeguide; // Interface exported by the server. service RouteGuide { diff --git a/examples/python/helloworld/README.md b/examples/python/helloworld/README.md index d199c401ecf88337bb2ca26486d6205eb9bef5cc..8fde0d2315cfbe32e566e4835cf4e791aee48a26 100644 --- a/examples/python/helloworld/README.md +++ b/examples/python/helloworld/README.md @@ -1,6 +1,6 @@ # gRPC Python Hello World -This is a quick introduction with a simple example and installation instructions: for a more complete tutorial see [gRPC Basics: Python](examples/python/route_guide). +This is a quick introduction with a simple example and installation instructions: for a more complete tutorial see [gRPC Basics: Python](../route_guide). ### Install gRPC Make sure you have built gRPC Python from source on your system. Follow the instructions here: @@ -96,7 +96,7 @@ been generated for you (helloworld_pb2.py). ### The client -Client-side code can be found in [greeter_client.py](examples/python/helloworld/greeter_client.py). +Client-side code can be found in [greeter_client.py](greeter_client.py). You can run the client using: @@ -107,7 +107,7 @@ $ ./run_client.sh ### The server -Server side code can be found in [greeter_server.py](examples/python/helloworld/greeter_server.py). +Server side code can be found in [greeter_server.py](greeter_server.py). You can run the server using: diff --git a/examples/python/route_guide/README.md b/examples/python/route_guide/README.md index dc97892ea5855725b71a5e22342c1ff10a04f5e8..636e134964d69ec8837d7dd7ebaec6775c6b1ca4 100644 --- a/examples/python/route_guide/README.md +++ b/examples/python/route_guide/README.md @@ -19,7 +19,7 @@ With gRPC you can define your service once in a .proto file and implement client ## Example code and setup -The example code for this tutorial is in [examples/python/route_guide](examples/python/route_guide). To download the example, clone this repository by running the following command: +The example code for this tutorial is in [examples/python/route_guide](.). To download the example, clone this repository by running the following command: ```shell $ git clone https://github.com/grpc/grpc.git ``` @@ -29,11 +29,11 @@ Then change your current directory to `examples/python/route_guide`: $ cd examples/python/route_guide ``` -You also should have the relevant tools installed to generate the server and client interface code - if you don't already, follow the setup instructions in [the Python quick start guide](examples/python). +You also should have the relevant tools installed to generate the server and client interface code - if you don't already, follow the setup instructions in [the Python quick start guide](../python). ## Defining the service -Your first step (as you'll know from [Getting started](https://github.com/grpc/grpc/tree/master/examples)) is to define the gRPC *service* and the method *request* and *response* types using [protocol buffers](https://developers.google.com/protocol-buffers/docs/overview). You can see the complete .proto file in [`examples/protos/route_guide.proto`](examples/protos/route_guide.proto). +Your first step (as you'll know from [Getting started](https://github.com/grpc/grpc/tree/master/examples)) is to define the gRPC *service* and the method *request* and *response* types using [protocol buffers](https://developers.google.com/protocol-buffers/docs/overview). You can see the complete .proto file in [`examples/protos/route_guide.proto`](../../protos/route_guide.proto). To define a service, you specify a named `service` in your .proto file: @@ -115,7 +115,7 @@ Creating and running a `RouteGuide` server breaks down into two work items: - Implementing the servicer interface generated from our service definition with functions that perform the actual "work" of the service. - Running a gRPC server to listen for requests from clients and transmit responses. -You can find the example `RouteGuide` server in [examples/python/route_guide/route_guide_server.py](examples/python/route_guide/route_guide_server.py). +You can find the example `RouteGuide` server in [route_guide_server.py](route_guide_server.py). ### Implementing RouteGuide @@ -222,7 +222,7 @@ Because `start()` does not block you may need to sleep-loop if there is nothing <a name="client"></a> ## Creating the client -You can see the complete example client code in [examples/python/route_guide/route_guide_client.py](examples/python/route_guide/route_guide_client.py). +You can see the complete example client code in [route_guide_client.py](route_guide_client.py). ### Creating a stub diff --git a/examples/ruby/README.md b/examples/ruby/README.md index dc21f5dd49db244769f1898dba766c639673a772..36f3527006c28e6379c20cf4006bd9d7f6d50f63 100644 --- a/examples/ruby/README.md +++ b/examples/ruby/README.md @@ -55,7 +55,7 @@ Try it! Tutorial -------- -You can find a more detailed tutorial in [gRPC Basics: Ruby](examples/ruby/route_guide/README.md) +You can find a more detailed tutorial in [gRPC Basics: Ruby](route_guide/README.md) -[helloworld.proto]:examples/protos/helloworld.proto +[helloworld.proto]:../protos/helloworld.proto [RVM]:https://www.rvm.io/ diff --git a/examples/ruby/route_guide/README.md b/examples/ruby/route_guide/README.md index c7231fb43f39765377d11c6b9ace0a38ac34a75b..77e93d8bd4e8be62752281de9d108cc7c9cac009 100644 --- a/examples/ruby/route_guide/README.md +++ b/examples/ruby/route_guide/README.md @@ -18,7 +18,7 @@ With gRPC we can define our service once in a .proto file and implement clients ## Example code and setup -The example code for our tutorial is in [examples/ruby/route_guide](examples/ruby/route_guide). To download the example, clone this repository by running the following command: +The example code for our tutorial is in [examples/ruby/route_guide](.). To download the example, clone this repository by running the following command: ```shell $ git clone https://github.com/grpc/grpc.git ``` @@ -28,12 +28,12 @@ Then change your current directory to `examples/ruby/route_guide`: $ cd examples/ruby/route_guide ``` -You also should have the relevant tools installed to generate the server and client interface code - if you don't already, follow the setup instructions in [the Ruby quick start guide](examples/ruby). +You also should have the relevant tools installed to generate the server and client interface code - if you don't already, follow the setup instructions in [the Ruby quick start guide](..). ## Defining the service -Our first step (as you'll know from [Getting started](https://github.com/grpc/grpc/tree/master/examples)) is to define the gRPC *service* and the method *request* and *response* types using [protocol buffers] (https://developers.google.com/protocol-buffers/docs/overview). You can see the complete .proto file in [`examples/protos/route_guide.proto`](examples/protos/route_guide.proto). +Our first step (as you'll know from [Getting started](https://github.com/grpc/grpc/tree/master/examples)) is to define the gRPC *service* and the method *request* and *response* types using [protocol buffers] (https://developers.google.com/protocol-buffers/docs/overview). You can see the complete .proto file in [`examples/protos/route_guide.proto`](../../route_guide.proto). To define a service, you specify a named `service` in your .proto file: @@ -116,7 +116,7 @@ There are two parts to making our `RouteGuide` service do its job: - Implementing the service interface generated from our service definition: doing the actual "work" of our service. - Running a gRPC server to listen for requests from clients and return the service responses. -You can find our example `RouteGuide` server in [examples/ruby/route_guide/route_guide_server.rb](examples/ruby/route_guide/route_guide_server.rb). Let's take a closer look at how it works. +You can find our example `RouteGuide` server in [route_guide_server.rb](route_guide_server.rb). Let's take a closer look at how it works. ### Implementing RouteGuide @@ -199,7 +199,7 @@ As you can see, we build and start our server using a `GRPC::RpcServer`. To do t <a name="client"></a> ## Creating the client -In this section, we'll look at creating a Ruby client for our `RouteGuide` service. You can see our complete example client code in [examples/ruby/route_guide/route_guide_client.rb](examples/ruby/route_guide/route_guide_client.rb). +In this section, we'll look at creating a Ruby client for our `RouteGuide` service. You can see our complete example client code in [route_guide_client.rb](route_guide_client.rb). ### Creating a stub diff --git a/gRPC.podspec b/gRPC.podspec index 0349d04c6ac3530d1349db08f660573bf2fd4a81..d0e1e2d848da4a4a385bb8f8aba5b5a317922518 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -247,8 +247,9 @@ 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_stat_id.h', + 'src/core/census/rpc_metric_id.h', 'grpc/grpc_security.h', 'grpc/byte_buffer.h', 'grpc/byte_buffer_reader.h', @@ -396,7 +397,6 @@ Pod::Spec.new do |s| 'src/core/census/context.c', 'src/core/census/initialize.c', 'src/core/census/operation.c', - 'src/core/census/record_stat.c', 'src/core/census/tracing.c' ss.private_header_files = 'src/core/support/env.h', @@ -521,8 +521,9 @@ 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_stat_id.h' + 'src/core/census/rpc_metric_id.h' ss.header_mappings_dir = '.' diff --git a/include/grpc/census.h b/include/grpc/census.h index d1a2978bd2235726ab3e383f94eb9e32cfe67ec8..2f36665d465e67bec17aa6de7812fd3df0ac531b 100644 --- a/include/grpc/census.h +++ b/include/grpc/census.h @@ -379,16 +379,107 @@ int census_tag_set_next(census_tag_set_iterator *it, census_tag_const *tag); invalidated, and should not be used once close is called. */ void census_tag_set_close(census_tag_set_iterator *it); -/* A census statistic to be recorded comprises two parts: an ID for the - * particular statistic and the value to be recorded against it. */ +/* Core stats collection API's. The following concepts are used: + * Aggregation: A collection of values. Census supports the following + aggregation types: + Sum - a single summation type. Typically used for keeping (e.g.) + counts of events. + Distribution - statistical distribution information, used for + recording average, standard deviation etc. + Histogram - a histogram of measurements falling in defined bucket + boundaries. + Window - a count of events that happen in reolling time window. + New aggregation types can be added by the user, if desired (see + census_register_aggregation()). + * Metric: Each measurement is for a single metric. Examples include RPC + latency, CPU seconds consumed, and bytes transmitted. + * View: A view is a combination of a metric, a tag set (in which the tag + values are regular expressions) and a set of aggregations. When a + measurement for a metric matches the view tags, it is recorded (for each + unique set of tags) against each aggregation. Each metric can have an + arbitrary number of views by which it will be broken down. +*/ + +/* A single value to be recorded comprises two parts: an ID for the particular + * metric and the value to be recorded against it. */ typedef struct { - int id; + gpr_uint32 metric_id; double value; -} census_stat; +} census_value; + +/* Record new usage values against the given context. */ +void census_record_values(census_context *context, census_value *values, + size_t nvalues); + +/** 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; +extern census_aggregation_ops census_agg_window; + +/** Information needed to instantiate a new aggregation. Used in view + construction via census_define_view(). */ +typedef struct { + const census_aggregation_ops *ops; + const void + *create_arg; /* Argument to be used for aggregation initialization. */ +} census_aggregation; + +/** A census view type. Opaque. */ +typedef struct census_view census_view; + +/** Create a new view. + @param metric_id Metric with which this view is associated. + @param tags tags that define the view + @param aggregations aggregations to associate with the view + @param naggregations number of aggregations + + @return A new census view +*/ +census_view *census_view_create(gpr_uint32 metric_id, + const census_tag_set *tags, + const census_aggregation *aggregations, + size_t naggregations); + +/** Destroy a previously created view. */ +void census_view_delete(census_view *view); + +/** Metric ID associated with a view */ +size_t census_view_metric(const census_view *view); + +/** Number of aggregations associated with view. */ +size_t census_view_naggregations(const census_view *view); + +/** Get tags associated with view. */ +const census_tag_set *census_view_tags(const census_view *view); + +/** Get aggregation descriptors associated with a view. */ +const census_aggregation *census_view_aggregrations(const census_view *view); + +/** Holds all the aggregation data for a particular view instantiation. Forms + part of the data returned by census_view_data(). */ +typedef struct { + const census_tag_set *tags; /* Tags for this set of aggregations. */ + const void **data; /* One data set for every aggregation in the view. */ +} census_view_aggregation_data; + +/** Census view data as returned by census_view_get_data(). */ +typedef struct { + size_t n_tag_sets; /* Number of unique tag sets that matched view. */ + const census_view_aggregation_data *data; /* n_tag_sets entries */ +} census_view_data; + +/** Get data from aggregations associated with a view. + @param view View from which to get data. + @return Full set of data for all aggregations for the view. +*/ +const census_view_data *census_view_get_data(const census_view *view); -/* Record new stats against the given context. */ -void census_record_stat(census_context *context, census_stat *stats, - size_t nstats); +/** Reset all view data to zero for the specified view */ +void census_view_reset(census_view *view); #ifdef __cplusplus } diff --git a/src/core/census/record_stat.c b/src/core/census/aggregation.h similarity index 50% rename from src/core/census/record_stat.c rename to src/core/census/aggregation.h index 3dd918618b60e75db330a1c227432aa4e541b2d1..e9bc6ada96085b9c80953773129907e89071bd77 100644 --- a/src/core/census/record_stat.c +++ b/src/core/census/aggregation.h @@ -31,8 +31,36 @@ * */ -#include <grpc/census.h> -#include "src/core/census/rpc_stat_id.h" +#include <stddef.h> -void census_record_stat(census_context *context, census_stat *stats, - size_t nstats) {} +#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 */ diff --git a/src/core/census/grpc_filter.c b/src/core/census/grpc_filter.c index b78445595c8e2b2857ddf61dbc6fd968aa7e6346..e01c9a2ad4b933dd8699f7e77537b59b63a8bef8 100644 --- a/src/core/census/grpc_filter.c +++ b/src/core/census/grpc_filter.c @@ -36,7 +36,7 @@ #include <stdio.h> #include <string.h> -#include "src/core/census/rpc_stat_id.h" +#include "include/grpc/census.h" #include "src/core/channel/channel_stack.h" #include "src/core/channel/noop_filter.h" #include "src/core/statistics/census_interface.h" @@ -173,25 +173,15 @@ static void destroy_channel_elem(grpc_channel_element* elem) { } const grpc_channel_filter grpc_client_census_filter = { - client_start_transport_op, - grpc_channel_next_op, - sizeof(call_data), - client_init_call_elem, - client_destroy_call_elem, - sizeof(channel_data), - init_channel_elem, - destroy_channel_elem, - grpc_call_next_get_peer, - "census-client"}; + client_start_transport_op, grpc_channel_next_op, + sizeof(call_data), client_init_call_elem, + client_destroy_call_elem, sizeof(channel_data), + init_channel_elem, destroy_channel_elem, + grpc_call_next_get_peer, "census-client"}; const grpc_channel_filter grpc_server_census_filter = { - server_start_transport_op, - grpc_channel_next_op, - sizeof(call_data), - server_init_call_elem, - server_destroy_call_elem, - sizeof(channel_data), - init_channel_elem, - destroy_channel_elem, - grpc_call_next_get_peer, - "census-server"}; + server_start_transport_op, grpc_channel_next_op, + sizeof(call_data), server_init_call_elem, + server_destroy_call_elem, sizeof(channel_data), + init_channel_elem, destroy_channel_elem, + grpc_call_next_get_peer, "census-server"}; diff --git a/src/core/census/rpc_stat_id.h b/src/core/census/rpc_metric_id.h similarity index 69% rename from src/core/census/rpc_stat_id.h rename to src/core/census/rpc_metric_id.h index fc0aa6f43f617c9413301d6cbf68caf901eafa65..1d8e8806f5060779fd5e7b272b60182e37c95050 100644 --- a/src/core/census/rpc_stat_id.h +++ b/src/core/census/rpc_metric_id.h @@ -31,16 +31,21 @@ * */ -#ifndef CENSUS_RPC_STAT_ID_H -#define CENSUS_RPC_STAT_ID_H +#ifndef CENSUS_RPC_METRIC_ID_H +#define CENSUS_RPC_METRIC_ID_H -/* Stats ID's used for RPC measurements. */ -#define CENSUS_INVALID_STAT_ID 0 /* ID 0 is always invalid */ -#define CENSUS_RPC_CLIENT_REQUESTS 1 /* Count of client requests sent. */ -#define CENSUS_RPC_SERVER_REQUESTS 2 /* Count of server requests sent. */ -#define CENSUS_RPC_CLIENT_ERRORS 3 /* Client error counts. */ -#define CENSUS_RPC_SERVER_ERRORS 4 /* Server error counts. */ -#define CENSUS_RPC_CLIENT_LATENCY 5 /* Client side request latency. */ -#define CENSUS_RPC_SERVER_LATENCY 6 /* Server side request latency. */ +/* Metric ID's used for RPC measurements. */ +/* Count of client requests sent. */ +#define CENSUS_METRIC_RPC_CLIENT_REQUESTS ((gpr_uint32)0) +/* Count of server requests sent. */ +#define CENSUS_METRIC_RPC_SERVER_REQUESTS ((gpr_uint32)1) +/* Client error counts. */ +#define CENSUS_METRIC_RPC_CLIENT_ERRORS ((gpr_uint32)2) +/* Server error counts. */ +#define CENSUS_METRIC_RPC_SERVER_ERRORS ((gpr_uint32)3) +/* Client side request latency. */ +#define CENSUS_METRIC_RPC_CLIENT_LATENCY ((gpr_uint32)4) +/* Server side request latency. */ +#define CENSUS_METRIC_RPC_SERVER_LATENCY ((gpr_uint32)5) -#endif /* CENSUS_RPC_STAT_ID_H */ +#endif /* CENSUS_RPC_METRIC_ID_H */ diff --git a/src/node/README.md b/src/node/README.md index c96bc966429dd11dfe0943dad75cc4b26630de14..0b97680feb98e4904e8a174f3fdd1e823b50c9b9 100644 --- a/src/node/README.md +++ b/src/node/README.md @@ -1,7 +1,7 @@ # Node.js gRPC Library ## Status -Alpha : Ready for early adopters +Beta ## PREREQUISITES - `node`: This requires `node` to be installed. If you instead have the `nodejs` executable on Debian, you should install the [`nodejs-legacy`](https://packages.debian.org/sid/nodejs-legacy) package. diff --git a/src/node/package.json b/src/node/package.json index 756d41b0af2a483e468faa648cf7358eb52f715b..bb8987cc0d7615eb35044a54e471fd5c9a63c6b5 100644 --- a/src/node/package.json +++ b/src/node/package.json @@ -1,6 +1,6 @@ { "name": "grpc", - "version": "0.10.0", + "version": "0.11.0", "author": "Google Inc.", "description": "gRPC Library for Node", "homepage": "http://www.grpc.io/", diff --git a/src/objective-c/generated_libraries/RouteGuideClient/route_guide.proto b/src/objective-c/generated_libraries/RouteGuideClient/route_guide.proto index dace1a5d260d50045b7a7d0a10cd506f39b9780d..19592e2ebdd6fa88fb384a0305a790a8a0d4218e 100644 --- a/src/objective-c/generated_libraries/RouteGuideClient/route_guide.proto +++ b/src/objective-c/generated_libraries/RouteGuideClient/route_guide.proto @@ -29,7 +29,7 @@ syntax = "proto3"; -package examples; +package routeguide; option objc_class_prefix = "RGD"; diff --git a/src/objective-c/tests/LocalClearTextTests.m b/src/objective-c/tests/LocalClearTextTests.m index d01fe91afaf52fe5aa5ebc812ee68343d4fc302a..976fff55bcc496f65ba4cd15296be26d38602cf1 100644 --- a/src/objective-c/tests/LocalClearTextTests.m +++ b/src/objective-c/tests/LocalClearTextTests.m @@ -47,7 +47,7 @@ // instructions at https://github.com/grpc/homebrew-grpc static NSString * const kRouteGuideHost = @"http://localhost:50051"; -static NSString * const kPackage = @"examples"; +static NSString * const kPackage = @"routeguide"; static NSString * const kService = @"RouteGuide"; @interface LocalClearTextTests : XCTestCase diff --git a/src/ruby/.rspec b/src/ruby/.rspec index 2320752db4d2460316ac5ebef7ff7ac97c341e96..efeee2c1d225a82e21cede9e8ff17f848721a862 100755 --- a/src/ruby/.rspec +++ b/src/ruby/.rspec @@ -1,5 +1,6 @@ -I. -Ipb +--backtrace --require spec_helper --format documentation --color diff --git a/src/ruby/grpc.gemspec b/src/ruby/grpc.gemspec index 20a6206e7ed2eebc0c47cb2b65e14f45bef9bd88..093606bb8b062978f4865d2b8e2324709715c7c0 100755 --- a/src/ruby/grpc.gemspec +++ b/src/ruby/grpc.gemspec @@ -14,7 +14,7 @@ Gem::Specification.new do |s| s.license = 'BSD-3-Clause' s.required_ruby_version = '>= 2.0.0' - s.requirements << 'libgrpc ~> 0.10.0 needs to be installed' + s.requirements << 'libgrpc ~> 0.11.0 needs to be installed' s.files = %w( Rakefile ) s.files += Dir.glob('lib/**/*') diff --git a/src/ruby/lib/grpc/generic/rpc_server.rb b/src/ruby/lib/grpc/generic/rpc_server.rb index 38ea3334136fd68369000c32d10fdc8350a70e49..3740ac52da25e83b53ba261e3bcb9c3237a7330e 100644 --- a/src/ruby/lib/grpc/generic/rpc_server.rb +++ b/src/ruby/lib/grpc/generic/rpc_server.rb @@ -417,18 +417,18 @@ module GRPC begin an_rpc = @server.request_call(@cq, loop_tag, INFINITE_FUTURE) c = new_active_server_call(an_rpc) + unless c.nil? + mth = an_rpc.method.to_sym + @pool.schedule(c) do |call| + rpc_descs[mth].run_server_method(call, rpc_handlers[mth]) + end + end rescue Core::CallError, RuntimeError => e # these might happen for various reasonse. The correct behaviour of # the server is to log them and continue, if it's not shutting down. GRPC.logger.warn("server call failed: #{e}") unless stopped? next end - unless c.nil? - mth = an_rpc.method.to_sym - @pool.schedule(c) do |call| - rpc_descs[mth].run_server_method(call, rpc_handlers[mth]) - end - end end @running = false GRPC.logger.info("stopped: #{self}") diff --git a/src/ruby/lib/grpc/version.rb b/src/ruby/lib/grpc/version.rb index 431e8774b58e2d943d27d67823e740906871e874..108c22b25ed433e54e7abb0d7c65a2d6dee8f69d 100644 --- a/src/ruby/lib/grpc/version.rb +++ b/src/ruby/lib/grpc/version.rb @@ -29,5 +29,5 @@ # GRPC contains the General RPC module. module GRPC - VERSION = '0.10.0' + VERSION = '0.11.0' end diff --git a/src/ruby/spec/client_server_spec.rb b/src/ruby/spec/client_server_spec.rb index 387f2baec28657f5f7364df9712434c01c111138..ad0fb26896a8c1644854a076d3e0562a1f8e7e70 100644 --- a/src/ruby/spec/client_server_spec.rb +++ b/src/ruby/spec/client_server_spec.rb @@ -28,7 +28,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. require 'grpc' -require 'spec_helper' include GRPC::Core @@ -41,7 +40,7 @@ shared_context 'setup: tags' do end def deadline - Time.now + 2 + Time.now + 5 end def server_allows_client_to_proceed diff --git a/src/ruby/spec/pb/health/checker_spec.rb b/src/ruby/spec/pb/health/checker_spec.rb index d7b7535cbec9c9ec7bad8ed4b4500ee10dbdd308..9bc82638c75fd3091e655b531035ca20234951cd 100644 --- a/src/ruby/spec/pb/health/checker_spec.rb +++ b/src/ruby/spec/pb/health/checker_spec.rb @@ -179,7 +179,6 @@ describe Grpc::Health::Checker do describe 'running on RpcServer' do RpcServer = GRPC::RpcServer - StatusCodes = GRPC::Core::StatusCodes CheckerStub = Grpc::Health::Checker.rpc_stub_class before(:each) do diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 0b7f89ffdd19556f54e05001e3a355db12b92140..729f8bf2ff733caf44637c63f0bc204adbed7a30 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -881,8 +881,9 @@ 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_stat_id.h \ +src/core/census/rpc_metric_id.h \ src/core/httpcli/httpcli_security_connector.c \ src/core/security/base64.c \ src/core/security/client_auth_filter.c \ @@ -1023,7 +1024,6 @@ src/core/transport/transport_op_string.c \ src/core/census/context.c \ src/core/census/initialize.c \ src/core/census/operation.c \ -src/core/census/record_stat.c \ src/core/census/tracing.c \ include/grpc/support/alloc.h \ include/grpc/support/atm.h \ diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 46fb8b28d411b268d05cdc5c8600659b85f5ba6e..3a94b9ee6b5b3bb3c5fcac37cefb68ea05de09fc 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -12229,9 +12229,10 @@ "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_stat_id.h", + "src/core/census/rpc_metric_id.h", "src/core/channel/channel_args.h", "src/core/channel/channel_stack.h", "src/core/channel/client_channel.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", @@ -12363,8 +12365,7 @@ "src/core/census/grpc_filter.h", "src/core/census/initialize.c", "src/core/census/operation.c", - "src/core/census/record_stat.c", - "src/core/census/rpc_stat_id.h", + "src/core/census/rpc_metric_id.h", "src/core/census/tracing.c", "src/core/channel/channel_args.c", "src/core/channel/channel_args.h", @@ -12708,9 +12709,10 @@ "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_stat_id.h", + "src/core/census/rpc_metric_id.h", "src/core/channel/channel_args.h", "src/core/channel/channel_stack.h", "src/core/channel/client_channel.h", @@ -12821,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", @@ -12828,8 +12831,7 @@ "src/core/census/grpc_filter.h", "src/core/census/initialize.c", "src/core/census/operation.c", - "src/core/census/record_stat.c", - "src/core/census/rpc_stat_id.h", + "src/core/census/rpc_metric_id.h", "src/core/census/tracing.c", "src/core/channel/channel_args.c", "src/core/channel/channel_args.h", diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj b/vsprojects/vcxproj/grpc/grpc.vcxproj index 77f2c776790a338a395d7e60c8e7eefcaac17a94..852da5d95f74595920f6488ce1145de02a50b5c9 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj @@ -343,8 +343,9 @@ <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_stat_id.h" /> + <ClInclude Include="..\..\..\src\core\census\rpc_metric_id.h" /> </ItemGroup> <ItemGroup> <ClCompile Include="..\..\..\src\core\httpcli\httpcli_security_connector.c"> @@ -627,8 +628,6 @@ </ClCompile> <ClCompile Include="..\..\..\src\core\census\operation.c"> </ClCompile> - <ClCompile Include="..\..\..\src\core\census\record_stat.c"> - </ClCompile> <ClCompile Include="..\..\..\src\core\census\tracing.c"> </ClCompile> </ItemGroup> diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters index 0808f7147a0a09c022da324ebd4607ca85425396..b334602e020aaf159992e032243ce5f3e5c0ed04 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters @@ -421,9 +421,6 @@ <ClCompile Include="..\..\..\src\core\census\operation.c"> <Filter>src\core\census</Filter> </ClCompile> - <ClCompile Include="..\..\..\src\core\census\record_stat.c"> - <Filter>src\core\census</Filter> - </ClCompile> <ClCompile Include="..\..\..\src\core\census\tracing.c"> <Filter>src\core\census</Filter> </ClCompile> @@ -794,10 +791,13 @@ <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> - <ClInclude Include="..\..\..\src\core\census\rpc_stat_id.h"> + <ClInclude Include="..\..\..\src\core\census\rpc_metric_id.h"> <Filter>src\core\census</Filter> </ClInclude> </ItemGroup> diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj index ff03f20d531590e845761cf6b20d9733de50a098..f069aa5225309dc017e2c7a16a603ff4aec183b0 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj @@ -322,8 +322,9 @@ <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_stat_id.h" /> + <ClInclude Include="..\..\..\src\core\census\rpc_metric_id.h" /> </ItemGroup> <ItemGroup> <ClCompile Include="..\..\..\src\core\surface\init_unsecure.c"> @@ -566,8 +567,6 @@ </ClCompile> <ClCompile Include="..\..\..\src\core\census\operation.c"> </ClCompile> - <ClCompile Include="..\..\..\src\core\census\record_stat.c"> - </ClCompile> <ClCompile Include="..\..\..\src\core\census\tracing.c"> </ClCompile> </ItemGroup> diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters index 7b66d4ae982839dfb7d3527f64f28abbdecfa958..35f8599cb9f3c1e780d44e23a0849ecf0dd2378e 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters @@ -361,9 +361,6 @@ <ClCompile Include="..\..\..\src\core\census\operation.c"> <Filter>src\core\census</Filter> </ClCompile> - <ClCompile Include="..\..\..\src\core\census\record_stat.c"> - <Filter>src\core\census</Filter> - </ClCompile> <ClCompile Include="..\..\..\src\core\census\tracing.c"> <Filter>src\core\census</Filter> </ClCompile> @@ -692,10 +689,13 @@ <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> - <ClInclude Include="..\..\..\src\core\census\rpc_stat_id.h"> + <ClInclude Include="..\..\..\src\core\census\rpc_metric_id.h"> <Filter>src\core\census</Filter> </ClInclude> </ItemGroup>