-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: add influx support(not implement test case) and has some todo item #281
base: main
Are you sure you want to change the base?
Conversation
To be implemented test case, it is expected to initiate a formal merger tomorrow. @yufeiyu |
Please make sure all checks passed. |
@@ -3,6 +3,7 @@ package app | |||
import ( | |||
"context" | |||
"flag" | |||
"github.com/gocrane/crane/pkg/providers/influxdb" |
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.
import group
package influxdb | ||
|
||
import ( | ||
gocontext "context" |
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.
import group
import ( | ||
gocontext "context" | ||
"github.com/gocrane/crane/pkg/common" | ||
"github.com/gocrane/crane/pkg/metricnaming" | ||
"github.com/gocrane/crane/pkg/metricquery" | ||
"github.com/gocrane/crane/pkg/providers" | ||
"k8s.io/klog/v2" | ||
"time" | ||
) |
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.
Suggeset to follow a policy of grouping imports in 3~4 groups,e.g.:
import (
build-in-stdlib
current project/repo
all others
)
prefer:
import (
"time"
gocontext "context"
"github.com/gocrane/crane/pkg/common"
"github.com/gocrane/crane/pkg/metricnaming"
"github.com/gocrane/crane/pkg/metricquery"
"github.com/gocrane/crane/pkg/providers"
"k8s.io/klog/v2"
)
} | ||
|
||
|
||
func (i *influxDB) QueryTimeSeries(namer metricnaming.MetricNamer, startTime time.Time, endTime time.Time, step time.Duration) ([]*common.TimeSeries, error) { |
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.
Exported type or method should have comment or be unexported:
// QueryTimeSeries xxx xxx
func (i *influxDB) QueryTimeSeries(......
return timeSeries, nil | ||
} | ||
|
||
func (i *influxDB) QueryLatestTimeSeries(namer metricnaming.MetricNamer) ([]*common.TimeSeries, error) { |
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.
ditto. add comment
Sorry, I didn't fully finish this PR before, I will re-update this PR this weekend. |
What type of PR is this?
support influxDB, solved #119