-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(influxdb): update the import path of influxdb lib to the new one
This also upgrades it to the latest version and adds a benchmark which shows some less allocation: name old time/op new time/op delta Influxdb1Second-4 3.56ms ± 0% 3.56ms ± 1% ~ (p=0.841 n=5+5) Influxdb2Second-4 12.1ms ± 0% 12.1ms ± 0% ~ (p=0.095 n=5+5) Influxdb100Milliseconds-4 341µs ± 1% 333µs ± 1% -2.34% (p=0.008 n=5+5) name old alloc/op new alloc/op delta Influxdb1Second-4 19.1kB ± 0% 16.6kB ± 0% -13.37% (p=0.008 n=5+5) Influxdb2Second-4 18.8kB ± 0% 16.2kB ± 0% -13.63% (p=0.016 n=5+4) Influxdb100Milliseconds-4 18.7kB ± 0% 16.1kB ± 0% -13.72% (p=0.008 n=5+5) name old allocs/op new allocs/op delta Influxdb1Second-4 291 ± 0% 231 ± 0% -20.62% (p=0.008 n=5+5) Influxdb2Second-4 291 ± 0% 231 ± 0% -20.62% (p=0.008 n=5+5) Influxdb100Milliseconds-4 291 ± 0% 231 ± 0% -20.62% (p=0.008 n=5+5) The same test as in fce3884 gets 6909 RPS with 2.5GB of memory usage so a considerate bump in rps for small amount of memory.
- Loading branch information
Showing
20 changed files
with
460 additions
and
337 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package influxdb | ||
|
||
import ( | ||
"io" | ||
"io/ioutil" | ||
"net/http" | ||
"testing" | ||
"time" | ||
|
||
"github.com/loadimpact/k6/stats" | ||
) | ||
|
||
func benchmarkInfluxdb(b *testing.B, t time.Duration) { | ||
testCollectorCycle(b, func(rw http.ResponseWriter, r *http.Request) { | ||
for { | ||
time.Sleep(t) | ||
m, _ := io.CopyN(ioutil.Discard, r.Body, 1<<18) // read 1/4 mb a time | ||
if m == 0 { | ||
break | ||
} | ||
} | ||
rw.WriteHeader(204) | ||
}, func(tb testing.TB, c *Collector) { | ||
b = tb.(*testing.B) | ||
b.ResetTimer() | ||
|
||
var samples = make(stats.Samples, 10) | ||
for i := 0; i < len(samples); i++ { | ||
samples[i] = stats.Sample{ | ||
Metric: stats.New("testGauge", stats.Gauge), | ||
Time: time.Now(), | ||
Tags: stats.NewSampleTags(map[string]string{ | ||
"something": "else", | ||
"VU": "21", | ||
"else": "something", | ||
}), | ||
Value: 2.0, | ||
} | ||
} | ||
|
||
b.ResetTimer() | ||
for i := 0; i < b.N; i++ { | ||
c.Collect([]stats.SampleContainer{samples}) | ||
time.Sleep(time.Nanosecond * 20) | ||
} | ||
}) | ||
} | ||
|
||
func BenchmarkInfluxdb1Second(b *testing.B) { | ||
benchmarkInfluxdb(b, time.Second) | ||
} | ||
|
||
func BenchmarkInfluxdb2Second(b *testing.B) { | ||
benchmarkInfluxdb(b, 2*time.Second) | ||
} | ||
|
||
func BenchmarkInfluxdb100Milliseconds(b *testing.B) { | ||
benchmarkInfluxdb(b, 100*time.Millisecond) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
62 changes: 0 additions & 62 deletions
62
vendor/github.com/influxdata/influxdb/LICENSE_OF_DEPENDENCIES.md
This file was deleted.
Oops, something went wrong.
48 changes: 0 additions & 48 deletions
48
vendor/github.com/influxdata/influxdb/models/consistency.go
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
.../influxdata/influxdb/models/inline_fnv.go → ...ata/influxdb1-client/models/inline_fnv.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...a/influxdb/models/inline_strconv_parse.go → ...db1-client/models/inline_strconv_parse.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.