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

Measure latency of app.breathe() #777

Closed
wants to merge 1 commit into from

Conversation

wingo
Copy link
Contributor

@wingo wingo commented Feb 23, 2016

This commit adds a histogram facility that can record the distribution
of different sampled magnitudes. In particular, it is useful for
recording distributions of times. Histograms can be mapped into
/var/run/snabb, where they can be analyzed by a separate process.

This commit also wires up the app.breathe() loop to record latencies for
its breath cycles into a well-known
file (/var/run/snabb/PID/engine/latency), and wires up "snabb top" to do
some basic statistics on this data.

This commit adds a histogram facility that can record the distribution
of different sampled magnitudes.  In particular, it is useful for
recording distributions of times.  Histograms can be mapped into
/var/run/snabb, where they can be analyzed by a separate process.

This commit also wires up the app.breathe() loop to record latencies for
its breath cycles into a well-known
file (/var/run/snabb/PID/engine/latency), and wires up "snabb top" to do
some basic statistics on this data.
@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @eugeneia, @lukego and @javierguerragiraldez to be potential reviewers

@wingo
Copy link
Contributor Author

wingo commented Feb 23, 2016

Originally from Igalia#276.

@kbara
Copy link
Contributor

kbara commented Feb 24, 2016

I'd like to nominate @eugeneia to be the reviewer/upstream on this one, if he's willing.

if options.measure_latency or options.measure_latency == nil then
local histogram = require('lib.histogram')
local latency = histogram.create('engine/latency', 1e-6, 1e0)
print('hi')
Copy link
Member

Choose a reason for hiding this comment

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

I assume this is a debug leftover?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep, good catch

@eugeneia
Copy link
Member

Super cool feature, love to see snabb top extended. Until now I wasn't sure if anybody except me used it. ;-)

@lukego I think the histogram module in this PR would be useful in other applications as well and should be a core.shm extension (core.histogram) similar to core.counter. What do you think?

@wingo
Copy link
Contributor Author

wingo commented Feb 26, 2016

Snabb top has been really useful to us -- for example if we are experiencing packet loss, we need to find where it happens: between which apps, or if not between any apps then on ingress. It helped us have insight on whether to apply backpressure or not (usually we don't, now, following #656). It's good stuff :)

I can look at switching to use core.shm.map; good suggestion. I guess by default core.shm.map should clear the file if a previous PID had it open, though.

@eugeneia eugeneia closed this Mar 1, 2016
dpino pushed a commit to dpino/snabb that referenced this pull request Mar 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants