-
Notifications
You must be signed in to change notification settings - Fork 299
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
App-local statistics counters #931
Conversation
Set the shared memory path (shm.path) to a private namespace for each app with prefix "app/$name". This means that apps can create shm objects such as counters and by default these will appear in a local namespace for that app.
I rewrote the git-workflow explanation with the goal of briefly but clearly explaining both how to submit a change to Snabb Switch and also how to be a subsystem maintainer. This is intended to be a chapter in the manual.
Contains "XXX rewrite" where old sections have been removed but replacements not written yet.
This file now contains a diagram so it needs to have separate .src.md and .md versions. This can be cleaned up when these changes eventually merge with the on-demand markdown (snabbco#829).
also stopped capitalizing "Pull Request" because it seemed awkward.
- Use "apps/" instead of "app/" for uniformity - Set shm path to "apps/$name" when calling `app:stop' too - Unlink "apps/$name" after `app:stop' using `shm.unlink' - Add a test case to core.app selftest
# Conflicts: # src/core/app.lua
…eric representation.
Resolved conflicts with incoming changes from master branch: *.src.md replaced with simply *.md "Snabb Switch" being renamed to "Snabb"
Ditaa images are not kept in tree anymore...
option and support injecting a function to determine the current time.
This reverts commit 8bb3215.
Bug was to set _G.developer_debug to nil when debugging is disabled. In Lua you cannot use nil as a table value and should use false instead. Further discussion at: snabbco#956 (comment)
Print debug messages only when enabled by editing the source file, not when _G.developer_debug is enabled. The debug mode prints a message every time a timer is executed. This could easily produce thousands of messages per second in reasonable applications. This seems appropriate when specifically debugging the timer module but not when enabling a more general debug mode.
MRG_RXBUF is enabled by default in the beginning, and QEMU will initially negotiate a feature set with Snabb NFV that includes MRG_RXBUF. This adds a field onto the virtio header, in legacy mode. However if we later negotiate to not have MRG_RXBUF, we need to re-set this value to not have the extra fields. (cherry picked from commit df8e83c)
…dicate." Reason: its actually slower than the initial naive version. This reverts commit c186591. # Conflicts: # src/apps/vhost/vhost_user.lua
# Conflicts: # src/apps/vhost/vhost_user.lua # src/lib/protocol/README.md
Fixed packet documentation merge conflict
@eugeneia Shall I merge your newest change onto kbara-next as well? |
Can you guys please also consider eugeneia#14? Sorry, I'm losing track of who merges what from whom :) |
@kbara No need to merge new commits from this branch, they are related to the performance regression in @alexandergall Generally everything happens on the snabbco repository, e.g. opening PRs on my fork will be invisible to everyone but me. Best to close/reopen your PR on the source repository, then it will be picked up by the regular maintenance flow. |
The counter value for the interface speed should be in units of bps. The ifSpeed SNMP object must obey RFC3635 sec. 3.2.8.
# Conflicts: # src/apps/vhost/vhost_user.lua
Alarm set-operator-state
This branch implements per-app statistics counters and uses this feature to implement statistics for Intel_app (per pciaddress actually) and vhost_user.
The basic mechanism is that each app now has a
shmpath
(automatically set based on its name) to whichcore.shm.path
is set to when its methods are executed.core.counter
is updated to usecore.shm.resolve
, so counters opened inapp:new
are created under the app'sshmpath
. Another convention in this PR is that apps store their counters in theircounters
field.doc/statistics.md describes the schema used for the counters defined by this PR. It deviates from related standards in the way it counts packets. E.g. it defines broadcast packet counts ⊆ multicast packet counts ⊆ total packet counts. I think this makes the most sense because it allows app authors to choose how fine grained their stats are. I also don't think we should buy into the ifType madness.
The SNMP code formerly in
intel10g.lisp
was extracted tolib.ipc.shmem.iftable_mib
using the schema / API described above.Anything in this PR is open for discussion change (obviously), but I would like to get it merged and then develop these features incrementally to get things rolling. E.g. @alexandergall has pointed out that we need more data types than counters, etc. My rationale is that with this PR merged we can start recording important statistics in other apps.
App counters (as well as link counters) can be read using
snabb top -c
, e.g.: