android13/external/opencensus-java/examples
liiir1985 7f62dcda9f initial 2024-06-22 20:45:49 +08:00
..
gradle/wrapper initial 2024-06-22 20:45:49 +08:00
src/main initial 2024-06-22 20:45:49 +08:00
BUILD.bazel initial 2024-06-22 20:45:49 +08:00
README.md initial 2024-06-22 20:45:49 +08:00
WORKSPACE initial 2024-06-22 20:45:49 +08:00
build.gradle initial 2024-06-22 20:45:49 +08:00
gradlew initial 2024-06-22 20:45:49 +08:00
gradlew.bat initial 2024-06-22 20:45:49 +08:00
opencensus_workspace.bzl initial 2024-06-22 20:45:49 +08:00
pom.xml initial 2024-06-22 20:45:49 +08:00
settings.gradle initial 2024-06-22 20:45:49 +08:00

README.md

OpenCensus Examples

To build the examples use

Gradle

$ ./gradlew installDist

Maven

$ mvn package appassembler:assemble

Bazel

$ bazel build :all

To run "TagContextExample" use

Gradle

$ ./build/install/opencensus-examples/bin/TagContextExample

Maven

$ ./target/appassembler/bin/TagContextExample

Bazel

$ ./bazel-bin/TagContextExample

To run "ZPagesTester"

Gradle

$ ./build/install/opencensus-examples/bin/ZPagesTester

Maven

$ ./target/appassembler/bin/ZPagesTester

Bazel

$ ./bazel-bin/ZPagesTester

Available pages:

To run "QuickStart" example use

Gradle

$ ./build/install/opencensus-examples/bin/QuickStart

Maven

$ ./target/appassembler/bin/QuickStart

Bazel

$ ./bazel-bin/QuickStart

To run "gRPC Hello World" example use

Please note all the arguments are optional. If you do not specify these arguments, default values will be used:

  • host and serverPort will be "localhost:50051"
  • user will be "world"
  • cloudProjectId will be null (which means no stats/spans will be exported to Stackdriver)
  • server zPagePort will be 3000
  • client zPagePort will be 3001
  • Prometheus port will be 9090

However, if you want to specify any of these arguements, please make sure they are in order.

Gradle

$ ./build/install/opencensus-examples/bin/HelloWorldServer serverPort cloudProjectId zPagePort prometheusPort
$ ./build/install/opencensus-examples/bin/HelloWorldClient user host serverPort cloudProjectId zPagePort

Maven

$ ./target/appassembler/bin/HelloWorldServer serverPort cloudProjectId zPagePort prometheusPort
$ ./target/appassembler/bin/HelloWorldClient user host serverPort cloudProjectId zPagePort

Bazel

$ ./bazel-bin/HelloWorldServer serverPort cloudProjectId zPagePort prometheusPort
$ ./bazel-bin/HelloWorldClient user host serverPort cloudProjectId zPagePort