Change AllMeasurements to GetMeasurements to be precise & update comment
parent
05b11f8172
commit
61d8a1c975
|
@ -493,7 +493,7 @@ type Databases interface {
|
|||
UpdateRP(context.Context, string, string, *RetentionPolicy) (*RetentionPolicy, error)
|
||||
DropRP(context.Context, string, string) error
|
||||
|
||||
AllMeasurements(ctx context.Context, db string, limit, offset int) ([]Measurement, error)
|
||||
GetMeasurements(ctx context.Context, db string, limit, offset int) ([]Measurement, error)
|
||||
}
|
||||
|
||||
// Annotation represents a time-based metadata associated with a source
|
||||
|
|
|
@ -151,8 +151,10 @@ func (c *Client) DropRP(ctx context.Context, database string, rp string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// AllMeasurements returns all measurements for a specific database
|
||||
func (c *Client) AllMeasurements(ctx context.Context, database string, limit, offset int) ([]chronograf.Measurement, error) {
|
||||
// GetMeasurements returns measurements for a specific database. It allows for
|
||||
// paging via limit and offset. If no limit or offset is provided, it returns
|
||||
// all measurements.
|
||||
func (c *Client) GetMeasurements(ctx context.Context, database string, limit, offset int) ([]chronograf.Measurement, error) {
|
||||
return c.showMeasurements(ctx, database, limit, offset)
|
||||
}
|
||||
|
||||
|
|
|
@ -457,7 +457,7 @@ func (h *Service) Measurements(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
dbID := httprouter.GetParamFromContext(ctx, "dbid")
|
||||
measurements, err := db.AllMeasurements(ctx, dbID, limit, offset)
|
||||
measurements, err := db.GetMeasurements(ctx, dbID, limit, offset)
|
||||
if err != nil {
|
||||
msg := fmt.Sprintf("Unable to get measurements %d: %v", srcID, err)
|
||||
Error(w, http.StatusBadRequest, msg, h.Logger)
|
||||
|
|
Loading…
Reference in New Issue