iotile / iotile/coretools

Add Performance Counters to AbstractDeviceAdapter

Open
#929 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
14
Forks
7
PR merge metrics
No merged PRs in 30d

Description

We currently have an adhoc set of performance counters in BLED112DeviceAdapter counting things like advertisements seen, decryption errors, etc. This is really useful because DeviceAdapters are low level pieces of code that need to keep working in the face of random input so they can't raise an exception every time they see something that's not right.

Sometimes the right choice is to log it but there are times when that's not possible because the situation could happen 100s of times per second, resulting in a log flood.

For those kinds of things, we want to be able to just increment a performance counter that we can query periodically later to get a sense for how things are progressing.

We need to figure out a couple of things:
- What is the interface going to be on `AbstractDeviceAdapter` for querying a performance counter?
- How are we going to handle the fact that the specific counters for each device adapter will be different.
- Can we come up with an easy way to use the counters. A bare bones approach would be to just have a `dict` but then the code to increment a counter is long and ugly, so is there a better way?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.