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

Fix lg_stats issue where it does not support the resolution ros param correctly #365

Open
8 tasks
wzin opened this issue May 17, 2017 · 0 comments
Open
8 tasks

Comments

@wzin
Copy link
Contributor

wzin commented May 17, 2017

Overview:

There's a bug defined in https://github.com/EndPointCorp/lg_chef/blob/master/cookbooks/lg_stats/STATS_HANDBOOK.md

Basically lg_stats ROS node submits the data to telegraf every 10 seconds but the data itself contains information that the timespan of the data is only 5 seconds (exactly as it's been configured for). This timespan attribute is important because it's used for calculating the duration of certain events recorded by lg_stats. On the top level stats interpretation we always multiply timespan by 2, so right know this bug is alleviated but it would be good to fix it once and for all.

Requirements:

  • identify why lg_stats does not submit the data every 5 seconds as it's been configured for
  • fix it in lg_stats
  • when rolling this out to production, make sure you adjust grafana queries because this bug is alleviated by following workaround:
SELECT (sum(timespan)*2)/60 FROM statistics..$support_name WHERE $timeFilter and active_session =~ /True/ GROUP BY time($interval) fill(0)

note the sum(timespan)*2 - you will have to remove it once it's all fixed.

  • decide on whether you want stats to be submitted every 5 or 10 seconds. If you choose 5 then it's also worth to higher up the resolution of the influx_resampler from 10 seconds to 5 seconds timeframe:
[query:scene_slug]
query_string=SELECT mode(metadata) AS scene_slug FROM telegraf..lg_stats_event WHERE %s AND topic_name = '/director/scene' AND support_name = 'wojte
k' GROUP BY time(10s) fill(0)

[query:operating]
query_string=SELECT mean(value) AS operating FROM telegraf..operating_hours WHERE %s AND topic_name = 'operating_hours' AND support_name = 'wojtek' 
GROUP BY time(10s) fill(0)

note the GROUP BY time(10s)

Checklist:

  • functionality is documented in README.md specific to the cookbook
  • test coverage was written for this feature
  • monitoring has been developed for this feature
  • it has been deployed and verified with monitoring
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

1 participant