googleinterns / cloud-operations-api-mock

Apache License 2.0
5 stars 2 forks source link

Add custom RPC to fetch number of spans #16

Closed the-ericwang35 closed 4 years ago

the-ericwang35 commented 4 years ago

Since the trace service doesn't provide any RPCs for retrieving info about the spans created (something that multiple exporter tests currently uses), we'll have to add some custom RPCs for testing purposes.

Since we're using genproto for the trace service, we cannot just add the custom RPCs to the original service, so we'll have to create our own (called it mock_trace_service.proto). This service currently contains one method, GetNumSpans, which returns the number of spans currently stored on the server.

This PR also takes care of this issue, since the unit test for this new RPC involves concurrency.