Documentation ¶
Overview ¶
Package promremotetest provides test utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestPromServer ¶
type TestPromServer struct {
// contains filtered or unexported fields
}
TestPromServer is a fake http server handling prometheus remote write. Intended for test usage.
func NewServer ¶
func NewServer(t *testing.T) *TestPromServer
NewServer creates new instance of a fake server.
func (*TestPromServer) GetLastWriteRequest ¶
func (s *TestPromServer) GetLastWriteRequest() *prompb.WriteRequest
GetLastWriteRequest returns the last recorded write request.
func (*TestPromServer) SetError ¶
func (s *TestPromServer) SetError(body string, status int)
SetError sets error that will be returned for all incoming requests.
func (*TestPromServer) WriteAddr ¶
func (s *TestPromServer) WriteAddr() string
WriteAddr returns http address of a write endpoint.
Click to show internal directories.
Click to hide internal directories.