-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
pkg/gelpoc/nodes.go
Outdated
query: rn.Query, | ||
timeRange: tr, | ||
intervalMS: 1000, | ||
maxDP: 5000, |
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.
intervalMS
and maxDP
could be constants?
if !ok { | ||
return nil, fmt.Errorf("expected datasourceId to be a float64, got %T for refId %v", rawDsID, rn.RefID) | ||
} | ||
dsNode.datasourceID = int64(floatDsID) |
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.
Why datasourceId
should be float64
in the first place?
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.
Since the json is decoded into map[string]interface{}
all the numbers become floats. Could use https://golang.org/pkg/encoding/json/#Decoder.UseNumber to make it a json.Number
but I don't think it really matters in these cases.
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.
I see
if !ok { | ||
return nil, fmt.Errorf("expected orgId to be a float64, got %T for refId %v", rawOrgID, rn.RefID) | ||
} | ||
dsNode.orgID = int64(floatOrgID) |
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.
Same here, why orgId
should be float64
in the first place?
if floatMaxDP, ok = rawMaxDP.(float64); !ok { | ||
return nil, fmt.Errorf("expected maxDataPoints to be an float64, got %T for refId %v", rawMaxDP, rn.RefID) | ||
} | ||
dsNode.maxDP = int64(floatMaxDP) |
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.
Same here, why intervalMs
and maxDataPoints
should be float64
in the first place?
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! That was a good introduction to the GEL code.
I have some questions.
removes
grafana/grafana
dependency.