Skip to content

Network Socket Statistics #8592

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 13 commits into from
Nov 27, 2018
Merged

Conversation

deepikabhavnani
Copy link

@deepikabhavnani deepikabhavnani commented Oct 30, 2018

Description

This is the initial version of stats implementation in network layer.
SocketStats Class is added to collect and provide the statistics information. In this phase only socket information is collected and max sockets that can be recorded at any time are configurable through 'MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT'

Network statistics can be enabled through a macro MBED_NW_STATS_ENABLED

More information on design is captured in #8743

Pull request type

[ ] Fix
[ ] Refactor
[ ] Target update
[X] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

@deepikabhavnani
Copy link
Author

@adbridge adbridge requested review from a team October 30, 2018 17:27
@adbridge
Copy link
Contributor

@deepikabhavnani, thank you for your changes. A review has been requested from the following:
@ARMmbed/mbed-os-core @ARMmbed/mbed-os-ipcore

@deepikabhavnani deepikabhavnani requested review from SenRamakri and kegilbert and removed request for a team November 5, 2018 18:20
@deepikabhavnani deepikabhavnani changed the title Network Stats - Emac + lwip Network Stats - Emac + lwip + ESP8266 Nov 6, 2018
Copy link
Contributor

@SeppoTakalo SeppoTakalo left a comment

Choose a reason for hiding this comment

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

I cannot approve this design.

This is way too far away from what current Mbed OS statistics APIs are.

Only usable thing in this PR is the stack_stats_t which contains packet counters.

If that is what have been requested, then we should have designed API similar to existing statistics APIS.

For example:

/** Network statistics */
typedef struct {
    uint32_t pkt_xmit;         /**< Transmitted packets. */
    uint32_t pkt_recv;         /**< Received packets. */
    uint16_t sock_open;        /**< Number of sockets opened */
} network_stats_t;
/** Get the network statistics */
void mbed_stats_network_get(network_stats_t *stats);

This would match the existing mbed_stats.h API.

I cannot understand why network statics have been done so overly complex way.

If the example proposal I just show is fine, it should have been asked from IP networking team to implement. If more complex statistics have been asked, then I'm not aware of the requirements and we should have started by creating a design that can be justified by the requirements document.

@deepikabhavnani
Copy link
Author

deepikabhavnani commented Nov 8, 2018

If the example proposal I just show is fine, it should have been asked from IP networking team to implement. If more complex statistics have been asked, then I'm not aware of the requirements and we should have started by creating a design that can be justified by the requirements document.

This is not the right forum to discuss this, but I would leave a comment stating design was shared nearly 3 months ago and numerous meetings request were made to discuss that as well

@cmonr
Copy link
Contributor

cmonr commented Nov 15, 2018

@deepikabhavnani This needs a rebase.

@deepikabhavnani deepikabhavnani changed the title Network Stats - Emac + lwip + ESP8266 Network Socket Statistics Nov 15, 2018
@deepikabhavnani
Copy link
Author

@SeppoTakalo @lauri-piikivi @SenRamakri - Please review

@deepikabhavnani
Copy link
Author

@ARMmbed/mbed-os-maintainers - Travis astyle failures related to trailing spaces, there is no clear indication for user that error is because of extra space.

-     *                  If the number of sockets on the system is less than or equal to count, 
+     *                  If the number of sockets on the system is less than or equal to count,

Error Resolved here is:
SingletonPtr.h:93:13: error: ‘NULL’ was not declared in this scope
@cmonr
Copy link
Contributor

cmonr commented Nov 26, 2018

PR updated. Restarting CI.

@cmonr
Copy link
Contributor

cmonr commented Nov 26, 2018

@deepikabhavnani Looks like there are still unittest issues.

@deepikabhavnani
Copy link
Author

@cmonr - Fixed now.. Was able to test on linux machine

@cmonr
Copy link
Contributor

cmonr commented Nov 26, 2018

Thanks @deepikabhavnani. CI restarted.

@deepikabhavnani
Copy link
Author

deepikabhavnani commented Nov 26, 2018

@ARMmbed/mbed-os-maintainers - Please have a look

Stopped the test run stuck from 4 hours.

<1s
/builds/ws/mbed-os-ci_mbed2-build-GCC_ARM@2/749/XADOW_M0_GCC_ARM_749@tmp/durable-ae8d361d: No space left on device

@deepikabhavnani
Copy link
Author

/builds/ws/mbed-os-ci_mbed2-build-IAR/746/USENSE_IAR_746@tmp/durable-44ce7b4b: No space left on device

@cmonr
Copy link
Contributor

cmonr commented Nov 27, 2018

Restarted jobs with failed results.

Somehow, other jobs seem to not have been hit with the disk storage issue. Fingers crossed.

@cmonr cmonr added risk: G and removed risk: A labels Nov 27, 2018
@mbed-ci
Copy link

mbed-ci commented Nov 27, 2018

Test run: SUCCESS

Summary: 4 of 4 test jobs passed
Build number : 14
Build artifacts
Build logs

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.