Skip to content

feat: add influx support(not implement test case) and has some todo item#281

Open
Belyenochi wants to merge 2 commits intogocrane:mainfrom
Belyenochi:feat/influxdb_support
Open

feat: add influx support(not implement test case) and has some todo item#281
Belyenochi wants to merge 2 commits intogocrane:mainfrom
Belyenochi:feat/influxdb_support

Conversation

@Belyenochi
Copy link
Copy Markdown

What type of PR is this?

support influxDB, solved #119

@Belyenochi
Copy link
Copy Markdown
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
Copy Markdown
Contributor

yufeiyu commented Apr 25, 2022

Please make sure all checks passed.

import (
"context"
"flag"
"github.com/gocrane/crane/pkg/providers/influxdb"
Copy link
Copy Markdown
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
Copy Markdown
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"
)
Copy link
Copy Markdown

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) {
Copy link
Copy Markdown

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) {
Copy link
Copy Markdown

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
Copy Markdown
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