Fix bug in stress script, remove extraneous printlns

pull/3717/head
Paul Dix 2015-08-11 20:55:41 -07:00
parent 48ede78d98
commit 6776014047
5 changed files with 3 additions and 11 deletions

View File

@ -17,7 +17,7 @@ var (
batchSize = flag.Int("batchsize", 5000, "number of points per batch")
seriesCount = flag.Int("series", 10000, "number of unique series to create")
pointCount = flag.Int("points", 100, "number of points per series to create")
concurrency = flag.Int("concurrency", 1, "number of simultaneous writes to run")
concurrency = flag.Int("concurrency", 10, "number of simultaneous writes to run")
batchInterval = flag.Duration("batchinterval", 0*time.Second, "duration between batches")
database = flag.String("database", "stress", "name of database")
address = flag.String("addr", "localhost:8086", "IP address and port of database (e.g., localhost:8086)")
@ -62,9 +62,8 @@ func main() {
counter.Increment()
totalPoints += len(batch.Points)
go func(b *client.BatchPoints, total int) {
fmt.Println("WRITING: ", len(b.Points))
st := time.Now()
if _, err := c.Write(*batch); err != nil {
if _, err := c.Write(*b); err != nil {
fmt.Println("ERROR: ", err.Error())
} else {
mu.Lock()

View File

@ -81,7 +81,7 @@ func NewHandler(requireAuthentication, loggingEnabled, writeTrace bool) *Handler
mux: pat.New(),
requireAuthentication: requireAuthentication,
Logger: log.New(os.Stderr, "[http] ", log.LstdFlags),
loggingEnabled: false,
loggingEnabled: loggingEnabled,
WriteTrace: writeTrace,
}

View File

@ -277,7 +277,6 @@ func (e *Engine) writeIndex(tx *bolt.Tx, key string, a [][]byte) error {
}
// Create or retrieve series bucket.
fmt.Println("WRITE: ", key, len(key))
bkt, err := tx.Bucket([]byte("points")).CreateBucketIfNotExists([]byte(key))
if err != nil {
return fmt.Errorf("create series bucket: %s", err)
@ -471,7 +470,6 @@ type Tx struct {
// Cursor returns an iterator for a key.
func (tx *Tx) Cursor(key string) tsdb.Cursor {
fmt.Println("CURSOR: ", key)
walCursor := tx.wal.Cursor(key)
// Retrieve points bucket. Ignore if there is no bucket.
@ -499,7 +497,6 @@ type Cursor struct {
func (c *Cursor) Seek(seek []byte) (key, value []byte) {
// Move cursor to appropriate block and set to buffer.
_, v := c.cursor.Seek(seek)
fmt.Println("SEEK: ", key, v)
c.setBuf(v)
// Read current block up to seek position.
@ -559,7 +556,6 @@ func (c *Cursor) setBuf(block []byte) {
c.buf = c.buf[0:0]
log.Printf("block decode error: %s", err)
}
fmt.Println("setBuf: ", buf)
c.buf, c.off = buf, 0
}
@ -573,7 +569,6 @@ func (c *Cursor) read() (key, value []byte) {
// Otherwise read the current entry.
buf := c.buf[c.off:]
dataSize := entryDataSize(buf)
fmt.Println("read: ", buf, dataSize, len(buf), entryHeaderSize, entryHeaderSize+dataSize)
return buf[0:8], buf[entryHeaderSize : entryHeaderSize+dataSize]
}

View File

@ -220,7 +220,6 @@ func (l *Log) Cursor(key string) tsdb.Cursor {
}
func (l *Log) WritePoints(points []tsdb.Point) error {
fmt.Println("WRITING: ", len(points))
partitionsToWrite := l.pointsToPartitions(points)
// get it to disk

View File

@ -149,7 +149,6 @@ type SeriesCreate struct {
// WritePoints will write the raw data points and any new metadata to the index in the shard
func (s *Shard) WritePoints(points []Point) error {
fmt.Println("SHARD: ", len(points))
seriesToCreate, fieldsToCreate, err := s.validateSeriesAndFields(points)
if err != nil {
return err