Skip to content

Add Wi-SUN statistics interface #12766

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

Merged
merged 1 commit into from
Apr 15, 2020
Merged

Add Wi-SUN statistics interface #12766

merged 1 commit into from
Apr 15, 2020

Conversation

mikaleppanen
Copy link

Summary of changes

Added network, physical layer, MAC and FHSS statistics to Wi-SUN interface. There are new functions to enable/disable and read the statistics.

Impact of changes

None

Migration actions required

None

Documentation

None


Pull request type

[] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[X] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[X] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers

@mikter @JarkkoPaso @artokin @juhhei01 @amarjeet-arm

@ciarmcom
Copy link
Member

ciarmcom commented Apr 7, 2020

@mikaleppanen, thank you for your changes.
@JarkkoPaso @juhhei01 @artokin @mikter @ARMmbed/mbed-os-maintainers please review.

@0xc0170 0xc0170 changed the title Added Wi-SUN statistics interface Add Wi-SUN statistics interface Apr 7, 2020
0xc0170
0xc0170 previously approved these changes Apr 7, 2020
@mergify mergify bot added needs: CI and removed needs: review labels Apr 7, 2020
if (!statistics) {
return -1;
}
memcpy(stats, &statistics->phy_statistics, sizeof(phy_rf_statistics_s));
Copy link
Contributor

@juhhei01 juhhei01 Apr 7, 2020

Choose a reason for hiding this comment

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

nervous about to use that memcpy like at other functions. If structure type is same we can do just *stats = statistic->why_statistic;

Copy link
Author

Choose a reason for hiding this comment

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

corrected

@mikaleppanen
Copy link
Author

@amarjeet-arm @gkumaar @debdeep-arm @prashant-arm @umesh-arm Here is the statistics interface pull request to mbed-os

return -1;
}
memcpy(stats, &statistics->phy_statistics, sizeof(phy_rf_statistics_s));
return 0;
Copy link

Choose a reason for hiding this comment

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

This binds the nanostack API to mbedOS API and we can't make changes to any independently

I think we need to select the wanted statistics to Mbed OS API and just copy those not take everything at bulk

Copy link
Author

Choose a reason for hiding this comment

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

corrected

uint32_t fhss_unknown_neighbor; /*<! FHSS TX to unknown neighbour counter. */
uint32_t fhss_channel_retry; /*<! FHSS channel retry counter. */
} mesh_fhss_statistics_t;

Copy link

Choose a reason for hiding this comment

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

Take everything ever defined is not The best approach

We need to have some thought what are the needed and usable statistics this will make the messages huge

Copy link
Author

Choose a reason for hiding this comment

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

removed not needed statistics

uint32_t buf_alloc; /*<! Buffer allocation count. */
uint32_t buf_headroom_realloc; /*<! Buffer headroom realloc count. */
uint32_t buf_headroom_shuffle; /*<! Buffer headroom shuffle count. */
uint32_t buf_headroom_fail; /*<! Buffer headroom failure count. */
Copy link

Choose a reason for hiding this comment

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

These are useless stats and We are missing more important stats that are available memory usage/max alloc fails

Copy link
Author

Choose a reason for hiding this comment

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

removed

uint32_t mac_beacon_tx_count; /*<! MAC Beacon TX packet count. */
uint32_t mac_rx_drop_count; /*<! MAC RX packet drop count. */
uint32_t mac_tx_bytes; /*<! MAC TX bytes count. */
uint32_t mac_rx_bytes; /*<! MAC RX bytes count. */
Copy link

Choose a reason for hiding this comment

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

We have multiple levels of RX counts and byte counts I think one is enough
Mac_tx/rx_count
Mac_bx_tx/rx_count and
Mac_tx/rx/bytes
seems the best on that area

Copy link
Author

Choose a reason for hiding this comment

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

corrected

uint32_t rpl_global_repair; /*<! RPL global repair count. */
uint32_t rpl_malformed_message; /*<! RPL malformed message count. */
uint32_t rpl_time_no_next_hop; /*<! RPL seconds without a next hop. */
uint32_t rpl_total_memory; /*<! RPL current memory usage total. */
Copy link

Choose a reason for hiding this comment

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

rpl memory amounts
parent ETX values are usable others not so much
parent IP address would be great but should it be in statistics API? or own getter

Copy link
Author

Choose a reason for hiding this comment

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

corrected

uint32_t mac_tx_failed_count; /*<! MAC TX failed count. */
uint32_t mac_retry_count; /*<! MAC TX retry count. */
uint32_t mac_cca_attempts_count; /*<! MAC CCA attempts count. */
uint32_t mac_failed_cca_count; /*<! MAC failed CCA count. */
Copy link

Choose a reason for hiding this comment

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

Mac_failed_cca and tx failed are usable

Copy link
Author

Choose a reason for hiding this comment

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

ok

uint32_t mac_tx_bytes; /*<! MAC TX bytes count. */
uint32_t mac_rx_bytes; /*<! MAC RX bytes count. */
uint32_t mac_tx_failed_count; /*<! MAC TX failed count. */
uint32_t mac_retry_count; /*<! MAC TX retry count. */

Choose a reason for hiding this comment

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

mac_bc_tx_count, mac_tx_count and mac_retry_count are important.

Copy link
Author

Choose a reason for hiding this comment

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

ok

*/
typedef struct {
uint16_t mac_tx_queue_size; /*<! MAC TX queue current size. */
uint16_t mac_tx_queue_peak; /*<! MAC TX queue peak size. */

Choose a reason for hiding this comment

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

We need to be able to set mac_tx_queue_peak and adapt_layer_tx_queue_peak to 0 if we want short term peak values.

Copy link
Author

Choose a reason for hiding this comment

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

removed

Added network and MAC statistics to Wi-SUN interface.
@mergify mergify bot dismissed 0xc0170’s stale review April 14, 2020 07:07

Pull request has been modified.

@mikaleppanen
Copy link
Author

Corrected review comments, please re-review.

@mikaleppanen mikaleppanen requested a review from 0xc0170 April 14, 2020 07:10
Copy link
Contributor

@juhhei01 juhhei01 left a comment

Choose a reason for hiding this comment

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

OK for me

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 14, 2020

I'll try to schedule the CI job later today (as it uses different configuration, it can't run at the same time as master, making more difficult).

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 15, 2020

CI started

@mergify mergify bot added needs: work and removed needs: CI labels Apr 15, 2020
@mbed-ci
Copy link

mbed-ci commented Apr 15, 2020

Test run: FAILED

Summary: 1 of 11 test jobs failed
Build number : 2
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_example-test-lts

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 15, 2020

test restarted

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 15, 2020

@artokin Also ready for integration?

@artokin artokin merged commit 04dacfa into ARMmbed:feature-wisun Apr 15, 2020
@mergify mergify bot removed the ready for merge label Apr 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants