memsniff icon indicating copy to clipboard operation
memsniff copied to clipboard

Display is not stable-sorted

Open fgm opened this issue 6 years ago • 1 comments

When using the -cumulative flag to measure total traffic from just one specific page, the order of the lines in the output moves on each refresh even in the absence of traffic, with results not changing.

It appears that all lines with the same result for max(size) and sum(size) move their relative locations, suggesting the sort method should include the key as the last element of the ordering rule, to get a stable display on a stable system.

Example from such a capture:

logement-cache_bootstrap-logement-cache-_multi0-variables            1048205          1048205
logement-cache_views-logement-cache-_multi0-views_data%253Afr        1048205          1048205
logement-cache-logement-cache-_multi0-schema                         1048205          1048205
logement-cache_views-logement-cache-_multi1-views_data%253Afr        1048205          1048205
logement-cache_views-logement-cache-_multi2-views_data%253Afr        1048205          1048205

In this example, these five lines near the top of the report are constantly switching their relative positions.

fgm avatar Jul 25 '18 08:07 fgm

I suspect this wouldl be solved by changing uiContext.update() near line 226 from:

u.prevReport.SortBy(-2)

to

u.prevReport.SortBy(-2, -1, 0)

in order to sort by decreasing total size, then decreasing unit size, then key.

fgm avatar Jul 25 '18 09:07 fgm