Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with limit setting -> it is not set #391

Open
mcuiobroker opened this issue May 7, 2024 · 3 comments
Open

Problem with limit setting -> it is not set #391

mcuiobroker opened this issue May 7, 2024 · 3 comments

Comments

@mcuiobroker
Copy link

Describe the bug
https://forum.iobroker.net/topic/52228/howto-zusatz-programme-fuer-jarvis-v3/586 and ff
The questioning in

if (!options.count || isNaN(options.count)) {

is not used, because you set count in options before.

To Reproduce
Steps to reproduce the behavior:
sendTo with

0_userdata.0.PV.SignedBat17150970902550.21461031104686312 getHistory message: {"id":"0_userdata.0.PV.SignedBat","options":{"start":1715010686903,"end":1715097086903,"aggregate":"onchange","limit":5000,"ignoreNull":true}}

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots & Logfiles
If applicable, add screenshots and logfiles to help explain your problem.

Versions:

  • Adapter version: 4.0.2
  • JS-Controller version: 5.0.19
  • Node version: 18.0.2
  • Operating system: linux

Additional context
Add any other context about the problem here.

@Apollon77
Copy link
Contributor

Please enable the debug mode of influxdb adapter, additionally enable for one affected objects the enhanced debig lkogging in the object custommsettngs. Then please post a log of such a getHistory call. thank you

@mcuiobroker
Copy link
Author

Send: 502 of: 501 in: 70ms
0_userdata.0.PV.SignedBat17150970902550.21461031104686312 getHistory message: {"id":"0_userdata.0.PV.SignedBat","options":{"start":1715010686903,"end":1715097086903,"aggregate":"onchange","limit":5000,"ignoreNull":true}}
Query to execute: from(bucket: "iobroker_short") |> range(start: 2024-05-06T15:51:26.903Z, stop: 2024-05-07T15:51:26.903Z) |> filter(fn: (r) => r["_field"] == "value") |> filter(fn: (r) => r["_measurement"] == "0_userdata.0.PV.SignedBat" and contains(value: r._value, set: [true, false])) |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value") |> group()
Query to execute: from(bucket: "iobroker_short") |> range(start: 2024-02-04T15:51:26.903Z, stop: 2024-05-06T15:51:26.902Z) |> filter(fn: (r) => r["_measurement"] == "0_userdata.0.PV.SignedBat") |> last() |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
Query to execute: from(bucket: "iobroker_short") |> range(start: 2024-05-06T15:51:26.903Z, stop: 2024-05-07T15:51:26.903Z) |> filter(fn: (r) => r["_measurement"] == "0_userdata.0.PV.SignedBat") |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value") |> group() |> sort(columns:["_time"], desc: false) |> limit(n: 500)
Query to execute: from(bucket: "iobroker_short") |> range(start: 2024-05-07T15:51:26.904Z) |> filter(fn: (r) => r["_measurement"] == "0_userdata.0.PV.SignedBat") |> first() |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
Send: 502 of: 501 in: 64ms

The log is not necessaray, because if you have a closer look to

count: parseInt(msg.message.options.count, 10) || 500,

you see that count is always set, so that is the reason for not getting into the questioning

if (!options.count || isNaN(options.count)) {

and therefore the limit is not set

options.count = options.limit;

If you compare it with historyDB-Adapter there is the right count defined
https://github.com/ioBroker/ioBroker.history/blob/4c2faf570209a0a28726da453c2d3bbca4e5c75e/main.js#L1165
image

@GermanBluefox
Copy link
Contributor

@Apollon77 What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants