Skip to content

Commit 07b717c

Browse files
committed
Simplified scripts and switched to SVG graphs.
1 parent 6ae7011 commit 07b717c

File tree

5 files changed

+25
-45
lines changed

5 files changed

+25
-45
lines changed

.github/workflows/gnu-data.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ jobs:
132132
- name: Generate the graphs
133133
shell: bash
134134
run: |
135-
python graph.py gnu-result.json gnu
136-
python graph.py busybox-result.json busybox
137-
python graph.py toybox-result.json toybox
135+
python graph.py gnu-result.json GNU
136+
python graph.py busybox-result.json BusyBox
137+
python graph.py toybox-result.json Toybox
138138
python individual-size-graph.py individual-size-result.json
139139
python size-graph.py size-result.json
140140

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Below is the evolution of how many GNU tests uutils passes. A more detailed
88
breakdown of the GNU test results of the main branch can be found
99
[in the user manual](https://uutils.github.io/coreutils/docs/test_coverage.html).
1010

11-
![GNU testsuite evolution](https://github.com/uutils/coreutils-tracking/blob/main/gnu-results.png?raw=true)
11+
![GNU testsuite evolution](gnu-results.svg)
1212

13-
Refreshed twice a day by github actions. Changes are documented in the json file ([gnu-result.json](https://github.com/uutils/coreutils-tracking/blob/main/gnu-result.json)).
13+
Refreshed twice a day by github actions. Changes are documented in the json file ([gnu-result.json](gnu-result.json)).
1414

1515
Compares only the Linux execution.
1616

@@ -23,18 +23,18 @@ Based on:
2323
Similar results but using the busybox testsuite:
2424
https://github.com/mirror/busybox/tree/master/testsuite
2525

26-
![Busybox testsuite evolution](https://github.com/uutils/coreutils-tracking/blob/main/busybox-results.png?raw=true)
26+
![Busybox testsuite evolution](busybox-results.svg)
2727

2828
## Toybox testsuite comparison
2929

3030
Similar results but using the toybox testsuite:
3131
https://github.com/landley/toybox/tree/master/tests
3232

33-
![Toybox testsuite evolution](https://github.com/uutils/coreutils-tracking/blob/main/toybox-results.png?raw=true)
33+
![Toybox testsuite evolution](toybox-results.svg)
3434

3535
## Binary size evolution
3636

37-
![Size evolution](https://github.com/uutils/coreutils-tracking/blob/main/size-results.png?raw=true)
37+
![Size evolution](size-results.svg)
3838

3939
Refreshed once a day by github actions.
4040

graph.py

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,13 @@
33
# For the full copyright and license information, please view the LICENSE
44
# file that was distributed with this source code.
55

6-
from datetime import datetime
7-
from email.utils import parsedate
8-
96
import sys
10-
import time
117

128
import matplotlib.pyplot as plt
139
import pandas as pd
1410

1511
if len(sys.argv) <= 2:
16-
print('graph.py: <json file> <title>')
12+
print("graph.py: <json file> <title>")
1713
sys.exit()
1814

1915
d = pd.read_json(sys.argv[1], orient="index")
@@ -22,24 +18,19 @@
2218

2319
df.columns.names = ["date"]
2420

25-
as_list = df.index.tolist()
26-
for i in as_list:
27-
idx = as_list.index(i)
28-
t = parsedate(i)
29-
as_list[idx] = datetime.fromtimestamp(time.mktime(t))
30-
31-
df.index = as_list
21+
df.index = pd.to_datetime(df.index, utc=True)
3222

3323
print(df)
3424

35-
ax = plt.gca()
25+
fig, ax = plt.subplots(figsize=(9.6, 7.2))
3626
df.plot(y="total", color="blue", ax=ax)
3727
df.plot(y="fail", color="gray", ax=ax, dashes=(2, 1))
3828
df.plot(y="pass", color="green", ax=ax, dashes=(4, 1))
3929
if "error" in df:
4030
df.plot(y="error", color="orange", ax=ax, dashes=(6, 2))
4131
df.plot(y="skip", color="violet", ax=ax, dashes=(8, 3))
42-
plt.title("Rust/Coreutils running {}'s testsuite".format(title))
43-
plt.xticks(rotation=45)
32+
plt.title(f"Rust/Coreutils running {title}'s testsuite")
33+
fig.autofmt_xdate()
34+
plt.margins(0.01)
4435
plt.ylim(ymin=0)
45-
plt.savefig("{}-results.png".format(title), dpi=199)
36+
plt.savefig(f"{title.lower()}-results.svg", format="svg", dpi=199, bbox_inches="tight")

individual-size-graph.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@
1414
Path("individual-size-results").mkdir(exist_ok=True)
1515

1616

17-
df = pd.read_json(sys.argv[1], orient="index")
18-
19-
Path("individual-size-results").mkdir(exist_ok=True)
20-
21-
for name in df.sizes.values[0].keys():
17+
for name in df.sizes.values[0]:
2218
# Check if the name exists in each dictionary
2319
sizes = df.sizes.map(lambda v: v.get(name))
2420

@@ -28,10 +24,12 @@
2824
if not sizes.empty:
2925
print(name)
3026
print(sizes)
27+
fig, _ax = plt.subplots(figsize=(9.6, 7.2))
3128
sizes.plot(y="size", color="green")
3229
plt.title(f'Size evolution of "{name}" binary (kilobytes)')
33-
plt.xticks(rotation=45)
34-
plt.savefig(f"individual-size-results/{name}.png", dpi=199)
30+
fig.autofmt_xdate()
31+
plt.margins(0.01)
32+
plt.savefig(f"individual-size-results/{name}.svg", format="svg", dpi=199, bbox_inches="tight")
3533
plt.clf()
3634
else:
3735
print(f"Warning: No data found for '{name}'")

size-graph.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
# For the full copyright and license information, please view the LICENSE
44
# file that was distributed with this source code.
55

6-
from datetime import datetime
7-
from email.utils import parsedate
8-
96
import sys
10-
import time
117

128
import matplotlib.pyplot as plt
139
import pandas as pd
@@ -17,19 +13,14 @@
1713

1814
df.columns.names = ["date"]
1915

20-
as_list = df.index.tolist()
21-
for i in as_list:
22-
idx = as_list.index(i)
23-
t = parsedate(i)
24-
as_list[idx] = datetime.fromtimestamp(time.mktime(t))
25-
26-
df.index = as_list
16+
df.index = pd.to_datetime(df.index, utc=True, format="mixed")
2717

2818
print(df)
2919

30-
ax = plt.gca()
20+
fig, ax = plt.subplots(figsize=(9.6, 7.2))
3121
df.plot(y="size", color="gray", ax=ax, dashes=(2, 1), label="Size: multiple binaries (byte)")
3222
df.plot(y="multisize", color="green", ax=ax, dashes=(4, 1), label="Size: multicall binary (byte)")
3323
plt.title("Size evolution of Rust/Coreutils")
34-
plt.xticks(rotation=45)
35-
plt.savefig("size-results.png", dpi=199)
24+
fig.autofmt_xdate()
25+
plt.margins(0.01)
26+
plt.savefig("size-results.svg", format="svg", dpi=199, bbox_inches="tight")

0 commit comments

Comments
 (0)