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

Parallelize RAGE queries and fix some decoding #96

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Commits on Nov 29, 2019

  1. use http basic authentication when fetching url data

    Signed-off-by: Marcus Granado <marcus.granado@citrix.com>
    mg12ctx authored and edwintorok committed Nov 29, 2019
    Configuration menu
    Copy the full SHA
    bd364b9 View commit details
    Browse the repository at this point in the history

Commits on Dec 19, 2019

  1. fix brief report link

    It wants an `&` at the end, otherwise the javascript interprets
    `#brief_report_analysis` as part of whatever ends up as the last parameter.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    edwintorok committed Dec 19, 2019
    Configuration menu
    Copy the full SHA
    27307ed View commit details
    Browse the repository at this point in the history
  2. CP-30677: expand variables from XenRT suite files

    XenRT suite files can contain '<include filename="perf.inc" />' to include variable definitions
    from another file.
    The filename itself can be a variable, usually ${PRODUCT_VERSION}.
    
    Read PRODUCT_VERSION default from the configuration file (in our case /etc/rage_passwd).
    Fetch and parse the include file for any parameters, and make upper-case parameters available for substitution.
    
    The suite files can also contain RAGE's own lisp-like language which has lower-case variables,
    so keep lower-case variables as is for expansion later by the lisp-like interpreter.
    
    Once we have the substitutions apply them to each row we read from the suite file.
    
    RAGE still runs on OCaml 4.01, and OMake, so this is using the Str module for regexes.
    Should replace this some day with newer OCaml version and 're' module.
    
    Tested by copying to /var/www/rage-test-edvint on rage, and opening
    http://rage.uk.xensource.com/test-edvint.cgi?p=brief&id=https://info.citrite.net/display/~svcacct_ragebot/RAGE+report+test
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    edwintorok committed Dec 19, 2019
    Configuration menu
    Copy the full SHA
    7a8e811 View commit details
    Browse the repository at this point in the history
  3. Clean up Curl connections

    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    edwintorok committed Dec 19, 2019
    Configuration menu
    Copy the full SHA
    c6f4168 View commit details
    Browse the repository at this point in the history
  4. Update to OCaml 4.08.1, Core v0.13, and Dune build system

    Polymorphic comparison is not visible by default now, the default
    comparison operators are for int.
    Have to locally open the module for the appropriate type, or use
    Polymorphic_compare.(a = b) if none is available.
    
    Similarly all List lookup functions take an ~equal parameter now.
    
    List.sort and List.dedup_and_sort take a ~compare parameter
    (there is no dedup without sorting anymore).
    
    Be careful with comparing NULL values when deduping and sorting
    (NULL) fails the int_of_string which could cause List.dedup_and_sort to loose 1 value
    as it considered it identical to NULL if the `cmp` function was used for
    comparison. Make sure to use the String.compare function as the original
    could would implicitly use.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    edwintorok committed Dec 19, 2019
    Configuration menu
    Copy the full SHA
    ec01f32 View commit details
    Browse the repository at this point in the history
  5. decode &45; to - for --

    -- is not allowed inside XML tags.
    
    Some phoronix tests have -- in tc_arguments now.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    edwintorok committed Dec 19, 2019
    Configuration menu
    Copy the full SHA
    f16d7b6 View commit details
    Browse the repository at this point in the history
  6. Add bootmode precedence

    This is BIOS, UEFI, etc. which could matter when comparing results.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    edwintorok committed Dec 19, 2019
    Configuration menu
    Copy the full SHA
    5745fe3 View commit details
    Browse the repository at this point in the history
  7. Escaping for +

    Again, some Phoronix tests use this.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    edwintorok committed Dec 19, 2019
    Configuration menu
    Copy the full SHA
    85c44f5 View commit details
    Browse the repository at this point in the history
  8. Show patches_applied, and build_is_release axes

    patches_applied is a simplified form of what hotfixes have been applied,
    e.g XS80E{001-006}, and most importantly the empty string when testing
    an RTM release. This allows to create performance comparisons with RTM
    releases easily.
    (RTM releases have the 'all_hotfixes' build_tag with 0 patches applied,
     so previously we couldn't filter them)
    
    build_is_release tries to determine whether a hotfix was a dev-signed
    test, or a release-signed hotfix test. Release-signed doesn't
    necessarily mean we released it, but if we remove all the dev-signed
    ones we'll have less noise in our results.
    Also unreleased hotfixes can (and in fact) have performance regressions
    that were caught and fixed before a release. We do not want the same
    performance regressions to go unnoticed in master.
    
    Once a hotfix is released a cronjob could go through previous tests that
    were imported and blacklist them, but for now this is a good
    approximation.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    edwintorok committed Dec 19, 2019
    Configuration menu
    Copy the full SHA
    f73dec2 View commit details
    Browse the repository at this point in the history
  9. Fix some Dune warnings

    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    edwintorok committed Dec 19, 2019
    Configuration menu
    Copy the full SHA
    3639eab View commit details
    Browse the repository at this point in the history
  10. Memoize the result of some Sql queries: we've been repeating the same…

    … query thousands of times
    
    This reduces brief report load time to ~6s from ~10s for 90 rows (the full report contains thousands)
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    edwintorok committed Dec 19, 2019
    Configuration menu
    Copy the full SHA
    e45cbe6 View commit details
    Browse the repository at this point in the history
  11. Async postgres queries

    Use a Deferred monad for performing queries.
    This is similar to Lwt: instead of getting a response we get a
    promise/future that we can evaluate later when the answer is available.
    
    This'll allow us to do things like List.map and run bunch of queries in
    parallel.
    
    I simply run the postgresql query in a different thread on its own
    connection (limited to number of cores/machine).
    
    It would be possible to avoid using multiple threads and use
    multiplexing via epoll and non-blocking reads/writes but libpq is
    difficult to use: it will reconnect and change the file descriptor
    behing your back which will cause epoll to fail because it is no longer
    registered for epoll.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    edwintorok committed Dec 19, 2019
    Configuration menu
    Copy the full SHA
    e337897 View commit details
    Browse the repository at this point in the history
  12. async wip

    edwintorok committed Dec 19, 2019
    Configuration menu
    Copy the full SHA
    51ee3c8 View commit details
    Browse the repository at this point in the history
  13. Convert queries to asynchronous queries

    Using the ppx syntax extension:
    `let%map y = f x in ...` is equivalent to `f x >>| fun y -> ..`
    `let%bind y = f x in ...` is equivalent to `f x >>= fun y -> ...`
    
    Except these also allow you to do parallel binds, which is tedious to
    accomplish "manually".
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    edwintorok committed Dec 19, 2019
    Configuration menu
    Copy the full SHA
    4dcb9a9 View commit details
    Browse the repository at this point in the history
  14. Convert more queries to asynchronous ones

    Also use Deferred.List.map instead of List.map
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    edwintorok committed Dec 19, 2019
    Configuration menu
    Copy the full SHA
    98478d9 View commit details
    Browse the repository at this point in the history
  15. Shut down the async loop when done

    RAGE is not a long running daemon, it is a CGI, so stop the async
    scheduler when done.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    edwintorok committed Dec 19, 2019
    Configuration menu
    Copy the full SHA
    a8a9052 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    85d690b View commit details
    Browse the repository at this point in the history
  17. Handle nested includes from suite definitions

    a suite can include quebec.inc, which includes perf_release.inc.
    The latter defines the debian/centos distro that we use, so we must
    expand nested includes.
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    edwintorok committed Dec 19, 2019
    Configuration menu
    Copy the full SHA
    e81d0b7 View commit details
    Browse the repository at this point in the history
  18. Parallelize more queries

    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    edwintorok committed Dec 19, 2019
    Configuration menu
    Copy the full SHA
    2130144 View commit details
    Browse the repository at this point in the history
  19. Parallelize more queries

    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    edwintorok committed Dec 19, 2019
    Configuration menu
    Copy the full SHA
    2210dd4 View commit details
    Browse the repository at this point in the history
  20. parallelize more queries and https queries too

    Especially with nested includes we need to fetch quite a few files,
    so parallelize where possible.
    
    OpenSSL is not thread safe by default, so we have to initialize
    threading mode before using it.
    (We don't use it directly, but through curl)
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    edwintorok committed Dec 19, 2019
    Configuration menu
    Copy the full SHA
    cfaab55 View commit details
    Browse the repository at this point in the history
  21. Show more accurate median statistics

    The median is only the n/2 indexed element when
    there are an odd number of elements, otherwise have to interpolate.
    
    Also calculate the Tukey Fences, defined as Q1-1.5*IQR, Q3+1.5*IQR with IQR=Q3-Q1.
    Useful for spotting outliers, or non-normal distributions.
    
    We usually have a small number of data points, and no guarantees that
    the data is normally distributed, so using median and quantile
    statistics is probably the right choice since they are more robust to
    outliers.
    (e.g. due to caching effects the 1st data point in a VM boot time
     could be significantly larger than the rest, although still valid)
    
    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    edwintorok committed Dec 19, 2019
    Configuration menu
    Copy the full SHA
    51b1d9c View commit details
    Browse the repository at this point in the history
  22. ssl0.5.7 for older openssl version

    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    edwintorok committed Dec 19, 2019
    Configuration menu
    Copy the full SHA
    8f90a17 View commit details
    Browse the repository at this point in the history
  23. fix url decoding of -

    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    edwintorok committed Dec 19, 2019
    Configuration menu
    Copy the full SHA
    c038cac View commit details
    Browse the repository at this point in the history
  24. Disable forcing of Y from/to zero and split by build_is_release

    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    edwintorok committed Dec 19, 2019
    Configuration menu
    Copy the full SHA
    ceb86d3 View commit details
    Browse the repository at this point in the history
  25. Add Travis CI build script

    Signed-off-by: Edwin Török <edvin.torok@citrix.com>
    edwintorok committed Dec 19, 2019
    Configuration menu
    Copy the full SHA
    5e5e7f2 View commit details
    Browse the repository at this point in the history