Skip to content

Conversation

Belyenochi
Copy link

What type of PR is this?

support influxDB, solved #119

@Belyenochi
Copy link
Author

To be implemented test case, it is expected to initiate a formal merger tomorrow. @yufeiyu

@qmhu qmhu added this to the 0.5.0 milestone Apr 25, 2022
@yufeiyu
Copy link
Contributor

yufeiyu commented Apr 25, 2022

Please make sure all checks passed.

import (
"context"
"flag"
"github.com/gocrane/crane/pkg/providers/influxdb"
Copy link
Member

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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import group

Comment on lines +3 to +11
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"
)

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

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto. add comment

@Belyenochi
Copy link
Author

Sorry, I didn't fully finish this PR before, I will re-update this PR this weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants