-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
M9: Build performance test report view #9
Changes from 2 commits
a2b791e
09bc073
69b1752
8926e0a
4491f4f
a82e1f7
4c43a7c
7ec0ff0
4991d3e
60e80a9
55e04bd
c2958c8
2e679db
c273434
29ad556
bc7f419
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happened here? same commit twice? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm must have happened when I rebased it.. will clean up ☝️ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<script type="module"> | ||
// Get data | ||
const rawData = [ | ||
{% for sample in measurement.samples %} | ||
[{{ sample.commit_num }}, {{ sample.mean.gv_value() }}, {{ sample.start_time }}], | ||
{% endfor %} | ||
]; | ||
|
||
const convertToMinute = (time) => { | ||
return time[0]*60 + time[1] + time[2]/60 + time[3]/3600; | ||
} | ||
|
||
const dataX = rawData.map(([commit, value, time]) => { | ||
// Time 0 means no date information is available and commit number is used instead | ||
if (time > 0) { | ||
// The Date object takes value in milliseconds rather than seconds. So to use a Unix timestamp we multiply it by 1000. | ||
const date = new Date(time * 1000) | ||
return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() // Adding an extra 1 for month as January starts from 0 | ||
} | ||
return commit | ||
}); | ||
dataX.unshift('dateOrCommit'); | ||
|
||
// Assuming the array values are durations in the format [hours, minutes, seconds, milliseconds] | ||
const dataY = rawData.map(([commit, value]) => { | ||
return Array.isArray(value) ? convertToMinute(value) : value | ||
}); | ||
dataY.unshift('value'); | ||
|
||
let axisFormat | ||
// Date is saved as string in the data | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comments are important, but I think some of them can be removed. :) |
||
if (typeof dataX[1] === 'string') { | ||
axisFormat = { | ||
x: { | ||
label: { | ||
text: "Date", | ||
position: "outer-center" | ||
}, | ||
type: "timeseries", | ||
tick: { | ||
format: "%Y-%m-%d" | ||
} | ||
}, | ||
y: { | ||
label: { | ||
text: "Duration (minutes)", | ||
position: "outer-middle" | ||
} | ||
} | ||
} | ||
} else { | ||
axisFormat = { | ||
x: { | ||
label: { | ||
text: "Commit number", | ||
position: "outer-center" | ||
} | ||
}, | ||
y: { | ||
label: { | ||
text: "Disk size (MB)", | ||
position: "outer-middle" | ||
} | ||
} | ||
} | ||
} | ||
|
||
// Example: https://naver.github.io/billboard.js/demo/#Chart.SimpleXYLineChart | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. mhh There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed as I added apache echarts |
||
const chart = bb.generate({ | ||
data: { | ||
x: "dateOrCommit", | ||
columns: [dataX, dataY], | ||
type: "line", | ||
}, | ||
axis: axisFormat, | ||
zoom: { | ||
enabled: true, | ||
}, | ||
bindto: {{chart_elem_id}} | ||
}); | ||
</script> |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also not a fix 🐫 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,18 +3,16 @@ | |
<head> | ||
{# Scripts, for visualization#} | ||
<!--START-OF-SCRIPTS--> | ||
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> | ||
<script type="text/javascript"> | ||
google.charts.load('current', {'packages':['corechart']}); | ||
var chartsDrawing = 0; | ||
</script> | ||
<script src="https://cdn.jsdelivr.net/npm/d3@^6.1"></script> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/billboard.css"> | ||
<script src="https://cdn.jsdelivr.net/npm/billboard.js"></script> | ||
|
||
{# Render measurement result charts #} | ||
{% for test in test_data %} | ||
{% if test.status == 'SUCCESS' %} | ||
{% for measurement in test.measurements %} | ||
{% set chart_elem_id = test.name + '_' + measurement.name + '_chart' %} | ||
{% include 'measurement_chart.html' %} | ||
{% include 'measurement_chart_d3billboard.html' %} | ||
{% endfor %} | ||
{% endif %} | ||
{% endfor %} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a fix :) And can be part of the first commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea sorry about this 🙈 I need to update all the commit messages to remove 'fix' and combine some of them