In [1]:
import pymongo
from pymongo import MongoClient
from claspy.segmentation import BinaryClaSPSegmentation
import os
In [2]:
def get_collection():
    uri = os.environ.get('MONGO_URL')
    client = MongoClient(uri,
                        tls=True,
                        tlsCertificateKeyFile=os.environ.get('MONGO_KEYPATH'))
    db = client['scx']
    collection = db['schbench']
    return collection
    
collection = get_collection()
In [3]:
cursor = collection.find({})
data = []
for a in cursor:
    data.append(a)
In [ ]:
 
In [4]:
s_data = new_list = sorted(data, key=lambda x: x['git']['commit_time'])
In [ ]:
 
In [ ]:
 
In [5]:
from copy import deepcopy
n_data_l = []
for data in s_data:
    n_data = deepcopy(data)
    n_data['results'] = [x for x in data['results']['iterations'] if x['runtime'] == 30][0]
    n_data['results'].update(**[x for x in data['results']['iterations'] if x['runtime'] == 10][0])
    n_data['system']['cpu_temp'] = data['system']['cpu_temp'][0]
    n_data_l.append(n_data)
In [6]:
import pandas as pd

c_data = [pd.json_normalize(x) for x in n_data_l]
df = pd.json_normalize(n_data_l)
df['git.commit_time'] = pd.to_datetime(df['git.commit_time'])
df = df.loc[(df["git.commit_time"] >= "2024-12-02")]
df = df.sort_values(by='git.commit_time')
In [7]:
df.head()
Out[7]:
_id timestamp run git.commit_time git.commit_hash git.commit_msg system.kernel_version system.hostname system.cpu system.ram ... results.metrics.system_perf_data.stalled_cycles_frontend results.metrics.system_perf_data.stalled_cycles_frontend_percent results.metrics.system_perf_data.branches results.metrics.system_perf_data.branch_misses results.metrics.system_perf_data.branch_misses_percent results.metrics.system_perf_data.time_elapsed_sec results.metrics.system_ctx_data.cswch/s results.metrics.system_ctx_data.nvcswch/s results.current_rps results.average_rps
193 672ca85e840de30881f01d1b1baaa9ca9c61702d47a3e5... 2025-03-31T21:57:37.329957 1 2024-12-02 03:15:11 faa9906b Merge pull request #1017 from ruihe774/ppd 6.14.0-63.fc42.x86_64 mini AMD Ryzen 9 7950X3D 16-Core Processor 28.97 GB ... 3.353985e+10 2.79 2.208088e+11 1.113371e+09 0.50 8.486504 118.48 0.72 2798.70 2775.27
194 1dcfd1c232be4059db02df3c2e578666bdb982e205329f... 2025-04-01T21:50:18.434474 2 2024-12-02 03:15:11 faa9906b Merge pull request #1017 from ruihe774/ppd 6.14.0-63.fc42.x86_64 mini AMD Ryzen 9 7950X3D 16-Core Processor 28.97 GB ... 4.195164e+10 3.25 2.363885e+11 1.403609e+09 0.59 7.583640 115.75 0.50 2823.68 2811.43
195 764385dd3535a3d9b3155d3c834e20c887c7467291b62f... 2025-04-01T06:59:51.769033 1 2024-12-02 05:19:03 c1690c3d Merge pull request #1016 from multics69/vmlinux 6.14.0-63.fc42.x86_64 mini AMD Ryzen 9 7950X3D 16-Core Processor 28.97 GB ... 3.450760e+10 4.67 1.358598e+11 1.141247e+09 0.84 5.968980 115.82 0.52 2808.94 2793.77
196 0a0c13fb5d4b085df4d90e32828bfa8cfc9c1d4b83d937... 2025-04-01T18:35:04.053862 2 2024-12-02 05:19:03 c1690c3d Merge pull request #1016 from multics69/vmlinux 6.14.0-63.fc42.x86_64 mini AMD Ryzen 9 7950X3D 16-Core Processor 28.97 GB ... 2.389201e+10 2.81 1.562287e+11 8.026542e+08 0.51 5.983385 115.59 0.52 2839.73 2828.00
197 26c7470da7577f631246b744732bd1a3845b75793329a0... 2025-04-01T02:43:59.228631 1 2024-12-02 15:28:30 c6486d18 Merge pull request #1021 from etsal/etsal/igno... 6.14.0-63.fc42.x86_64 mini AMD Ryzen 9 7950X3D 16-Core Processor 28.97 GB ... 3.410113e+10 3.23 1.921651e+11 1.139160e+09 0.59 4.605355 116.73 0.65 2794.10 2782.30

5 rows × 54 columns

In [8]:
import plotly.express as px
import pandas as pd

fig = px.line(df, x='git.commit_time', y='results.average_rps', color='system.cpu_temp', title='Value Over Time')
fig.show()
In [9]:
df.head()
Out[9]:
_id timestamp run git.commit_time git.commit_hash git.commit_msg system.kernel_version system.hostname system.cpu system.ram ... results.metrics.system_perf_data.stalled_cycles_frontend results.metrics.system_perf_data.stalled_cycles_frontend_percent results.metrics.system_perf_data.branches results.metrics.system_perf_data.branch_misses results.metrics.system_perf_data.branch_misses_percent results.metrics.system_perf_data.time_elapsed_sec results.metrics.system_ctx_data.cswch/s results.metrics.system_ctx_data.nvcswch/s results.current_rps results.average_rps
193 672ca85e840de30881f01d1b1baaa9ca9c61702d47a3e5... 2025-03-31T21:57:37.329957 1 2024-12-02 03:15:11 faa9906b Merge pull request #1017 from ruihe774/ppd 6.14.0-63.fc42.x86_64 mini AMD Ryzen 9 7950X3D 16-Core Processor 28.97 GB ... 3.353985e+10 2.79 2.208088e+11 1.113371e+09 0.50 8.486504 118.48 0.72 2798.70 2775.27
194 1dcfd1c232be4059db02df3c2e578666bdb982e205329f... 2025-04-01T21:50:18.434474 2 2024-12-02 03:15:11 faa9906b Merge pull request #1017 from ruihe774/ppd 6.14.0-63.fc42.x86_64 mini AMD Ryzen 9 7950X3D 16-Core Processor 28.97 GB ... 4.195164e+10 3.25 2.363885e+11 1.403609e+09 0.59 7.583640 115.75 0.50 2823.68 2811.43
195 764385dd3535a3d9b3155d3c834e20c887c7467291b62f... 2025-04-01T06:59:51.769033 1 2024-12-02 05:19:03 c1690c3d Merge pull request #1016 from multics69/vmlinux 6.14.0-63.fc42.x86_64 mini AMD Ryzen 9 7950X3D 16-Core Processor 28.97 GB ... 3.450760e+10 4.67 1.358598e+11 1.141247e+09 0.84 5.968980 115.82 0.52 2808.94 2793.77
196 0a0c13fb5d4b085df4d90e32828bfa8cfc9c1d4b83d937... 2025-04-01T18:35:04.053862 2 2024-12-02 05:19:03 c1690c3d Merge pull request #1016 from multics69/vmlinux 6.14.0-63.fc42.x86_64 mini AMD Ryzen 9 7950X3D 16-Core Processor 28.97 GB ... 2.389201e+10 2.81 1.562287e+11 8.026542e+08 0.51 5.983385 115.59 0.52 2839.73 2828.00
197 26c7470da7577f631246b744732bd1a3845b75793329a0... 2025-04-01T02:43:59.228631 1 2024-12-02 15:28:30 c6486d18 Merge pull request #1021 from etsal/etsal/igno... 6.14.0-63.fc42.x86_64 mini AMD Ryzen 9 7950X3D 16-Core Processor 28.97 GB ... 3.410113e+10 3.23 1.921651e+11 1.139160e+09 0.59 4.605355 116.73 0.65 2794.10 2782.30

5 rows × 54 columns

In [10]:
fig = px.line(df, x='git.commit_time', y='results.metrics.system_ctx_data.cswch/s', title='Value Over Time')
fig.show()
In [ ]:
 
In [11]:
fig = px.line(df, x='git.commit_time', y='results.average_rps', color='system.cpu_temp', title='Value Over Time')
fig.show()
In [ ]:
 
In [12]:
import plotly.graph_objects as go

fig = go.Figure()

fig.add_trace(go.Scatter(
    x=df['git.commit_time'], 
    y=df['results.average_rps'], 
    hovertext=df['git.commit_hash'],
    # mode='markers',
    # hoverinfo="text", 
    showlegend=True
))

fig.show()
done_pct=int(len(df)/(580*2)*100)
html_name = f"layered_walk_{done_pct}_pct_done.html"
fig.write_html(html_name)
In [15]:
 
In [ ]:
 
In [ ]:

In [ ]:
 
In [ ]:
 
In [ ]:
 
In [ ]: