aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2018-05-24 13:37:53 +0200
committerTibor Frank <tifrank@cisco.com>2018-05-24 13:48:11 +0200
commit3a90d6c0ba09e47d576c92aab21b2ed9b2dd75ce (patch)
treedda8699219206be6fcf609dd496b43a57b682682 /resources/tools
parent372eab0eac428149d547b2d6eb2ce43cd0d750f6 (diff)
FIX: Trending dashboard
Change-Id: I7634a4074647ef226cd6fb3ac1b5e0ee5376c4d4 Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools')
-rw-r--r--resources/tools/presentation/generator_tables.py44
1 files changed, 18 insertions, 26 deletions
diff --git a/resources/tools/presentation/generator_tables.py b/resources/tools/presentation/generator_tables.py
index 38439bac5c..b2e60be478 100644
--- a/resources/tools/presentation/generator_tables.py
+++ b/resources/tools/presentation/generator_tables.py
@@ -21,9 +21,8 @@ import prettytable
import pandas as pd
from string import replace
-from math import isnan
from collections import OrderedDict
-from numpy import nan
+from numpy import nan, isnan
from xml.etree import ElementTree as ET
from errors import PresentationError
@@ -730,13 +729,13 @@ def table_performance_trending_dashboard(table, input_data):
data = input_data.filter_data(table, continue_on_error=True)
# Prepare the header of the tables
- header = [" Test Case",
+ header = ["Test Case",
"Trend [Mpps]",
- " Short-Term Change [%]",
- " Long-Term Change [%]",
- " Regressions [#]",
- " Progressions [#]",
- " Outliers [#]"
+ "Short-Term Change [%]",
+ "Long-Term Change [%]",
+ "Regressions [#]",
+ "Progressions [#]",
+ "Outliers [#]"
]
header_str = ",".join(header) + "\n"
@@ -752,7 +751,7 @@ def table_performance_trending_dashboard(table, input_data):
"-".join(tst_data["name"].
split("-")[1:]))
tbl_dict[tst_name] = {"name": name,
- "data": dict()}
+ "data": OrderedDict()}
try:
tbl_dict[tst_name]["data"][str(build)] = \
tst_data["result"]["throughput"]
@@ -764,18 +763,16 @@ def table_performance_trending_dashboard(table, input_data):
if len(tbl_dict[tst_name]["data"]) > 2:
pd_data = pd.Series(tbl_dict[tst_name]["data"])
- last_key = pd_data.keys()[-1]
- win_size = min(pd_data.size, table["window"])
- win_first_idx = pd_data.size - win_size
- key_14 = pd_data.keys()[win_first_idx]
- long_win_size = min(pd_data.size, table["long-trend-window"])
-
data_t, _ = split_outliers(pd_data, outlier_const=1.5,
- window=win_size)
-
+ window=table["window"])
+ last_key = data_t.keys()[-1]
+ win_size = min(data_t.size, table["window"])
+ win_first_idx = data_t.size - win_size
+ key_14 = data_t.keys()[win_first_idx]
+ long_win_size = min(data_t.size, table["long-trend-window"])
median_t = data_t.rolling(window=win_size, min_periods=2).median()
stdev_t = data_t.rolling(window=win_size, min_periods=2).std()
- median_first_idx = pd_data.size - long_win_size
+ median_first_idx = median_t.size - long_win_size
try:
max_median = max(
[x for x in median_t.values[median_first_idx:-win_size]
@@ -791,15 +788,10 @@ def table_performance_trending_dashboard(table, input_data):
except KeyError:
median_t_14 = nan
- # Test name:
- name = tbl_dict[tst_name]["name"]
-
# Classification list:
classification_lst = list()
- for build_nr, value in pd_data.iteritems():
-
- if isnan(data_t[build_nr]) \
- or isnan(median_t[build_nr]) \
+ for build_nr, value in data_t.iteritems():
+ if isnan(median_t[build_nr]) \
or isnan(stdev_t[build_nr]) \
or isnan(value):
classification_lst.append("outlier")
@@ -823,7 +815,7 @@ def table_performance_trending_dashboard(table, input_data):
((last_median_t - max_median) / max_median) * 100, 2)
tbl_lst.append(
- [name,
+ [tbl_dict[tst_name]["name"],
'-' if isnan(last_median_t) else
round(last_median_t / 1000000, 2),
'-' if isnan(rel_change_last) else rel_change_last,
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
# -*- coding: utf-8 -*-
#
# CSIT 17.01 report documentation build configuration file, created by
# sphinx-quickstart on Sun Jan 15 09:49:36 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys

sys.path.insert(0, os.path.abspath('.'))

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = []

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
source_suffix = ['.rst', '.md']

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'FD.io CSIT'
copyright = u'2017, FD.io'
author = u'FD.io CSIT'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
#version = u''
# The full version, including alpha/beta/rc tags.
#release = u''

rst_epilog = """
.. |release-1| replace:: rls1704
.. |vpp-release| replace:: VPP-17.07 release
.. |vpp-release-1| replace:: VPP-17.04 release
.. |dpdk-release| replace:: DPDK 17.02
.. |trex-release| replace:: TRex v2.25
.. |virl-image-ubuntu| replace:: ubuntu-16.04.1_2017-02-23_1.8
.. |virl-image-centos| replace:: centos-7.3-1611_2017-02-23_1.4

.. _tag documentation rst file: https://git.fd.io/csit/tree/docs/tag_documentation.rst?h=rls1704
.. _TRex intallation: https://git.fd.io/csit/tree/resources/tools/t-rex/t-rex-installer.sh?h=rls1704
.. _TRex driver: https://git.fd.io/csit/tree/resources/tools/t-rex/t-rex-stateless.py?h=rls1704
.. _CSIT Honeycomb Functional Tests Documentation: https://docs.fd.io/csit/rls1704/doc/tests.func.html
.. _CSIT Testpmd Performance Tests Documentation: https://docs.fd.io/csit/rls1704/doc/tests.perf.html
.. _CSIT VPP Functional Tests Documentation: https://docs.fd.io/csit/rls1704/doc/tests.func.html
.. _CSIT VPP Performance Tests Documentation: https://docs.fd.io/csit/rls1704/doc/tests.perf.html
.. _VPP test framework documentation: https://docs.fd.io/vpp/17.04/vpp_make_test/html/
.. _FD.io test executor vpp performance jobs: https://jenkins.fd.io/view/csit/job/csit-vpp-perf-1704-all
.. _FD.io test executor dpdk performance jobs: https://jenkins.fd.io/view/csit/job/csit-dpdk-perf-1704-all
.. _FD.io VPP compile job: https://jenkins.fd.io/view/vpp/job/vpp-merge-1704-ubuntu1604/
"""

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False

#pdf_documents = [('index', u'rst2pdf', u'Sample rst2pdf doc', u'Your Name'),]


# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further.  For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_theme_path = ['env/lib/python2.7/site-packages/sphinx_rtd_theme']

html_static_path = ['../../../docs/report/_static']

html_context = {
    'css_files': [
        '_static/theme_overrides.css',  # overrides for wide tables in RTD theme
        ],
    }

# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = u'CSIT 17.07 report'

# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
    # The paper size ('letterpaper' or 'a4paper').
    #
    # 'papersize': 'letterpaper',

    # The font size ('10pt', '11pt' or '12pt').
    #
    # 'pointsize': '10pt',

    # Additional stuff for the LaTeX preamble.
    #
    # 'preamble': '',

    # Latex figure (float) alignment
    #
    # 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
#  author, documentclass [howto, manual, or own class]).
latex_documents = [
    (master_doc, 'CSIT1707report.tex', u'CSIT 17.07 report',
     u'cisco', 'manual'),
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
    (master_doc, 'csit1707report', u'CSIT 17.07 report',
     [author], 1)
]


# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
#  dir menu entry, description, category)
texinfo_documents = [
    (master_doc, 'CSIT1707report', u'CSIT 17.07 report',
     author, 'CSIT1707report', 'One line description of project.',
     'Miscellaneous'),
]