Skip to content
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

Implement task duration page in react. #35863

Merged
merged 2 commits into from Feb 20, 2024

Conversation

tirkarthi
Copy link
Contributor

@tirkarthi tirkarthi commented Nov 26, 2023

closes: #30328
related: #30328

task_duration_queued

@boring-cyborg boring-cyborg bot added area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues labels Nov 26, 2023
@tirkarthi tirkarthi marked this pull request as draft November 26, 2023 15:26
Copy link
Contributor

@bbovenzi bbovenzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

First off, I think we want to change how task/run selection works.
Right now there are 3 states:

  • nothing is selected: show general information about the DAG
  • a runId is selected: show information about the DAG run
  • a runId and a taskId are selected: show information about that task instance

This view really needs a fourth state, where a taskId is selected, but no runId and then we can show a task across runs.

Also, before this is fully ready. We should delete the old Task Duration page and redirect links over to this page.

airflow/www/static/js/dag/details/taskDuration/index.tsx Outdated Show resolved Hide resolved
airflow/www/static/js/dag/details/taskDuration/index.tsx Outdated Show resolved Hide resolved
airflow/www/static/js/dag/details/taskDuration/index.tsx Outdated Show resolved Hide resolved
airflow/www/static/js/dag/details/taskDuration/index.tsx Outdated Show resolved Hide resolved
airflow/www/static/js/dag/details/taskDuration/index.tsx Outdated Show resolved Hide resolved
@tirkarthi
Copy link
Contributor Author

This view really needs a fourth state, where a taskId is selected, but no runId and then we can show a task across runs.

Can you please add here pointers if any over where to look for selection related code? I see useSelection being used to update runId and taskId based on selection in the grid across the codebase.

I also had to rewrite most of the code that was simpler to satisfy typescript compiler and linter by using a class to model storing taskinstance, queued duration and run duration. Please let me know if there are better ways to write them as I have less experience in frontend. Thanks again for the review @bbovenzi .

@tirkarthi
Copy link
Contributor Author

@bbovenzi Task row selection is added as suggested. On selecting a task row only the task duration tab is displayed with duration for the task across runs. I still feel the graph can be present with 50% of the panel height and is better. Please let me know if this needs to be changed. Thanks

@tirkarthi tirkarthi marked this pull request as ready for review November 30, 2023 17:15
@tirkarthi
Copy link
Contributor Author

Updated screenshot after PR comments to show task duration when task row is clicked.

task_duration_after_pr

@bbovenzi
Copy link
Contributor

bbovenzi commented Dec 4, 2023

Updated screenshot after PR comments to show task duration when task row is clicked.

task_duration_after_pr

Nice! Some UI feedback:

  • Let's have x-axis labels still
  • We can make the queued gray color a little lighter. I believe I did this already in the gantt chart
  • Can we make sure the tooltip has an arrow so a user can be certain on which column they are looking at?
  • Let's include try number in the tooltip

@tirkarthi
Copy link
Contributor Author

tirkarthi commented Dec 4, 2023

Thanks @bbovenzi for the feedback. I will try to fix them in next commit. I had few questions :

  1. Would it be good for the user to click on one of the bars so that it takes them to the task instance since its useful in cases where user finds something odd like a task took more than usual time that they want to check logs or know more about it? I found that there is events for echarts but I am not sure how I can get the particular object to add the event handler. Ref : https://apache.github.io/echarts-handbook/en/concepts/event/#
  2. Sometimes but not always I find the task duration bars to be different in order than the rows in the grid though both use same data from the API. I couldn't find an exact scenario to reproduce it. Is there any sorting involved in grid that I should be doing in the task instance page too or something echarts is doing.

Let's have x-axis labels still

Does this mean just having x-axis to indicate that just says "run_id" like "duration(seconds)" or the actual value of run_id beneath each bar which might be make it little harder to read on large num_runs.

@bbovenzi
Copy link
Contributor

bbovenzi commented Dec 4, 2023

Thanks @bbovenzi for the feedback. I will try to fix them in next commit. I had few questions :

  1. Would it be good for the user to click on one of the bars so that it takes them to the task instance since its useful in cases where user finds something odd like a task took more than usual time that they want to check logs or know more about it? I found that there is events for echarts but I am not sure how I can get the particular object to add the event handler.
  2. Sometimes but not always I find the task duration bars to be different in order than the rows in the grid though both use same data from the API. I couldn't find an exact scenario to reproduce it. Is there any sorting involved in grid that I should be doing in the task instance page too or something echarts is doing.

Let's have x-axis labels still

Does this mean just having x-axis to indicate that just says "run_id" like "duration(seconds)" or the actual value of run_id beneath each bar which might be make it little harder to read on large num_runs.

  1. Yes
  2. In grid_data we have a ordering variable to tell the UI to sort it by dataIntervalStart/End or executionDate. You may need to check against it

X-Axis labels: No, just the formatted time of the datetime we are ordering the tasks by. RunId can stay in the tooltip

I also think we could bring in some Task details to this page. Basic stuff like the operator that comes from /dags/{dag_id}/tasks/{task_id} in the rest API

@tirkarthi
Copy link
Contributor Author

Let's have x-axis labels still

Done. I had instance as x-axis which leads to formatting as [object object] in the UI. I rely on execution date as using dataIntervalEnd leads to cases where there is a scheduled run and manual run with same dataIntervalEnd that causes them to form a single bar though they are two different task instances. I feel execution date which is mostly referred as logical date is unique enough. Please share your thoughts on this and the date format.

We can make the queued gray color a little lighter. I believe I did this already in the gantt chart

Done. Used opacity as 0.6 as done in gantt chart

Can we make sure the tooltip has an arrow so a user can be certain on which column they are looking at?

There is hand pointer on hovering over the bar in task instance. Do you want the task duration and grid view in sync? I had it in the previous version to show it on hover which needs setting task_id and run_id query params and accidental hover causes browser history to be filled with values that makes clicking on back little difficult. Since now task duration is a separate tab only with task_id in query param I have changed it to on click so that when user is interested in filtering by task instance they can click on it to move to task instance detail view. Reverting to older method means hover by itself moves to task instance detail and hides task duration.

Let's include try number in the tooltip

Done

Screenshot after addressing comments :

image

@tirkarthi
Copy link
Contributor Author

I also think we could bring in some Task details to this page. Basic stuff like the operator that comes from /dags/{dag_id}/tasks/{task_id} in the rest API

I can pick it up as a follow-up PR since this might involve more changes and iterations.

@eladkal eladkal added this to the Airflow 2.9.0 milestone Dec 14, 2023
@eladkal eladkal added the type:new-feature Changelog: New Features label Dec 14, 2023
@bbovenzi
Copy link
Contributor

I'm also happy to contribute to this branch if that would be helpful.

@tirkarthi
Copy link
Contributor Author

@bbovenzi Please feel free to push changes. I tried to fix conflicts since recent xcom details page also had changes to tab number and panels in same file so please verify if the merge is okay. I can cherry pick changes after merge to test this in our non production environment. My availability might be limited due to holiday season PTO and will try my best to address changes. Thanks for your review on this.

@bbovenzi
Copy link
Contributor

bbovenzi commented Jan 8, 2024

Just rebased and made some updates. Most notably, support for task groups and moving Task Duration into a general Task Details tab.

Screenshot 2024-01-08 at 2 13 57 PM

@tirkarthi
Copy link
Contributor Author

tirkarthi commented Jan 10, 2024

Thanks @bbovenzi . This looks good to have it under details tab instead of a separate tab. I noticed one discrepancy when there is a running task instance between the order of grid view and the task duration chart. In the grid view the task instance is the third one but in the chart the task instance is the last one. I guess there is some sorting logic. I noticed below comment in this PR maybe there is some logic that is missing. The order remains incorrect even after the task finishes.

In grid_data we have a ordering variable to tell the UI to sort it by dataIntervalStart/End or executionDate. You may need to check against it

image

@bbovenzi
Copy link
Contributor

Sorting will now match the ordering we receive from the grid_data endpoint.

Clicking on a task name will select the row. But I increased the click area to expand/collapse groups or you can double click a task name to expand/collapse.

Also, I just realized that it looks quite cool if you select a ton of dag runs at once (eg 365 below)

Screenshot 2024-01-16 at 3 47 31 PM

@tirkarthi
Copy link
Contributor Author

Thanks @bbovenzi . This looks great. As a tip echarts also provides dataZoom through which large graphs can be drilled down to plot values between two intervals.

https://echarts.apache.org/examples/en/editor.html?c=bar-large

While testing I am also seeing below error when num_runs count is greater than dag runs along with a new task added to the dag after few dag runs are created.

Initializing bitwardenContentMessageHandler bootstrap-content-message-handler.js:229:13
Attaching message event listener. bootstrap-content-message-handler.js:217:17
Uncaught TypeError: dataItem is null
    objectRows DataStore.js:1192
    _initDataFromProvider DataStore.js:347
    initData DataStore.js:164
    _innerGetDataStore sourceManager.js:402
    _innerGetDataStore sourceManager.js:398
    getSharedDataStore sourceManager.js:379
    createSeriesData createSeriesData.js:149
    getInitialData BarSeries.js:62
    init Series.js:100
    visitComponent Global.js:381
    each util.js:205
    visitComponent Global.js:308
    topologicalTravel component.js:122
    _mergeOption Global.js:287
    initBase Global.js:777
    _resetOption Global.js:199
    setOption Global.js:172
    setOption echarts.js:418
    ReactECharts ReactECharts.tsx:70
    React 13
    workLoop scheduler.development.js:266
    flushWork scheduler.development.js:239
    performWorkUntilDeadline scheduler.development.js:533
    EventHandlerNonNull* scheduler.development.js:571
    <anonymous> scheduler.development.js:633
    js grid.775ff095245d2eaa9cd5.js:10751
    __webpack_require__ grid.775ff095245d2eaa9cd5.js:18284
    <anonymous> index.js:6
    js grid.775ff095245d2eaa9cd5.js:10762
    __webpack_require__ grid.775ff095245d2eaa9cd5.js:18284
    React 2
    js grid.775ff095245d2eaa9cd5.js:9548
    __webpack_require__ grid.775ff095245d2eaa9cd5.js:18284
    <anonymous> React
    js grid.775ff095245d2eaa9cd5.js:9570
    __webpack_require__ grid.775ff095245d2eaa9cd5.js:18284
    <anonymous> React
    js grid.775ff095245d2eaa9cd5.js:9559
    __webpack_require__ grid.775ff095245d2eaa9cd5.js:18284
    <anonymous> index.tsx:4
    tsx grid.775ff095245d2eaa9cd5.js:3197
    __webpack_require__ grid.775ff095245d2eaa9cd5.js:18284
    <anonymous> grid.775ff095245d2eaa9cd5.js:18365
    <anonymous> grid.775ff095245d2eaa9cd5.js:18368
    webpackUniversalModuleDefinition grid.775ff095245d2eaa9cd5.js:17
    <anonymous> grid.775ff095245d2eaa9cd5.js:18
DataStore.js:1192
Uncaught TypeError: dataItem is null
    objectRows DataStore.js:1192
    _initDataFromProvider DataStore.js:347
    initData DataStore.js:164
    _innerGetDataStore sourceManager.js:402
    _innerGetDataStore sourceManager.js:398
    getSharedDataStore sourceManager.js:379
    createSeriesData createSeriesData.js:149
    getInitialData BarSeries.js:62
    init Series.js:100
    visitComponent Global.js:381
    each util.js:205
    visitComponent Global.js:308
    topologicalTravel component.js:122
    _mergeOption Global.js:287
    initBase Global.js:777
    _resetOption Global.js:199
    setOption Global.js:172
    setOption echarts.js:418
    ReactECharts ReactECharts.tsx:70
    React 12
    workLoop scheduler.development.js:266
    flushWork scheduler.development.js:239
    performWorkUntilDeadline scheduler.development.js:533
    EventHandlerNonNull* scheduler.development.js:571
    <anonymous> scheduler.development.js:633
    js grid.775ff095245d2eaa9cd5.js:10751
    __webpack_require__ grid.775ff095245d2eaa9cd5.js:18284
    <anonymous> index.js:6
    js grid.775ff095245d2eaa9cd5.js:10762
    __webpack_require__ grid.775ff095245d2eaa9cd5.js:18284
    React 2
    js grid.775ff095245d2eaa9cd5.js:9548
    __webpack_require__ grid.775ff095245d2eaa9cd5.js:18284
    <anonymous> React
    js grid.775ff095245d2eaa9cd5.js:9570
    __webpack_require__ grid.775ff095245d2eaa9cd5.js:18284
    <anonymous> React
    js grid.775ff095245d2eaa9cd5.js:9559
    __webpack_require__ grid.775ff095245d2eaa9cd5.js:18284
    <anonymous> index.tsx:4
    tsx grid.775ff095245d2eaa9cd5.js:3197
    __webpack_require__ grid.775ff095245d2eaa9cd5.js:18284
    <anonymous> grid.775ff095245d2eaa9cd5.js:18365
    <anonymous> grid.775ff095245d2eaa9cd5.js:18368
    webpackUniversalModuleDefinition grid.775ff095245d2eaa9cd5.js:17
    <anonymous> grid.775ff095245d2eaa9cd5.js:18
DataStore.js:1192
The above error occurred in the <ReactECharts> component:

ReactECharts@webpack-internal:///./static/js/components/ReactECharts.tsx:37:7
TaskDuration@webpack-internal:///./static/js/dag/details/task/TaskDuration.tsx:48:71
div
withEmotionCache/<@webpack-internal:///./node_modules/@emotion/react/dist/emotion-element-cbed451f.browser.esm.js:57:66
ChakraComponent@webpack-internal:///./node_modules/@chakra-ui/system/dist/index.esm.js:248:102
TaskDetails@webpack-internal:///./static/js/dag/details/task/index.tsx:43:71
div
withEmotionCache/<@webpack-internal:///./node_modules/@emotion/react/dist/emotion-element-cbed451f.browser.esm.js:57:66
ChakraComponent@webpack-internal:///./node_modules/@chakra-ui/system/dist/index.esm.js:248:102
TabPanel2@webpack-internal:///./node_modules/@chakra-ui/tabs/dist/index.esm.js:364:33
div
withEmotionCache/<@webpack-internal:///./node_modules/@emotion/react/dist/emotion-element-cbed451f.browser.esm.js:57:66
ChakraComponent@webpack-internal:///./node_modules/@chakra-ui/system/dist/index.esm.js:248:102
TabPanels2@webpack-internal:///./node_modules/@chakra-ui/tabs/dist/index.esm.js:378:35
div
withEmotionCache/<@webpack-internal:///./node_modules/@emotion/react/dist/emotion-element-cbed451f.browser.esm.js:57:66
ChakraComponent@webpack-internal:///./node_modules/@chakra-ui/system/dist/index.esm.js:248:102
Tabs2@webpack-internal:///./node_modules/@chakra-ui/tabs/dist/index.esm.js:306:88
div
withEmotionCache/<@webpack-internal:///./node_modules/@emotion/react/dist/emotion-element-cbed451f.browser.esm.js:57:66
ChakraComponent@webpack-internal:///./node_modules/@chakra-ui/system/dist/index.esm.js:248:102
Flex2@webpack-internal:///./node_modules/@chakra-ui/layout/dist/index.esm.js:274:77
Details@webpack-internal:///./static/js/dag/details/index.tsx:139:7
div
withEmotionCache/<@webpack-internal:///./node_modules/@emotion/react/dist/emotion-element-cbed451f.browser.esm.js:57:66
ChakraComponent@webpack-internal:///./node_modules/@chakra-ui/system/dist/index.esm.js:248:102
div
withEmotionCache/<@webpack-internal:///./node_modules/@emotion/react/dist/emotion-element-cbed451f.browser.esm.js:57:66
ChakraComponent@webpack-internal:///./node_modules/@chakra-ui/system/dist/index.esm.js:248:102
Flex2@webpack-internal:///./node_modules/@chakra-ui/layout/dist/index.esm.js:274:77
div
withEmotionCache/<@webpack-internal:///./node_modules/@emotion/react/dist/emotion-element-cbed451f.browser.esm.js:57:66
ChakraComponent@webpack-internal:///./node_modules/@chakra-ui/system/dist/index.esm.js:248:102
Main@webpack-internal:///./static/js/dag/Main.tsx:71:59
Router@webpack-internal:///./node_modules/react-router/index.js:860:7
BrowserRouter@webpack-internal:///./node_modules/react-router-dom/index.js:122:7
AutoRefreshProvider@webpack-internal:///./static/js/context/autorefresh.tsx:44:7
TimezoneProvider@webpack-internal:///./static/js/context/timezone.tsx:37:7
QueryClientProvider@webpack-internal:///./node_modules/react-query/es/react/QueryClientProvider.js:39:16
EnvironmentProvider@webpack-internal:///./node_modules/@chakra-ui/react-env/dist/index.esm.js:121:54
ColorModeProvider@webpack-internal:///./node_modules/@chakra-ui/color-mode/dist/index.esm.js:166:7
ThemeProvider@webpack-internal:///./node_modules/@emotion/react/dist/emotion-element-cbed451f.browser.esm.js:96:64
ThemeProvider@webpack-internal:///./node_modules/@chakra-ui/system/dist/index.esm.js:166:44
ChakraProvider@webpack-internal:///./node_modules/@chakra-ui/provider/dist/index.esm.js:29:7
ChakraProvider2@webpack-internal:///./node_modules/@chakra-ui/react/dist/index.esm.js:552:34
ChakraApp@webpack-internal:///./static/js/App.tsx:73:7
div
ContainerRefProvider@webpack-internal:///./static/js/context/containerRef.tsx:34:7
App@webpack-internal:///./static/js/App.tsx:91:7

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries. 2 react-dom.development.js:18572
Uncaught TypeError: dataItem is null
    objectRows DataStore.js:1192
    _initDataFromProvider DataStore.js:347
    initData DataStore.js:164
    _innerGetDataStore sourceManager.js:402
    _innerGetDataStore sourceManager.js:398
    getSharedDataStore sourceManager.js:379
    createSeriesData createSeriesData.js:149
    getInitialData BarSeries.js:62
    init Series.js:100
    visitComponent Global.js:381
    each util.js:205
    visitComponent Global.js:308
    topologicalTravel component.js:122
    _mergeOption Global.js:287
    initBase Global.js:777
    _resetOption Global.js:199
    setOption Global.js:172
    setOption echarts.js:418
    ReactECharts ReactECharts.tsx:70
    React 13
    workLoop scheduler.development.js:266
    flushWork scheduler.development.js:239
    performWorkUntilDeadline scheduler.development.js:533
    EventHandlerNonNull* scheduler.development.js:571
    <anonymous> scheduler.development.js:633
    js grid.775ff095245d2eaa9cd5.js:10751
    __webpack_require__ grid.775ff095245d2eaa9cd5.js:18284
    <anonymous> index.js:6
    js grid.775ff095245d2eaa9cd5.js:10762
    __webpack_require__ grid.775ff095245d2eaa9cd5.js:18284
    React 2
    js grid.775ff095245d2eaa9cd5.js:9548
    __webpack_require__ grid.775ff095245d2eaa9cd5.js:18284
    <anonymous> React
    js grid.775ff095245d2eaa9cd5.js:9570
    __webpack_require__ grid.775ff095245d2eaa9cd5.js:18284
    <anonymous> React
    js grid.775ff095245d2eaa9cd5.js:9559
    __webpack_require__ grid.775ff095245d2eaa9cd5.js:18284
    <anonymous> index.tsx:4
    tsx grid.775ff095245d2eaa9cd5.js:3197
    __webpack_require__ grid.775ff095245d2eaa9cd5.js:18284
    <anonymous> grid.775ff095245d2eaa9cd5.js:18365
    <anonymous> grid.775ff095245d2eaa9cd5.js:18368
    webpackUniversalModuleDefinition grid.775ff095245d2eaa9cd5.js:17
    <anonymous> grid.775ff095245d2eaa9cd5.js:18
DataStore.js:1192

@tirkarthi
Copy link
Contributor Author

echarts also provides a mechanism to mark a line with average value. Below is code and a sample with average run duration and average queued duration of the series marked.

image

diff --git a/airflow/www/static/js/dag/details/task/TaskDuration.tsx b/airflow/www/static/js/dag/details/task/TaskDuration.tsx
index 1f99f39e4d..7ce2e8aed9 100644
--- a/airflow/www/static/js/dag/details/task/TaskDuration.tsx
+++ b/airflow/www/static/js/dag/details/task/TaskDuration.tsx
@@ -155,6 +155,9 @@ const TaskDuration = () => {
           opacity: 0.6,
         },
         stack: "x",
+        markLine: {
+          data: [{ type: "average", name: "Avg" }],
+        },
       },
       {
         type: "bar",
@@ -164,6 +167,9 @@ const TaskDuration = () => {
           color: (params) => stateColors[params.data.state],
         },
         stack: "x",
+        markLine: {
+          data: [{ type: "average", name: "Avg" }],
+        },
       },
     ],
     // @ts-ignore

@bbovenzi
Copy link
Contributor

I fixed the issue if there are no TIs and some breadcrumb header navigation. We can leave the average values for a follow up PR

@tirkarthi
Copy link
Contributor Author

@bbovenzi Is there anything I can help here to have this reviewed and merged? There is one pending item left to redirect links from old task duration page but I would like your thoughts on having this page for a release just in case if there is something missing in the new implementation and to switch links in the next release.

Also, before this is fully ready. We should delete the old Task Duration page and redirect links over to this page.

Thanks

@bbovenzi
Copy link
Contributor

bbovenzi commented Feb 5, 2024

@bbovenzi Is there anything I can help here to have this reviewed and merged? There is one pending item left to redirect links from old task duration page but I would like your thoughts on having this page for a release just in case if there is something missing in the new implementation and to switch links in the next release.

Also, before this is fully ready. We should delete the old Task Duration page and redirect links over to this page.

Thanks

Yeah, I'd like to keep them as separate PRs. I think the most useful thing is for anyone to pull down this branch, try out the new page and give usability feedback.

@bbovenzi bbovenzi force-pushed the task-duration-react branch 2 times, most recently from 93a03d5 to 7752e9b Compare February 13, 2024 03:30
Copy link
Member

@jedcunningham jedcunningham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Played with this a bit. Looks great! #protm

Copy link
Contributor

@bbovenzi bbovenzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get this in now.

tirkarthi and others added 2 commits February 20, 2024 09:59
Update icon to match existing task duration page.

Update with queued duration.

PR comments about variables and using moment to convert duration.

Add task row selection support.

Implement task duration page in react.

Update icon to match existing task duration page.

Add task row selection support.

Sort as per DagRun order in grid and add logical date as x-axis label.

Rearrange task selection tabs

fix group/mapped details and select task node if no run

Fix tests and remove unneeded rebase changes

Fix TI ordering and add dbl click to expand/collapse groups

Fix header nav and no TIs

Refactor TaskName, hide null tooltips, and add fake tab link
@bbovenzi bbovenzi merged commit 440f1c8 into apache:main Feb 20, 2024
56 checks passed
@tirkarthi
Copy link
Contributor Author

Thanks @bbovenzi and @jedcunningham for the review and feedback 👍

@bbovenzi
Copy link
Contributor

Thanks @bbovenzi and @jedcunningham for the review and feedback 👍

Great job doing this PR. I'm glad we finally got it merged. Let me know if you want help removing the old task duration page.

sunank200 pushed a commit to astronomer/airflow that referenced this pull request Feb 21, 2024
* Implement task duration page in react.

Update icon to match existing task duration page.

Update with queued duration.

PR comments about variables and using moment to convert duration.

Add task row selection support.

Implement task duration page in react.

Update icon to match existing task duration page.

Add task row selection support.

Sort as per DagRun order in grid and add logical date as x-axis label.

Rearrange task selection tabs

fix group/mapped details and select task node if no run

Fix tests and remove unneeded rebase changes

Fix TI ordering and add dbl click to expand/collapse groups

Fix header nav and no TIs

Refactor TaskName, hide null tooltips, and add fake tab link

* Fix task name selection

---------

Co-authored-by: Brent Bovenzi <brent.bovenzi@gmail.com>
@vatsrahul1001
Copy link
Collaborator

Sorting will now match the ordering we receive from the grid_data endpoint.

Clicking on a task name will select the row. But I increased the click area to expand/collapse groups or you can double click a task name to expand/collapse.

Also, I just realized that it looks quite cool if you select a ton of dag runs at once (eg 365 below)

Screenshot 2024-01-16 at 3 47 31 PM

@bbovenzi I tried testing this with multiple DAG runs, however, in graph I do not see more than 26 runs. How you were able to generate this graph for 365 runs?

image

@vatsrahul1001
Copy link
Collaborator

@tirkarthi @bbovenzi I was testing this out and noticed task duration for manual runs were not showing
image

@tirkarthi
Copy link
Contributor Author

@vatsrahul1001 Please check value of ordering in object/grid_data response. It could be possible that orderingLabel is dataIntervalEnd and manual runs have same dataIntervalEnd have same value as scheduled runs. I am not sure we can have adjacent bars for same category value in echarts.

I tried testing this with multiple DAG runs, however, in graph I do not see more than 26 runs. How you were able to generate this graph for 365 runs?

I suspect manual runs which have same value as scheduled runs could be causing this issue like the case with your question about manual runs where 4 runs were shown in grid but only 2 are shown in the graph.

I would recommend new issues if any to track them since the thread is long. Thanks.

@vatsrahul1001
Copy link
Collaborator

@vatsrahul1001 Please check value of ordering in object/grid_data response. It could be possible that orderingLabel is dataIntervalEnd and manual runs have same dataIntervalEnd have same value as scheduled runs. I am not sure we can have adjacent bars for same category value in echarts.

I tried testing this with multiple DAG runs, however, in graph I do not see more than 26 runs. How you were able to generate this graph for 365 runs?

I suspect manual runs which have same value as scheduled runs could be causing this issue like the case with your question about manual runs where 4 runs were shown in grid but only 2 are shown in the graph.

I would recommend new issues if any to track them since the thread is long. Thanks.

yes @tirkarthi you are right manual runs having same dataIntervalEnd is causing this. I will create a new issue for this

@bbovenzi
Copy link
Contributor

bbovenzi commented Feb 26, 2024

@bbovenzi I tried testing this with multiple DAG runs, however, in graph I do not see more than 26 runs. How you were able to generate this graph for 365 runs?

Select more dag runs:
Screenshot 2024-02-26 at 12 10 15 PM

PR fix for manual dag runs: #37717

abhishekbhakat pushed a commit to abhishekbhakat/my_airflow that referenced this pull request Mar 5, 2024
* Implement task duration page in react.

Update icon to match existing task duration page.

Update with queued duration.

PR comments about variables and using moment to convert duration.

Add task row selection support.

Implement task duration page in react.

Update icon to match existing task duration page.

Add task row selection support.

Sort as per DagRun order in grid and add logical date as x-axis label.

Rearrange task selection tabs

fix group/mapped details and select task node if no run

Fix tests and remove unneeded rebase changes

Fix TI ordering and add dbl click to expand/collapse groups

Fix header nav and no TIs

Refactor TaskName, hide null tooltips, and add fake tab link

* Fix task name selection

---------

Co-authored-by: Brent Bovenzi <brent.bovenzi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues type:new-feature Changelog: New Features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build a new task duration view in react
5 participants