-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[query] add an endpoint to ingest results #2224
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2224 +/- ##
========================================
+ Coverage 72.4% 72.4% +<.1%
========================================
Files 1023 1023
Lines 89094 89067 -27
========================================
+ Hits 64551 64561 +10
+ Misses 20202 20181 -21
+ Partials 4341 4325 -16
Continue to review full report at Codecov.
|
} | ||
|
||
// GetOrGenID gets the ID for this result. | ||
func (r *Series) GetOrGenID() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super nit: IDOrGenID()
? Since Go keeps harping on about removing word "Get.." prefix on getter like things?
name := q.opts.tagOptions.MetricName() | ||
for _, matcher := range query.TagMatchers { | ||
if bytes.Equal(name, matcher.Name) { | ||
iters = q.handler.getSeriesIterators(string(matcher.Value)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Do you want to break if you set iters
to something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call
@@ -0,0 +1,201 @@ | |||
// Copyright (c) 2019 Uber Technologies, Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops thought i got them all 👍
|
||
buf := []byte(series[0]) | ||
seriesList := make([]parser.Series, 0, 10) | ||
if err := json.Unmarshal(buf, &series); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, any reason not to just unmarshal the whole request body rather than something in the "series" encoded form contents?
i.e.
type seriesLoadRequest struct {
Series []parser.Series `json:"series"`
}
func (l *seriesLoadHandler) serveHTTP(r *http.Request) error {
defer r.Body.Close()
var req seriesLoadRequest
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
// ....
}
Just seems slighlty non-standard to encode to JSON, then to encode to multipart-form, rather than just single level of serialization (i.e. just JSON).
} | ||
} | ||
|
||
if l.nameIDSeriesMap == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: This should never be nil since you create it in the constructor yeah?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops yeah, old path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM other than minor comments/nits
…nikola/comparator-load
No description provided.