Change AllMeasurements to GetMeasurements to be precise & update comment

pull/10616/head
Jared Scheib 2018-03-30 14:27:58 -07:00
parent 05b11f8172
commit 61d8a1c975
3 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -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)
}

View File

@ -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)