This is an archive of the discontinued LLVM Phabricator instance.

LNT graph New Setting options to use mean as aggregation function
ClosedPublic

Authored by Andi on Dec 6 2016, 4:54 PM.

Details

Summary

Added a new settings option in LNT graph to use the mean instead of min/max as the aggregation function.

Added that this setting persists for the duration of the session.

Added simple test cases

Diff Detail

Repository
rL LLVM

Event Timeline

Andi updated this revision to Diff 80506.Dec 6 2016, 4:54 PM
Andi retitled this revision from to LNT graph New Setting options to use mean as aggregation function.
Andi updated this object.
Andi added a reviewer: cmatthews.
cmatthews edited edge metadata.Dec 9 2016, 1:14 PM

This is a much needed update to the graphing. Thanks Andi!

lnt/server/ui/templates/v4_graph.html
160 ↗(On Diff #80506)

Maybe just "Mean() as aggregation:"

lnt/server/ui/views.py
515 ↗(On Diff #80506)

Combine with line above.

lnt/util/stats.py
28 ↗(On Diff #80506)

I think this needs to work with ints as well as floats.

28 ↗(On Diff #80506)

Better to have this in the docstring. Comments should be full sentences (missing .).

29 ↗(On Diff #80506)

A docstring describing the input for this is needed. It is an enumeration of (val, index) tuples?

31 ↗(On Diff #80506)

space after ,

38 ↗(On Diff #80506)

Should this be 0, or some index value derived from the input pairs?

38 ↗(On Diff #80506)

space around operator

tests/server/ui/V4Pages.py
439 ↗(On Diff #80506)

Why no slash in front of these?

tests/server/ui/statsTester.py
4 ↗(On Diff #80506)

Probably no need to add this.

11 ↗(On Diff #80506)

Could you refactor this to use the Python unittest framework? I am trying to use that everywhere for the Python based tests.

13 ↗(On Diff #80506)

I think logging does not need to be in this test. We normally only enable that for sever tests that might log something.

26 ↗(On Diff #80506)

spaces after ,

26 ↗(On Diff #80506)

Test with floats and ints.

27 ↗(On Diff #80506)

Space after ,

30 ↗(On Diff #80506)

You mention it should work with enumerations, maybe should be tested with one.

Andi added inline comments.Dec 14 2016, 11:48 AM
lnt/util/stats.py
38 ↗(On Diff #80506)

The aggregation function returns two values: agg_value, agg_index

For min and max, the index makes sense as it corresponds to an actual data point's value. Then the agg_index is used to populate metadata with the run_id and date from where this value came from.

The mean, is not really associated with any specific data point, but rather with all the data points coming form a specific date and run (as far as I can tell). So I picked zero to get the data and run_id.

cmatthews added inline comments.Dec 14 2016, 1:58 PM
lnt/util/stats.py
38 ↗(On Diff #80506)

Okay, that makes sense.

Andi updated this revision to Diff 81663.Dec 15 2016, 2:22 PM
Andi edited edge metadata.

Updated the code in accordance with the reviewer's comments.
Also changed the statsTester to use unittests

cmatthews accepted this revision.Jan 17 2017, 4:48 PM

Looks good. Thanks Andi!

This revision is now accepted and ready to land.Jan 17 2017, 4:48 PM
This revision was automatically updated to reflect the committed changes.