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

MRANGE returning out-of-query results #506

Closed
dpipemazo opened this issue Aug 27, 2020 · 1 comment
Closed

MRANGE returning out-of-query results #506

dpipemazo opened this issue Aug 27, 2020 · 1 comment
Assignees

Comments

@dpipemazo
Copy link
Contributor

Hi all -- originally posted this issue on the grafana datasource but I think it might fit better here: RedisGrafana/grafana-redis-datasource#56

I'm using Redis Time Series to monitor per-process CPU status on my machine, using psutil to scrape the system for process names and then monitor their CPU percentage over the sampling interval to unique, per-process keys with shared filters. I'm then using MRANGE to query and plot the data in grafana.

This sort of time-series data is inherently sparse -- over a given time window there will be processes that exist in the overall query set across the filters (i.e. all processes ever) but that don't have any data within the time window. I'm seeing some interesting results across an example query:

ts.mrange 1598405335639 1598410333697 AGGREGATION avg 1000 WITHLABELS FILTER element=monitor type=process subtype1=cpu_user

Full query response here:

mrange.txt

A few examples of results that are out-of-query, either happening before the start timestamp or after the stop timestamp:

1484) 1) "monitor:process:99:kworker/7:1:cpu_user"
      2) 1) 1) "element"
            2) "monitor"
         2) 1) "type"
            2) "process"
         3) 1) "container"
            2) "x86_64"
         4) 1) "device"
            2) "default"
         5) 1) "language"
            2) "Python"
         6) 1) "version"
            2) "1.7.2"
         7) 1) "level"
            2) "INFO"
         8) 1) "subtype0"
            2) "99:kworker/7:1"
         9) 1) "subtype1"
            2) "cpu_user"
      3) 1) 1) (integer) 1598456570000
            2) 0
1482) 1) "monitor:process:9866:kworker/3:0:cpu_user"
      2) 1) 1) "element"
            2) "monitor"
         2) 1) "type"
            2) "process"
         3) 1) "container"
            2) "x86_64"
         4) 1) "device"
            2) "default"
         5) 1) "language"
            2) "Python"
         6) 1) "version"
            2) "1.7.2"
         7) 1) "level"
            2) "INFO"
         8) 1) "subtype0"
            2) "9866:kworker/3:0"
         9) 1) "subtype1"
            2) "cpu_user"
      3) 1) 1) (integer) 1598404695000
            2) 0

This is running Redis Time Series 1.2.7. I did see a bug (#464) that addresses something similar for RANGE but am not sure if it would apply to MRANGE. I'll try upgrading to the latest version and will report on if I can continue to reproduce.

@dpipemazo
Copy link
Contributor Author

Upgraded Redis Time Series to latest version (commit e8030d14e7b8e186518b1b551cfa3cde261bf3c3) and the behavior has improved here -- no longer seeing the issue. Thanks!

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

2 participants