Beispiel #1
0
func benchmarkDbCommon(db storage.Engine, c Config) {
	fmt.Printf("################ Benchmarking: %s\n", db.Name())
	start := time.Now()

	count := benchmarkWrites(db, &c, c.points)

	d := time.Now().Sub(start)

	fmt.Printf("Writing %d points in batches of %d points took %s (%f microsecond per point)\n",
		count,
		c.batch,
		d,
		float64(d.Nanoseconds())/1000.0/float64(count),
	)

	timeQuerying(db, c.series)
	fmt.Printf("Size: %s\n", getSize(db.Path()))
	queryAndDelete(db, c.points, c.series)
	timeQuerying(db, c.series)
	fmt.Printf("Size: %s\n", getSize(db.Path()))

	start = time.Now()
	count = benchmarkWrites(db, &c, c.points/2)
	d = time.Now().Sub(start)
	fmt.Printf("Writing %d points in batches of %d points took %s (%f microsecond per point)\n",
		count,
		c.batch,
		d,
		float64(d.Nanoseconds())/1000.0/float64(count),
	)
	fmt.Printf("Size: %s\n", getSize(db.Path()))
}