Conversation
0b63d52 to
955549a
Compare
| $('#id_before').on('dp.change', reloadCharts) | ||
| document.getElementById('id_test_plan').onchange = reloadCharts | ||
| document.getElementById('id_product').onchange = () => { | ||
| updateTestPlanSelectFromProduct(reloadCharts) |
There was a problem hiding this comment.
When changing the product I get error
Internal error: Cannot resolve keyword 'category' into field. Choices are: assignee, assignee_id, bugs, build, build_id, case, case_id, case_text_version, id, linkreference, run, run_id, sortkey, start_date, status, status_id, stop_date, tested_by, tested_by_id
| 'black', | ||
| 'lightBlue', | ||
| 'lightGreen' | ||
| ] |
There was a problem hiding this comment.
This should be managed automatically by the charting library (d3 IIRC), no ?
| const groupedCategories = [] | ||
| // map of user ID -> table column. we use map here for faster lookup by user ID. | ||
| const groupedColumnsDataMap = {} | ||
| const userIds = new Set() |
There was a problem hiding this comment.
You need user names. "User 5" doesn't mean anything.
| assignee_count[assignee] = 1 | ||
|
|
||
| if execution["run_id"] != run_id: | ||
| result[run_id] = assignee_count |
There was a problem hiding this comment.
This can either be "TR-123" directly here or adjust the JS code to render the coordinates on the X axis as TR-123.
There was a problem hiding this comment.
done. I changed it on the UI level.
| console.log(result) | ||
|
|
||
| // the actual result is in the same format, only it can be much bigger | ||
| // and the chart may break |
There was a problem hiding this comment.
We need to have an understanding of why & how this chart breaks. If you are seeing breakage locally in devel, that's not a terribly large dataset.
Both Status matrix & Execution trends pages seem to have a larger dataset, at least in production and they seem to load just fine. On tcms.kiwitcms.org Execution trends takes a few seconds but it contains info from 5564 executions across around 1000 test runs grouped by statuses.
There was a problem hiding this comment.
I meant this comment for here - #2490 (comment)
tcms/telemetry/api.py
Outdated
| # count only execution which are finished | ||
| .exclude(status__weight=0) | ||
| .order_by("run_id") | ||
| .values("assignee_id", "run_id") |
There was a problem hiding this comment.
Wouldn't an aggregate query with Count and group by be a better choice here?
And if there isn't a big difference you can also add assignee__username into the mix.
There was a problem hiding this comment.
the charts looks like this in my setup

this is for 349 executions. I am not able to find how to tell C3 to render some small part of the chart normally and add a horizontal scroll that leads to the other part. moreover, I found this issue that asks for something similar, which is still open - c3js/c3#1702 there is a workaround in the issue, I will try to do something will that
There was a problem hiding this comment.
Wouldn't an aggregate query with Count and group by be a better choice here?
can you clarify more? what should we count by?
still WIP, because the page breaks when given too much data. the algorithm for the data looks OK, because it works with the small data-set I left in the code. however, given dataset with more than 500 runs it fails to display the chart miserably.
- API error, because of wrong key - remove colors, because that is handled by C3 - add usernames, not user IDs - add 'TR-' notation
955549a to
88d212f
Compare
This API will going to be used for the Performance telemetry page.
It outputs result with format:
{ "1": { "1": 1 }, "2": { "1": 1 }, "3": { "1": 1 }, "4": { "3": 1 }, "5": { "null": 1 } }the top-level keys are run IDs. each run ID has associated map of assignee ID - count.
this result means that for run with ID
2there is 1 test execution, assigned to use with ID1.nullfor assignee ID means that no one is assigned for this run. we may or may not want to filter out this data.