generate_side_by_side.py [437:504]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    oldvid_metrics = json.loads(
        subprocess.check_output(
            [
                "python",
                vismetPath,
                "--orange",
                "--perceptual",
                "--contentful",
                "--force",
                "--renderignore",
                "5",
                "--json",
                "--viewport",
                "--video",
                oldvid,
            ]
        )
    )

    newvid_metrics = json.loads(
        subprocess.check_output(
            [
                "python",
                vismetPath,
                "--orange",
                "--perceptual",
                "--contentful",
                "--force",
                "--renderignore",
                "5",
                "--json",
                "--viewport",
                "--video",
                newvid,
            ]
        )
    )

    if metric.lower() == "perceptualspeedindex":
        progress = "PerceptualSpeedIndexProgress"
        metricName = "PerceptualSpeedIndex"
    elif metric.lower() == "contentfulspeedindex":
        progress = "ContentfulSpeedIndexProgress"
        metricName = "ContentfulSpeedIndex"
    else:
        progress = "VisualProgress"
        metricName = "SpeedIndex"

    x = []
    y = []
    for pt in oldvid_metrics[progress].split(","):
        x_val, y_val = pt.split("=")
        x.append(int(x_val))
        y.append(int(y_val))
    plt.step(x, y, label="Before (%d)" % oldvid_metrics[metricName])

    x = []
    y = []
    for pt in newvid_metrics[progress].split(","):
        x_val, y_val = pt.split("=")
        x.append(int(x_val))
        y.append(int(y_val))
    plt.step(x, y, label="After (%d)" % newvid_metrics[metricName])

    plt.legend(loc="lower right")
    plt.title("%s %s" % (prefix.rstrip("_"), metricName))
    plt.savefig(str(output / "%s-%s-step.png" % (prefix.rstrip("_"), metric)))
    plt.clf()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



mozperftest_tools/mozperftest_tools/side_by_side.py [90:157]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        oldvid_metrics = json.loads(
            subprocess.check_output(
                [
                    "python",
                    vismetPath,
                    "--orange",
                    "--perceptual",
                    "--contentful",
                    "--force",
                    "--renderignore",
                    "5",
                    "--json",
                    "--viewport",
                    "--video",
                    oldvid,
                ]
            )
        )

        newvid_metrics = json.loads(
            subprocess.check_output(
                [
                    "python",
                    vismetPath,
                    "--orange",
                    "--perceptual",
                    "--contentful",
                    "--force",
                    "--renderignore",
                    "5",
                    "--json",
                    "--viewport",
                    "--video",
                    newvid,
                ]
            )
        )

        if metric.lower() == "perceptualspeedindex":
            progress = "PerceptualSpeedIndexProgress"
            metricName = "PerceptualSpeedIndex"
        elif metric.lower() == "contentfulspeedindex":
            progress = "ContentfulSpeedIndexProgress"
            metricName = "ContentfulSpeedIndex"
        else:
            progress = "VisualProgress"
            metricName = "SpeedIndex"

        x = []
        y = []
        for pt in oldvid_metrics[progress].split(","):
            x_val, y_val = pt.split("=")
            x.append(int(x_val))
            y.append(int(y_val))
        plt.step(x, y, label="Before (%d)" % oldvid_metrics[metricName])

        x = []
        y = []
        for pt in newvid_metrics[progress].split(","):
            x_val, y_val = pt.split("=")
            x.append(int(x_val))
            y.append(int(y_val))
        plt.step(x, y, label="After (%d)" % newvid_metrics[metricName])

        plt.legend(loc="lower right")
        plt.title("%s %s" % (prefix.rstrip("_"), metricName))
        plt.savefig(str(output / "%s-%s-step.png" % (prefix.rstrip("_"), metric)))
        plt.clf()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



