[RFC] simulating network properties for benchmarks

Aaron Bentley aaron.bentley at utoronto.ca
Fri Jul 21 06:01:49 BST 2006


Robert Collins wrote:

> Heres a prototype of what I was referring to. The decorator in it was
> quick-coded, if the future directions I mention in it are to be done, it
> would deserve unit tests, as high layer tests could no longer test it at
> that point.
> 
> I'm pushing this up to
> sftp://bazaar.launchpad.net/~bzr/bzr/test-sftp-latency now.

This is the approach seems pretty natural to me.  But an interesting
alternative would be for the transport to not sleep, but instead, move
the clock ahead.  That would mean we could simulate slow operations
quickly, which would make such tests easier to run.

Obviously we can't change the system clock, but we could have the
transport update a global variable, and have the bench suite use that
for its calculations.

The disadvantage is that lsprof won't understand what's going on-- but
does sleep show up in lsprof, or does it measure CPU time?

Aaron




More information about the bazaar mailing list