aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp-api/python/vpp_papi/vpp_stats.py
AgeCommit message (Collapse)AuthorFilesLines
2019-06-14stats: add version field to stat segment base headerOle Troan1-0/+3
Add a version in the base header of the stat segment To make support for multiple reader implementations safer. Change-Id: I6816e2a51a98c2df1e621e80d4ef0b4ba4e9f47b Type: feature Signed-off-by: Ole Troan <ot@cisco.com>
2019-06-07API: Add support for "defaults"Ole Troan1-3/+7
Add support in the API language for specifying a field default. Add default support in Python binding. define foo { u16 mtu [default = 1500]; }; This is client side only. I.e. if the mtu argument is not passed to the foo function, the client language binding will set it default to 1500. Change-Id: I5df43f3cd87cb300b40ca38e15dcab25b40e424a Signed-off-by: Ole Troan <ot@cisco.com>
2019-06-04stats: removing empty object in stats vectorOle Troan1-1/+3
Type: fix Change-Id: I9b6bdacdb9a0750834de9a93d8c3f7ed827ce3c8 Signed-off-by: Ole Troan <ot@cisco.com>
2019-05-22stats: support multiple works for error countersOle Troan1-4/+15
The current code only allowed access to the main thread error counters. That is not so useful for a multi worker instance. No return a vector indexed by thread of counter_t values. Type: fix Change-Id: Ie322c8889c0c8175e1116e71de04a2cf453b9ed7 Signed-off-by: Ole Troan <ot@cisco.com>
2019-04-16stats: Add name vectors to Python clientOle Troan1-3/+21
Change-Id: Ic62dfa0bf3e082a0b999026830c64a9c543da586 Signed-off-by: Ole Troan <ot@cisco.com>
2019-03-19vpp_papi: specify encoding for .encode()/.decode()Paul Vinciguerra1-3/+3
py2 defaults to 'ascii', py3 defaults to 'utf-8'. Change-Id: Ib76d0ec56f24535e4bafd397cc6fb5e85967d508 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-01-06vpp-api: Add context to VPPStatsIOError.Paul Vinciguerra1-3/+25
* Provide context information and return meaningful information. VPPStatsIOError: Stat segment client connection returned: -2 Stat client socket open but couldn't connect. Change-Id: I14ea35c58452a2cb7598a7efd136f0c7e1f5743a Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-12-10Test framework: StringIO fixes for Python3Ole Troan1-2/+7
Add 2/3 support to binarytomac and mactobinary and move to vpp_mac.py Change-Id: I3dc7e4a24486aee22140c781aae7e44e58935877 Signed-off-by: Ole Troan <ot@cisco.com>
2018-11-29vpp_papi: Add custom exceptions.Paul Vinciguerra1-7/+21
This patchset adds and raises the following custom exception classes: * class VPPApiError(Exception): * class VPPNotImplementedError(NotImplementedError): * class VPPIOError(IOError): * class VPPRuntimeError(RuntimeError): * class VPPValueError(ValueError): * class VPPSerializerValueError(ValueError): * class VPPStatsIOError(IOError): * class VPPStatsClientLoadError(RuntimeError): * class VppTransportShmemIOError(IOError): * class VppTransportSocketIOError(IOError) Change-Id: Ia40900fd2dcef148d01125d6c691329fc666901e Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-11-28vpp_papi: Use new style classes.Paul Vinciguerra1-1/+1
Python2 defaults to old style classes to maintain compatability with python 2.1. Moving to new style classes will ensure consistent behavior across interpreters. Change-Id: I89493d608d1edb63989000c17a9566a97785a4aa Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-11-22stat_client issues while running parallel tests.Paul Vinciguerra1-9/+48
This patch addresses intermittent problems we saw in our CI while running parallel tests. Change-Id: Icb5fdb34cc134e3eb341225d56ab67fbbef80b0d Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-10-22PAPI: Add support for format/unformat functions.Ole Troan1-4/+5
With the introduction of new types, like vl_api_address_t it is now possible to call a message using one of those functions with a string representation. E.g. for an IP address ip_add_address(address="1.1.1.1/24") The language wrapper will automatically convert the string into the vl_api_address_t representation. Currently the caller must do the reverse conversion from the returned named tuple with the unformat function. rv = get_address_on_interface(sw_if_index=1) print(VPPFormat.unformat(rv.address)) Change-Id: Ic872b4560b2f4836255bd5260289bfa38c75bc5d Signed-off-by: Ole Troan <ot@cisco.com>
2018-09-27IPIP and IPv6 fragmentationOle Troan1-1/+2
- Error where ICMPv6 error code doesn't reset VLIB_TX = -1 Leading to crash for ICMP generated on tunnelled packets - Missed setting VNET_BUFFER_F_LOCALLY_ORIGINATED, so IP in IPv6 packets never got fragmented. - Add support for fragmentation of buffer chains. - Remove support for inner fragmentation in frag code itself. Change-Id: If9a97301b7e35ca97ffa5c0fada2b9e7e7dbfb27 Signed-off-by: Ole Troan <ot@cisco.com>
2018-09-18STATS: Optimistic concurrency handling in Python library.Ole Troan1-4/+24
Change-Id: I2135f3e77206fd171636a1e0b07c373c0bf093e4 Signed-off-by: Ole Troan <ot@cisco.com>
2018-09-18STATS: Add Python 3 support to vpp_stats.py.Ole Troan1-3/+3
Change-Id: Iad0b0315fbd493b67e6ca490206ec8e8422790ea Signed-off-by: Ole Troan <ot@cisco.com>
2018-09-17STATS: Dynamically mapped shared memory segmentOle Troan1-31/+27
Move from using a hash to a vector with offsets into shared memory. Limit exposure of VPP data structures and include files to external stats library and applications. Change-Id: Ic06129f12d10cf4c4946a86d9bc734eacff2c7da Signed-off-by: Ole Troan <ot@cisco.com>
2018-09-02STATS: Python binding to access VPP statistics and counters.Ole Troan1-0/+161
from vpp_papi.vpp_stats import VPPStats s = VPPStats(socketname='/var/run/stats.sock') c = s.ls('/if/rx') counters = s.dump(c) print(s.set_error_str()) Change-Id: I203ebe60b0c9ee5742aadc737c0f29051757959d Signed-off-by: Ole Troan <ot@cisco.com>