Skip to content
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

Can not get latency stats #496

Open
dgalan-xxia opened this issue Mar 9, 2022 · 3 comments
Open

Can not get latency stats #496

dgalan-xxia opened this issue Mar 9, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@dgalan-xxia
Copy link

dgalan-xxia commented Mar 9, 2022

Version information
snappi-ixnetwork 0.7.5

Describe the bug
Below snippet seems to have no effect in this version:

print("Enabling latency metrics")
for flow in config.flows:
    flow.metrics.latency.enable = True

Since below returns None

results = api.get_metrics(request).flow_metrics
latencies = [res.latency.average_ns for res in results ]
@ANISH-GOTTAPU ANISH-GOTTAPU added the bug Something isn't working label Mar 9, 2022
@alakendu alakendu moved this to In Progress in Open Traffic Generator Mar 9, 2022
@alakendu
Copy link
Contributor

alakendu commented Mar 9, 2022

I am getting this latency when run our internal UT (https://github.com/open-traffic-generator/snappi-ixnetwork/blob/main/tests/metrics/test_latency_metrics.py) with api._enable_flow_tracking(True)

  latency:
    average_ns: 0
    maximum_ns: 0
    minimum_ns: 0

It looks like this is specific to some HW or test script. Could you please provide entire script and chassis/ card type

@dgalan-xxia
Copy link
Author

Indeed - our script creates flows and enables latency twice on the same session.
Our code had a check to determine if it's running on UHD and enable latency only if not. That check was to see if href of a chassis object is populated, which now, after the first apply, it is, causing the latency enabling to be skipped for the second round of flows. Fixing our scripts.

Repository owner moved this from In Progress to Done in Open Traffic Generator Mar 9, 2022
@dgalan-xxia
Copy link
Author

did some more testing and realized our script was clearing the config (applying an empty config) before checking the chassis properties. so the issue seems to be that clearing the config does not clear the chassis/location object anymore

    def enable_latency_stats(traffic_api: snappi.Api, config:snappi.snappi.Config):
        # if setup is not UHD, enable latency stats
        traffic_api.set_config(traffic_api.config())
        ixn_session = traffic_api.assistant.Session.Ixnetwork
        chassis = ixn_session.AvailableHardware.Chassis.find()
        try:
            chassis.href #only UHD has an empty session prepopulated with a chassis
        except:
            print("Enabling latency metrics")
            for flow in config.flows:
                flow.metrics.latency.enable = True

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants