<jupyter_start><jupyter_text>Evergreen data extraction and analysisThis notebook demonstrates how to extract historical wiredtiger performance data from evergreen and produce a simple chart as an example of custom analysis. First, we can use the public REST APIs provided by both Evergreen and Cedar to gather historical data. No authentication is required for this process and documentation for how to use these APIs can be found [here](https://github.com/evergreen-ci/evergreen/wiki/REST-V1-Usage) for Evergreen and [here](https://github.com/evergreen-ci/cedar/wiki/Rest-V1-Usage) for Cedar.**Note: This step may take a while to finish downloading data. Make sure you wait for this step to complete before moving onto the next one.**<jupyter_code>import requests

# Get the last 100 builds from evergreen.
r = requests.get(f"https://evergreen.mongodb.com/rest/v1/projects/wiredtiger/versions?limit=100")
last_100_versions = [ v["version_id"] for v in r.json()["versions"] ]

# Get the performance results from these builds from Cedar.
last_100_versions_data = []
for version in last_100_versions:
    r = requests.get(f"https://cedar.mongodb.com/rest/v1/perf/version/{version}")

    if not r:
        # This will happen when perf data has not yet been collected for the build, or if the job failed.
        print(f"Warning: can't find details for `{version}`. Skipping these results")
        continue

    last_100_versions_data.append(r.json())<jupyter_output>Warning: can't find details for `wiredtiger_53c935945568b2acc00bd2b0047133790d15a32c`. Skipping these results
Warning: can't find details for `wiredtiger_07cd767ca19bbc2aaef0a82469992e7b3dadfaed`. Skipping these results
Warning: can't find details for `wiredtiger_7dead6ad871103c488722d2f589f4f09c37d6267`. Skipping these results
Warning: can't find details for `wiredtiger_4df85221d3b2181935eddca520d17513a9c39ef5`. Skipping these results
Warning: can't find details for `wiredtiger_ab8f444cf493a7133e85cbee1a5847c410770bcd`. Skipping these results<jupyter_text>The data provided by Evergreen and Cedar is in `json` format, allowing for easy manipulation in Python.In the example below the `Load time` results for `perf-test-long-btree` test have been extracted<jupyter_code>data = []
for v in last_100_versions_data:
    for test in v:
        if test["info"]["task_name"] == "perf-test-long-btree":
            for stat in test["rollups"]["stats"]:
                if stat["name"] == "Load time":
                    data.append(stat["val"])<jupyter_output><empty_output><jupyter_text>and a simple plot generated<jupyter_code>from matplotlib import pyplot as plt

print(len(data))
plt.plot(data)<jupyter_output>99
{'fraction_non_alphanumeric': 0.08616187989556136, 'fraction_numerical': 0.0566952629615815, 'mean_word_length': 5.026966292134832, 'pattern_counts': {'":': 2, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '65699', 'license': 'Apache-2.0', 'n_tokens_mistral': 928, 'n_tokens_neox': 826, 'n_words': 264, 'path': 'src/third_party/wiredtiger/bench/analytics/custom_analysis/evergreen_analysis.ipynb', 'repo_name': 'benety/mongo', 'size': '2681'}