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

[0.2.2-1] panic: assignment to entry in nil map #122

Closed
rossmcdonald opened this issue Dec 23, 2015 · 5 comments · Fixed by #131
Closed

[0.2.2-1] panic: assignment to entry in nil map #122

rossmcdonald opened this issue Dec 23, 2015 · 5 comments · Fixed by #131
Labels

Comments

@rossmcdonald
Copy link
Contributor

On Ubuntu 14.04:

root@kapacitor1:~# kapacitor version
Kapacitor 0.2.2 (git: master efba437c26e38539e60fe6b12f791b24a39506e9)

Using TICKscript:

var disk_total = stream
                 .from().measurement('disk_total').groupBy('host')
                 .where(lambda: "path" == '/')
                 .window()
                 .period(1m)
                 .every(1m)
                 .align()
                 .mapReduce(influxql.last('value'))

var disk_used = stream
                .from().measurement('disk_used').groupBy('host')
                .where(lambda: "path" == '/')
                .window()
                .period(1m)
                .every(1m)
                .align()
                .mapReduce(influxql.last('value'))

disk_used.join(disk_total)
  .as('used', 'total')
  .tolerance(1m)
  .eval(lambda: ("used" / "total") * 100 )
  .as('percent_used')
  .influxDBOut()
  .database('kapacitor')
  .retentionPolicy('default')
  .measurement('disk_percentages')
root@kapacitor1:~# kapacitor list tasks
Name                          Type      Enabled   Executing Databases and Retention Policies
disk_alert                    stream    true      true      ["telegraf"."default"]

Getting panic here as soon as the task is started. This is just a vanilla system with only a single Telegraf instance writing into InfluxDB 0.9.6.1.

Let me know if you need any extra information (or want access to the system).

@rossmcdonald
Copy link
Contributor Author

Gah, just realized I'm on the old version. Trying again now.

@rossmcdonald
Copy link
Contributor Author

Seeing the same thing on the latest version as well:

root@kapacitor1:~# kapacitor version
Kapacitor 0.2.3 (git: master 7ea4a548108e82a214d6c7a94b66a59ffeda1bd9)

@nathanielc
Copy link
Contributor

I found the source of the bug and I'll fix it but it you just change the groupby and where calls you can avoid the issue and it will be slightly faster ;)

Example:

var disk_used = stream
                .from().measurement('disk_used')
                .where(lambda: "path" == '/')
                .groupBy('host')

@nathanielc
Copy link
Contributor

Note to self: Should we add a groupBy method to the StreamNode so that it is faster and then the order won't affect performance?

@rossmcdonald
Copy link
Contributor Author

That fixed it, thanks!

Regarding:

Should we add a groupBy method to the StreamNode so that it is faster and then the order won't affect performance?

My two cents would be either adding a groupBy to the StreamNode (the docs don't make it clear that it's not), or making it abundantly clear in the docs which order should be used. I just assumed they were interchangeable, so it would be nice to know what is considered 'best practice'.

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

Successfully merging a pull request may close this issue.

2 participants