Commit Graph

11076 Commits (1f31e8b70778c80a1bbfca0e3437f52eb26c3e7a)

Author SHA1 Message Date
Michael Desa 6c520c0b79 Merge pull request #7421 from influxdata/md-scrub-auth
Prevent writing auth command to influx_history
2016-10-07 08:37:46 -07:00
Jonathan A. Sternberg 6afc2a77a5 Implement cumulative_sum() function
The `cumulative_sum()` function can be used to sum each new point and
output the current total. For the following points:

    cpu value=2 0
    cpu value=4 10
    cpu value=6 20

This would output the following points:

    > SELECT cumulative_sum(value) FROM cpu
    time    value
    ----    -----
    0       2
    10      6
    20      12

As can be seen, each new point adds to the sum of the previous point and
outputs the value with the same timestamp.

The function can also be used with an aggregate like `derivative()`.

    > SELECT cumulative_sum(mean(value) FROM cpu WHERE time >= now() - 10m GROUP BY time(1m)
2016-10-07 10:11:53 -05:00
Michael Desa 616d4d28d3 Merge pull request #7415 from influxdata/md-sample
Add sample function to query language
2016-10-06 10:04:16 -07:00
Jason Wilder 5427ba2db7 Merge pull request #7413 from influxdata/jw-merge-102
Merge 1.0 branch
2016-10-06 10:49:18 -06:00
Michael Desa f9b8129770 Add sample function to query language
First Pass at implementing sample

Add sample iterators for all types

Remove size from sample struct

Fix off by one error when generating random number

Add benchmarks for sample iterator

Add test and associated fixes for off by one error

Add test for sample function

Remove NumericLiteral from sample function call

Make clear that the counter is incr w/ each call

Rename IsRandom to AllSamplesSeen

Add a rng for each reducer that is created

The default rng that comes with math/rand has a global lock. To avoid
having to worry about any contention on the lock, each reducer now has
its own time seeded rng.

Add sample function to changelog
2016-10-06 09:41:42 -07:00
Michael Desa 1030306d3e Prevent writing auth command to influx_history 2016-10-06 09:30:04 -07:00
Jason Wilder ebf50d06ca Merge branch '1.0' into jw-merge-102 2016-10-06 09:51:35 -06:00
Jason Wilder ff30704705 Update 1.0.2 release date 2016-10-05 13:19:17 -06:00
Michael Desa fc57c0f7c6 Merge pull request #7403 from influxdata/md-fill-average
Add fill(linear) to query language
2016-10-05 10:40:02 -07:00
Jason Wilder 7e2ae153a2 Merge pull request #7407 from influxdata/jw-7330
Fix subscriber service dropping writes under high write load
2016-10-04 20:01:04 -06:00
Michael Desa 966e5503bf Add fill(linear) to query language
Clean up template for fill average

Change fill(average) to fill(linear)

Update average to linear in infuxql spec

Add Integer Tests and associated fixes

Update CHANGELOG for fill(linear)
2016-10-04 14:27:04 -07:00
Jason Wilder ea21588b9e Fix subscriber service dropping writes under high write load
The subscriber write goroutine would drop points if the write load
was higher than it could process.  This could happen with a just
a few writers to the server.

Instead, process the channel with multiple writers to avoid dropping
writes so easily.  This also adds some config options to control how
large the channel buffer is as well as how many goroutines are started.

Fixes #7330
2016-10-04 14:47:36 -06:00
Nathaniel Cook 91645c05cf Merge pull request #7392 from mglazer/feature/https-subscriber
Fix Kapacitor Issue #942: HTTPS subscriptions don't work
2016-10-04 14:45:05 -06:00
Mike Glazer 1feca0623c CHANGELOG updated 2016-10-04 20:58:37 +02:00
Mike Glazer fa3609b251 Fix Kapacitor Issue #942: HTTPS subscriptions don't work 2016-10-04 20:58:31 +02:00
Jason Wilder 8e35dd3db7 Merge pull request #7389 from influxdata/jl-write-perf
models: Add FieldIterator type
2016-10-04 09:06:06 -06:00
Jason Wilder 798fa0a9f8 Return error with unknown field type
This will just panic when trying to snapshot the value because EmptyValue
can't be written to TSM files.
2016-10-03 16:30:21 -06:00
Jason Wilder 125f106956 Pre-size the values map when write points 2016-10-03 16:30:21 -06:00
Jason Wilder 2ae6b5e1ed Replace uses of newFieldsFromBinary with FieldIterator 2016-10-03 16:30:21 -06:00
Joe LeGasse 743946fafb models: Add FieldIterator type
The FieldIterator is used to scan over the fields of a point, providing
information, and delaying parsing/decoding the value until it is needed.
This change uses this new type to avoid the allocation of a map for the
fields which is then thrown away as soon as the points get converted
into columns within the datastore.
2016-10-03 16:30:21 -06:00
Jason Wilder aeb84b3737 Merge pull request #7400 from influxdata/jw-encoder-allocs
Use decoder pools
2016-10-03 14:18:22 -06:00
Jason Wilder 20f1fb3f7f Replace gotos with anonymous functions 2016-10-03 12:08:53 -06:00
Jason Wilder 750c8b3932 Reduce lock contention in cache.Values
The cache read lock was held for the whole duration of the call when it
only needs to be held at the beginning since entries have their
own locks.
2016-10-03 10:21:54 -06:00
Jason Wilder 1b462312a9 Re-use decoder pools
The decoders were held onto each iterator to avoid creating them all
the time.  Some of them have use quite a bit of memory so they can
be expensive to create when querying across many series.

Intead, more them to a re-usable pool where we create the minimum that
could active be in use.  This reduces garbage as well as makes the iterators
less expensive to create.
2016-10-03 10:21:54 -06:00
Jason Wilder 2c0d5b10aa Merge pull request #7399 from influxdata/jw-backport
Backport 1.0.2 Fixes
2016-10-03 09:58:05 -06:00
Jason Wilder f727effd7f Merge pull request #7385 from influxdata/jw-query-allocs
Reduce query planning allocations
2016-10-03 09:08:36 -06:00
Jason Wilder ac4ae1a866 Update changelog for backported issue 2016-10-03 08:58:15 -06:00
Jason Wilder f251db013c Avoid stat syscall when planning compactions
When the planner runs, it needs to determine if any files have tombstones.
The code to determine if a tombstone existed involved stating the .tombstone
file.  Since the planner runs very frequently when there are many shards, this
causea a lot of system calls that are unnecessary.

Instead, cache the results of the stats calls and only refresh them when we
haven't checked at least once or we write new tombstone data.

This also caches the results of the TSMReader.Stats call to avoid creating
garbage.
2016-10-03 08:36:05 -06:00
Jason Wilder 4f37cc6572 Fix backport issues 2016-10-03 08:31:32 -06:00
Jason Wilder 2898f3dacf Fix decoding RLE integer blocks with negative deltas
Integer blocks that were run length encoded could produce the wrong
value when read back out because the deltas were not zig zag decoded
before scaling the final value.  If the deltas were negative, as would
be seen in a counter that decrements by a constant value, the results
would be random with som negative and positive values.

Fixes #7391
2016-10-03 08:25:28 -06:00
Jason Wilder 656fc62dbb Merge pull request #7397 from influxdata/jw-7391
Fix decoding RLE integer blocks with negative deltas
2016-10-03 08:24:12 -06:00
Edd Robinson 601d440670 Merge pull request #7370 from influxdata/er-1.0-sg-fix
Ensure correct shard groups created when RP has been altered
2016-10-03 12:28:49 +01:00
Edd Robinson 2489e74c2f Merge pull request #7387 from influxdata/er-pprof
Ensure pprof-enabled config option is respected
2016-10-03 11:05:30 +01:00
Jason Wilder a15a416eaa Fix decoding RLE integer blocks with negative deltas
Integer blocks that were run length encoded could produce the wrong
value when read back out because the deltas were not zig zag decoded
before scaling the final value.  If the deltas were negative, as would
be seen in a counter that decrements by a constant value, the results
would be random with som negative and positive values.

Fixes #7391
2016-10-02 23:51:29 -06:00
Edd Robinson 537316eb7b Ensure pprof-enabled config option is respected 2016-09-30 18:41:38 +01:00
Edd Robinson fb5d3c5131 Ensure points map to correct shard groups 2016-09-30 13:58:56 +01:00
Joe LeGasse 9d26cc0732 Stablize the sorting of meta.ShardGroupInfos 2016-09-30 13:58:03 +01:00
Jason Wilder 68dd312bb1 Reduce allocations when calculating tagsets
The TagSets function was creating a lot of intermediate maps and
slices to calculate the sorted tag sets.  It first creates a map
to group tag sets with their series, it then created an equally
sized slice of the tag keys and sorted then.  Finally, it created
a new slice and added the tag sets in the original map by the ordering
of the sorted keys.  It was also recreating the tags map multiple time
creating extra garbage in the loop.

This simplifies the code to create one map for grouping and than adding
the distinct sets to a slice which is then sorted.  It also fixes the
multple tag maps getting created.
2016-09-29 16:02:29 -06:00
Jason Wilder a3fd12198e Avoid extra allocations when evalating binary expressions 2016-09-29 13:18:38 -06:00
Mark Rushakoff 11cf759652 Merge pull request #7383 from influxdata/mr-shard-stats-walpath-tag
Add walPath tag to shard stats
2016-09-29 11:01:40 -07:00
Mark Rushakoff 97c2f6f5c1 Add walPath tag to shard stats
Without the WAL path as a tag, the diskBytes field looked like it was
reporting the size of the data directory incorrectly.

Fixes #7382.
2016-09-29 10:19:11 -07:00
Mark Rushakoff 97ea1cd32d Merge pull request #7384 from influxdata/mr-appveyor-go17
Use built-in Go 1.7 in Appveyor
2016-09-29 10:16:59 -07:00
Mark Rushakoff 24de4ca3f2 Use built-in Go 1.7 in Appveyor
See available versions of Go at
https://www.appveyor.com/docs/installed-software/#go
2016-09-29 10:07:29 -07:00
Jason Wilder b42a2316b1 Merge pull request #7324 from miry/go1.7.1
Use go 1.7.1 for testing
2016-09-29 09:40:55 -06:00
Jonathan A. Sternberg ea8a57233f Merge pull request #7372 from influxdata/js-7150-alter-retention-policy-resets-sg-duration
Do not automatically reset the shard duration when using ALTER RETENTION POLICY
2016-09-28 15:45:35 -05:00
Jason Wilder 6e7da3d24a Merge pull request #7379 from influxdata/jw-meta-clone
Don't clone the cached meta store
2016-09-28 11:52:43 -06:00
Jonathan A. Sternberg bb8c4efa95 Do not automatically reset the shard duration when using ALTER RETENTION POLICY 2016-09-28 12:26:03 -05:00
Jason Wilder bc00490b92 Don't clone the cached meta store
The cacheData is read-only and does not need to be cloned.  Cloning
it for read operations can be expensive with lots of shards/database/RPs/etc.
2016-09-28 10:35:59 -06:00
Jason Wilder dcb65865a2 Merge pull request #7376 from influxdata/jw-revert
Revert re-using byte slices during compactions
2016-09-28 08:24:35 -06:00
joelegasse 87ecd97e7b Merge pull request #7371 from influxdata/2016-09-27--rw--use-gotos-for-encoding-cleanup
Gotos to simplify uses of the new encoder pools.
2016-09-28 08:57:33 -04:00