Comments (2)
Here is another example. In this case, I just increased the end of the requested timeframe by 1 hr and am not getting back any data for the last grouping ("pname"=>"c"
).
Query:
SELECT mean(*) FROM mymeasurement WHERE time >= '2019-01-23T15:00:00Z' AND time < '2019-01-23T21:00:00Z' GROUP BY time(1h, 0s), did, pid, pname fill(0)
Influx CLI Response:
name: mymeasurement
tags: did=1, pid=1, pname=a
time mean_allocation mean_usage mean_value
---- --------------- ---------- ----------
1548255600000000000 0 0 0
1548259200000000000 25 0 25
1548262800000000000 25 0 25
1548266400000000000 25 0.04 25
1548270000000000000 25 0 25
1548273600000000000 0 0 0
name: mymeasurement
tags: did=1, pid=2, pname=b
time mean_allocation mean_usage mean_value
---- --------------- ---------- ----------
1548255600000000000 0 0 0
1548259200000000000 2358 0 2358
1548262800000000000 2358 1 2358
1548266400000000000 2358 74.34 2358
1548270000000000000 2358 3208.44 3208.44
1548273600000000000 0 0 0
name: mymeasurement
tags: did=1, pid=3, pname=c
time mean_allocation mean_usage mean_value
---- --------------- ---------- ----------
1548255600000000000 0 0 0
1548259200000000000 5907 75.11 5907
1548262800000000000 5907 40.06 5907
1548266400000000000 5907 721.62 5907
1548270000000000000 5907 3248.08 5907
1548273600000000000 0 0 0
InfluxDB::Client Response:
=> [{"name"=>"mymeasurement",
"tags"=>{"did"=>"1", "pid"=>"1", "pname"=>"a"},
"values"=>
[{"time"=>"2019-01-23T15:00:00Z", "mean_allocation"=>0, "mean_usage"=>0, "mean_value"=>0},
{"time"=>"2019-01-23T16:00:00Z", "mean_allocation"=>25, "mean_usage"=>0, "mean_value"=>25},
{"time"=>"2019-01-23T17:00:00Z", "mean_allocation"=>25, "mean_usage"=>0, "mean_value"=>25},
{"time"=>"2019-01-23T18:00:00Z", "mean_allocation"=>25, "mean_usage"=>0.04, "mean_value"=>25},
{"time"=>"2019-01-23T19:00:00Z", "mean_allocation"=>25, "mean_usage"=>0, "mean_value"=>25},
{"time"=>"2019-01-23T20:00:00Z", "mean_allocation"=>0, "mean_usage"=>0, "mean_value"=>0}]},
{"name"=>"mymeasurement",
"tags"=>{"did"=>"1", "pid"=>"2", "pname"=>"b"},
"values"=>
[{"time"=>"2019-01-23T15:00:00Z", "mean_allocation"=>0, "mean_usage"=>0, "mean_value"=>0},
{"time"=>"2019-01-23T16:00:00Z", "mean_allocation"=>2358, "mean_usage"=>0, "mean_value"=>2358},
{"time"=>"2019-01-23T17:00:00Z", "mean_allocation"=>2358, "mean_usage"=>1, "mean_value"=>2358},
{"time"=>"2019-01-23T18:00:00Z", "mean_allocation"=>2358, "mean_usage"=>74.34, "mean_value"=>2358},
{"time"=>"2019-01-23T19:00:00Z", "mean_allocation"=>2358, "mean_usage"=>3208.44, "mean_value"=>3208.44},
{"time"=>"2019-01-23T20:00:00Z", "mean_allocation"=>0, "mean_usage"=>0, "mean_value"=>0}]}]
The issue seems to be related to the time grouping. If I remove the time grouping from my query:
SELECT mean(*) FROM mymeasurement WHERE time >= '2019-01-23T15:00:00Z' AND time < '2019-01-23T21:00:00Z' GROUP BY did, pid, pname fill(0)
I am getting data back for that grouping:
=> [{"name"=>"mymeasurement",
"tags"=>{"did"=>"1", "pid"=>"1", "pname"=>"a"},
"values"=>[{"time"=>"2019-01-23T15:00:00Z", "mean_allocation"=>25, "mean_usage"=>0.01, "mean_value"=>25}]},
{"name"=>"mymeasurement",
"tags"=>{"did"=>"1", "pid"=>"2", "pname"=>"b"},
"values"=>[{"time"=>"2019-01-23T15:00:00Z", "mean_allocation"=>2358, "mean_usage"=>820.945, "mean_value"=>2570.61}]},
{"name"=>"mymeasurement",
"tags"=>{"did"=>"1", "pid"=>"3", "pname"=>"c"},
"values"=>[{"time"=>"2019-01-23T15:00:00Z", "mean_allocation"=>5907, "mean_usage"=>1021.2175, "mean_value"=>5907}]}]
from influxdb-ruby.
Put some binding.prys
in the http.rb
file and it looks like I'm getting a partial response back from Influx. Starting to think this is an issue with our max-row-limit
config. Strange that I wouldn't see the same behavior in the Influx CLI, but I got in touch with our DBA and will close this out as soon as I confirm that is the issue.
from influxdb-ruby.
Related Issues (20)
- Count of results returned by query() is not equal to the number of queries passed HOT 11
- Example from README wrong about time-precision? HOT 8
- missing delete_measurement method HOT 3
- create or alter retention policy function not working for database containing hyphen '-' in database name HOT 4
- Travis/Ruby 2.2: Limit Rubygems version while updating
- Issue when writing a tag value ending in a back slash HOT 4
- Tags data saved as values HOT 2
- NET::HTTP NoMethodError Exception: undefined method `include?' for nil:NilClass
- Flux queries HOT 1
- persistent connection HOT 1
- Deprecated use of 'DROP DATABASE foo' in a read only context, please use a POST request instead HOT 1
- create_database explodes HOT 2
- InfluxDB Beta is changing the default port from 9999 to 8086 in the next release
- Support Ruby 3.0
- query builder: "warning: too many arguments for format string"
- Support for gzip post requests
- "/" character in query gives error HOT 1
- InfluxDB::Client is never garbage collected HOT 5
- Identify repo owner and move to InfluxCommunity org HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from influxdb-ruby.