Documentation
¶
Overview ¶
Package metricstest hosts an in-process fake Cloud Monitoring server used by both bigtable/internal/metrics/*_test.go and the top-level bigtable/metrics_test.go integration tests. Kept in a dedicated package so both callers share one implementation instead of duplicating ~200 lines of gRPC test scaffolding.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
Server is an in-process fake implementation of google.monitoring.v3.MetricService. Tests use it to capture the CreateServiceTimeSeries / CreateMetricDescriptor calls the metrics exporter would otherwise send to Cloud Monitoring.
func NewServer ¶
NewServer stands up a fresh in-process fake Cloud Monitoring server on 127.0.0.1:<random-free-port>. Call Serve() from a goroutine and Shutdown() from a defer.
func (*Server) CreateServiceTimeSeriesRequests ¶
func (m *Server) CreateServiceTimeSeriesRequests() []*monitoringpb.CreateTimeSeriesRequest
CreateServiceTimeSeriesRequests pops the CreateTimeSeriesRequest batches captured so far.