Closed sag-asya closed 2 years ago
Tagging @sag-tgo as reviewer.
In the EPL there are some long lines of code, please could you format it to lines no longer than ~80 chars. I also changed the limited bandwidth sample to indent with 4 spaces so that code appears indented/aligned consistently and doesn't mix tabs/spaces for indentation. I think we should do the same for this one.
In the EPL there are some long lines of code, please could you format it to lines no longer than ~80 chars. I also changed the limited bandwidth sample to indent with 4 spaces so that code appears indented/aligned consistently and doesn't mix tabs/spaces for indentation. I think we should do the same for this one.
Done. I have reduced the long lines of code. Please take another look and let me know what you think of the updated changes
I'm happy with all the changes
In the EPL there are some long lines of code, please could you format it to lines no longer than ~80 chars. I also changed the limited bandwidth sample to indent with 4 spaces so that code appears indented/aligned consistently and doesn't mix tabs/spaces for indentation. I think we should do the same for this one.
Done. I have reduced the long lines of code. Please take another look and let me know what you think of the updated changes
Indentation is still with tabs, should be spaces for consistency with existing example.
In the EPL there are some long lines of code, please could you format it to lines no longer than ~80 chars. I also changed the limited bandwidth sample to indent with 4 spaces so that code appears indented/aligned consistently and doesn't mix tabs/spaces for indentation. I think we should do the same for this one.
Done. I have reduced the long lines of code. Please take another look and let me know what you think of the updated changes
Indentation is still with tabs, should be spaces for consistency with existing example.
@sag-tgo Thanks for pointing it out. I referred LimitedBandwidth sample on my dev branch which had the tabs. So I kept tabs. But on main it looks like you have converted them to spaces. @louiseam-sag, please convert tabs to spaces before merging.
Proposed changes
EPL sample to monitor CPU usage and calculate what percentage of the time the usage is over 70%. It reports it to the cloud in 5 mins cycle if this percentage is over 70% or once per hour if it is under 70%. Note that we are not reporting what is the average cpu usage but the percentage of time for which cpu breached the threshold. The same set of requirements were implemented for memory usage as well. The changes also contain mqtt configuration which allow us to read and report in the expected data formats.
Incoming data
The sample expects the incoming data to be available over mqtt in the following format:
The same format is expected for cpu and memory measurements. These measurement differ in the subscribed topic
Outgoing data
The sample publishes a single json report to the mqtt(to be later pushed to cloud) comprising of cpu and memory data. Here is a sample report:
The frequency is decided based on whether the time percentage over last 5 mins where the thresholds were breached for either of the resources was above 70% or not. Note: The 'percent-used' and 'percent-active' are cpu or memory averages over the reporting period but the time percentage for which the usage breached the threshold values. I have used the names provided in the story. Maybe we can use some better name
Let me know if we need to commit the original project or the deployed project to github