Skip to content
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

Lint influx_tsm; Relates to #4098 #7289

Merged
merged 1 commit into from
Sep 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ There are breaking changes in this release:
- Scripts are now located in `/usr/lib/influxdb/scripts` (previously `/opt/influxdb`)

### Features
- [#4098](https://github.com/influxdata/influxdb/pull/4702): Support 'history' command at CLI
- [#4702](https://github.com/influxdata/influxdb/pull/4702): Support 'history' command at CLI
- [#4098](https://github.com/influxdata/influxdb/issues/4098): Enable `golint` on the code base - uuid subpackage
- [#4141](https://github.com/influxdata/influxdb/pull/4141): Control whether each query should be logged
- [#4065](https://github.com/influxdata/influxdb/pull/4065): Added precision support in cmd client. Thanks @sbouchex
Expand Down
2 changes: 1 addition & 1 deletion cmd/influx_inspect/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (c *cmdExport) writeFiles() error {

// Write out all the DDL
fmt.Fprintln(w, "# DDL")
for key, _ := range c.files {
for key := range c.files {
keys := strings.Split(key, string(byte(os.PathSeparator)))
db, rp := influxql.QuoteIdent(keys[0]), influxql.QuoteIdent(keys[1])
fmt.Fprintf(w, "CREATE DATABASE %s WITH NAME %s\n", db, rp)
Expand Down
1 change: 1 addition & 0 deletions cmd/influx_tsm/b1/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/influxdata/influxdb/tsdb/engine/tsm1"
)

// DefaultChunkSize is the size of chunks read from the b1 shard
const DefaultChunkSize int = 1000

var excludedBuckets = map[string]bool{
Expand Down
8 changes: 4 additions & 4 deletions cmd/influx_tsm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type options struct {
SkipBackup bool
UpdateInterval time.Duration
Yes bool
CpuFile string
CPUFile string
}

func (o *options) Parse() error {
Expand All @@ -73,7 +73,7 @@ func (o *options) Parse() error {
fs.StringVar(&opts.DebugAddr, "debug", "", "If set, http debugging endpoints will be enabled on the given address")
fs.DurationVar(&opts.UpdateInterval, "interval", 5*time.Second, "How often status updates are printed.")
fs.BoolVar(&opts.Yes, "y", false, "Don't ask, just convert")
fs.StringVar(&opts.CpuFile, "profile", "", "CPU Profile location")
fs.StringVar(&opts.CPUFile, "profile", "", "CPU Profile location")
fs.Usage = func() {
fmt.Fprintf(os.Stderr, "Usage: %v [options] <data-path> \n", os.Args[0])
fmt.Fprintf(os.Stderr, "%v\n\nOptions:\n", description)
Expand Down Expand Up @@ -217,8 +217,8 @@ func main() {
}
fmt.Println("Conversion starting....")

if opts.CpuFile != "" {
f, err := os.Create(opts.CpuFile)
if opts.CPUFile != "" {
f, err := os.Create(opts.CPUFile)
if err != nil {
log.Fatal(err)
}
Expand Down
7 changes: 7 additions & 0 deletions cmd/influx_tsm/stats/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,37 @@ type Stats struct {
TotalTime time.Duration
}

// AddPointsRead increments the number of read points.
func (s *Stats) AddPointsRead(n int) {
atomic.AddUint64(&s.PointsRead, uint64(n))
}

// AddPointsWritten increments the number of written points.
func (s *Stats) AddPointsWritten(n int) {
atomic.AddUint64(&s.PointsWritten, uint64(n))
}

// AddTSMBytes increments the number of TSM Bytes.
func (s *Stats) AddTSMBytes(n uint32) {
atomic.AddUint64(&s.TsmBytesWritten, uint64(n))
}

// IncrTSMFileCount increments the number of TSM files created.
func (s *Stats) IncrTSMFileCount() {
atomic.AddUint64(&s.TsmFilesCreated, 1)
}

// IncrNaN increments the number of NaNs filtered.
func (s *Stats) IncrNaN() {
atomic.AddUint64(&s.NanFiltered, 1)
}

// IncrInf increments the number of Infs filtered.
func (s *Stats) IncrInf() {
atomic.AddUint64(&s.InfFiltered, 1)
}

// IncrFiltered increments the number of fields filtered.
func (s *Stats) IncrFiltered() {
atomic.AddUint64(&s.FieldsFiltered, 1)
}