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

remove logging from message box and create LoggingSender #1833

Merged
merged 1 commit into from
Mar 22, 2023

Conversation

jmshark
Copy link
Contributor

@jmshark jmshark commented Mar 22, 2023

Proposed changes

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (general improvements like code refactoring that doesn't explicitly fix a bug or add any new functionality)
  • Documentation Update (if none of the other choices apply)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Paste Link to the issue


Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA (in all commits with git commit -s)
  • I ran cargo fmt as mentioned in CODING_GUIDELINES
  • I used cargo clippy as mentioned in CODING_GUIDELINES
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@jmshark jmshark requested review from didier-wenzek and albinsuresh and removed request for didier-wenzek March 22, 2023 10:29
@jmshark jmshark force-pushed the feat/1724/remove-message-box branch from 215edc4 to f2b1ae3 Compare March 22, 2023 10:49
@jmshark jmshark temporarily deployed to Test Pull Request March 22, 2023 10:56 — with GitHub Actions Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Mar 22, 2023

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass %
154 0 5 154 100

Passed Tests

Name ⏱️ Duration Suite
Define Child device 1 ID 0.018 s C8Y Child Alarms Rpi
Normal case when the child device does not exist on c8y cloud 3.835 s C8Y Child Alarms Rpi
Normal case when the child device already exists 0.798 s C8Y Child Alarms Rpi
Reconciliation when the new alarm message arrives, restart the mapper 1.518 s C8Y Child Alarms Rpi
Reconciliation when the alarm that is cleared 6.687 s C8Y Child Alarms Rpi
Prerequisite Parent 17.557 s Child Conf Mgmt Plugin
Prerequisite Child 0.274 s Child Conf Mgmt Plugin
Child device bootstrapping 14.859 s Child Conf Mgmt Plugin
Snapshot from device 21.094 s Child Conf Mgmt Plugin
Child device config update 18.592 s Child Conf Mgmt Plugin
Configuration types should be detected on file change (without restarting service) 47.495 s Inotify Crate
Child devices support sending simple measurements 43.553 s Child Device Telemetry
Child devices support sending custom measurements 49.404 s Child Device Telemetry
Child devices support sending custom events 44.794 s Child Device Telemetry
Child devices support sending custom events overriding the type 28.257 s Child Device Telemetry
Child devices support sending custom alarms #1699 45.949 s Child Device Telemetry
Child devices support sending inventory data via c8y topic 23.213 s Child Device Telemetry
Main device support sending inventory data via c8y topic 23.744 s Child Device Telemetry
Successful firmware operation 63.753 s Firmware Operation
Install with empty firmware name 52.292 s Firmware Operation
Prerequisite Parent 19.423 s Firmware Operation Child Device
Prerequisite Child 7.6850000000000005 s Firmware Operation Child Device
Child device firmware update 6.155 s Firmware Operation Child Device
Child device firmware update with cache 5.713 s Firmware Operation Child Device
Retrieve a JWT tokens 53.828 s Jwt Request
Supports restarting the device 75.377 s Restart Device
Update tedge version from previous using Cumulocity 93.248 s Tedge Self Update
Test if all c8y services are up 60.758 s Service Monitoring
Test if all c8y services are down 56.219 s Service Monitoring
Test if all c8y services are using configured service type 60.906 s Service Monitoring
Test if all c8y services using default service type when service type configured as empty 47.519 s Service Monitoring
Check health status of tedge-mapper-c8y service on broker restart 28.026 s Service Monitoring
Check health status of child device service 23.003 s Service Monitoring
Successful shell command with output 3.426 s Shell Operation
Check Successful shell command with literal double quotes output 2.92 s Shell Operation
Execute multiline shell command 3.173 s Shell Operation
Failed shell command 2.965 s Shell Operation
Software list should be populated during startup 48.346 s Software
Install software via Cumulocity 61.936 s Software
Software list should only show currently installed software and not candidates 46.981 s Software
Validate updated data path used by tedge-agent 0.716 s Data Path Config
Validate updated data path used by c8y-firmware-plugin 10.644 s Data Path Config
Stop tedge-agent service 0.437 s Log Path Config
Customize the log path 0.152 s Log Path Config
Initialize tedge-agent 0.139 s Log Path Config
Check created folders 0.14 s Log Path Config
Remove created custom folders 0.27 s Log Path Config
Install thin-edge via apt 49.729 s Install Apt
Install latest via script (from current branch) 26.456 s Install Tedge
Install specific version via script (from current branch) 21.443 s Install Tedge
Install latest tedge via script (from main branch) 22.259 s Install Tedge
Support starting and stopping services 39.142 s Service-Control
Supports a reconnect 53.568 s Test-Commands
Supports disconnect then connect 51.249 s Test-Commands
Update unknown setting 37.6 s Test-Commands
Update known setting 28.689 s Test-Commands
Stop c8y-configuration-plugin 0.164 s Health C8Y-Configuration-Plugin
Update the service file 0.176 s Health C8Y-Configuration-Plugin
Reload systemd files 0.633 s Health C8Y-Configuration-Plugin
Start c8y-configuration-plugin 0.254 s Health C8Y-Configuration-Plugin
Start watchdog service 10.350999999999999 s Health C8Y-Configuration-Plugin
Check PID of c8y-configuration-plugin 0.263 s Health C8Y-Configuration-Plugin
Kill the PID 0.177 s Health C8Y-Configuration-Plugin
Recheck PID of c8y-configuration-plugin 2.334 s Health C8Y-Configuration-Plugin
Compare PID change 0.001 s Health C8Y-Configuration-Plugin
Stop watchdog service 0.21 s Health C8Y-Configuration-Plugin
Remove entry from service file 0.217 s Health C8Y-Configuration-Plugin
Stop c8y-log-plugin 0.248 s Health C8Y-Log-Plugin
Update the service file 0.283 s Health C8Y-Log-Plugin
Reload systemd files 0.874 s Health C8Y-Log-Plugin
Start c8y-log-plugin 0.171 s Health C8Y-Log-Plugin
Start watchdog service 10.263 s Health C8Y-Log-Plugin
Check PID of c8y-log-plugin 0.127 s Health C8Y-Log-Plugin
Kill the PID 0.216 s Health C8Y-Log-Plugin
Recheck PID of c8y-log-plugin 2.391 s Health C8Y-Log-Plugin
Compare PID change 0.006 s Health C8Y-Log-Plugin
Stop watchdog service 0.219 s Health C8Y-Log-Plugin
Remove entry from service file 0.128 s Health C8Y-Log-Plugin
Stop tedge-mapper 0.248 s Health Tedge Mapper C8Y
Update the service file 0.183 s Health Tedge Mapper C8Y
Reload systemd files 0.88 s Health Tedge Mapper C8Y
Start tedge-mapper 0.247 s Health Tedge Mapper C8Y
Start watchdog service 10.327 s Health Tedge Mapper C8Y
Check PID of tedge-mapper 0.167 s Health Tedge Mapper C8Y
Kill the PID 0.338 s Health Tedge Mapper C8Y
Recheck PID of tedge-mapper 0.359 s Health Tedge Mapper C8Y
Compare PID change 0.001 s Health Tedge Mapper C8Y
Stop watchdog service 0.206 s Health Tedge Mapper C8Y
Remove entry from service file 0.176 s Health Tedge Mapper C8Y
Stop tedge-agent 0.166 s Health Tedge-Agent
Update the service file 0.12 s Health Tedge-Agent
Reload systemd files 0.448 s Health Tedge-Agent
Start tedge-agent 0.166 s Health Tedge-Agent
Start watchdog service 10.273 s Health Tedge-Agent
Check PID of tedge-mapper 0.051 s Health Tedge-Agent
Kill the PID 0.06 s Health Tedge-Agent
Recheck PID of tedge-agent 2.114 s Health Tedge-Agent
Compare PID change 0.001 s Health Tedge-Agent
Stop watchdog service 0.081 s Health Tedge-Agent
Remove entry from service file 0.069 s Health Tedge-Agent
Stop tedge-mapper-az 0.355 s Health Tedge-Mapper-Az
Update the service file 0.262 s Health Tedge-Mapper-Az
Reload systemd files 0.934 s Health Tedge-Mapper-Az
Start tedge-mapper-az 0.336 s Health Tedge-Mapper-Az
Start watchdog service 10.397 s Health Tedge-Mapper-Az
Check PID of tedge-mapper-az 0.15 s Health Tedge-Mapper-Az
Kill the PID 0.147 s Health Tedge-Mapper-Az
Recheck PID of tedge-agent 2.363 s Health Tedge-Mapper-Az
Compare PID change 0.001 s Health Tedge-Mapper-Az
Stop watchdog service 0.198 s Health Tedge-Mapper-Az
Remove entry from service file 0.117 s Health Tedge-Mapper-Az
Stop tedge-mapper-collectd 0.222 s Health Tedge-Mapper-Collectd
Update the service file 0.279 s Health Tedge-Mapper-Collectd
Reload systemd files 0.807 s Health Tedge-Mapper-Collectd
Start tedge-mapper-collectd 0.251 s Health Tedge-Mapper-Collectd
Start watchdog service 10.261 s Health Tedge-Mapper-Collectd
Check PID of tedge-mapper-collectd 0.13 s Health Tedge-Mapper-Collectd
Kill the PID 0.197 s Health Tedge-Mapper-Collectd
Recheck PID of tedge-mapper-collectd 2.247 s Health Tedge-Mapper-Collectd
Compare PID change 0.001 s Health Tedge-Mapper-Collectd
Stop watchdog service 0.213 s Health Tedge-Mapper-Collectd
Remove entry from service file 0.193 s Health Tedge-Mapper-Collectd
c8y-log-plugin health status 5.931 s MQTT health endpoints
c8y-configuration-plugin health status 5.533 s MQTT health endpoints
Wrong package name 0.181 s Improve Tedge Apt Plugin Error Messages
Wrong version 0.217 s Improve Tedge Apt Plugin Error Messages
Wrong type 0.444 s Improve Tedge Apt Plugin Error Messages
tedge_connect_test_positive 0.441 s Tedge Connect Test
tedge_connect_test_negative 0.408 s Tedge Connect Test
tedge_connect_test_sm_services 7.121 s Tedge Connect Test
tedge_disconnect_test_sm_services 0.593 s Tedge Connect Test
Install thin-edge.io 16.547 s Call Tedge
call tedge -V 0.101 s Call Tedge
call tedge -h 0.073 s Call Tedge
call tedge -h -V 0.098 s Call Tedge
call tedge help 0.072 s Call Tedge
tedge config list 0.146 s Call Tedge Config List
tedge config list --all 0.152 s Call Tedge Config List
set/unset device.type 0.497 s Call Tedge Config List
set/unset device.key.path 0.535 s Call Tedge Config List
set/unset device.cert.path 0.604 s Call Tedge Config List
set/unset c8y.root.cert.path 0.768 s Call Tedge Config List
set/unset c8y.smartrest.templates 1.181 s Call Tedge Config List
set/unset az.root.cert.path 1.07 s Call Tedge Config List
set/unset az.mapper.timestamp 0.605 s Call Tedge Config List
set/unset mqtt.bind_address 0.684 s Call Tedge Config List
set/unset mqtt.port 0.853 s Call Tedge Config List
set/unset tmp.path 0.677 s Call Tedge Config List
set/unset logs.path 0.646 s Call Tedge Config List
set/unset run.path 0.61 s Call Tedge Config List
Get Put Delete 4.044 s Http File Transfer Api
Set keys should return value on stdout 0.171 s Tedge Config Get
Unset keys should not return anything on stdout and warnings on stderr 0.437 s Tedge Config Get
Invalid keys should not return anything on stdout and warnings on stderr 0.671 s Tedge Config Get

Copy link
Contributor

@didier-wenzek didier-wenzek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

The MessageBox trait is definitely useless now and can be removed in a follow-up PR.

Comment on lines 255 to 257
pub async fn send(&mut self, message: Output) -> Result<(), ChannelError> {
self.log_output(&message);
self.output_sender.send(message).await
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One could also impl Sender<Output> for SimpleMessageBox<Input, Output>.

Comment on lines -44 to +45
self.log_output(&message);
log_message_sent("Inotify", &message);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit surprised by this. But that's okay for now as this actor has to be revised in any case.

@jmshark jmshark force-pushed the feat/1724/remove-message-box branch from f2b1ae3 to 7613c99 Compare March 22, 2023 14:59
@jmshark jmshark force-pushed the feat/1724/remove-message-box branch from 7613c99 to 5c567b8 Compare March 22, 2023 15:00
@jmshark jmshark temporarily deployed to Test Pull Request March 22, 2023 15:09 — with GitHub Actions Inactive
@jmshark jmshark merged commit b236aaa into thin-edge:main Mar 22, 2023
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

Successfully merging this pull request may close these issues.

None yet

2 participants