You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by "zwangsheng (via GitHub)" <gi...@apache.org> on 2023/04/04 07:50:44 UTC

[GitHub] [kyuubi] zwangsheng opened a new pull request, #4663: [KYUUBI #3650][UI] Add Operation Statistics Page

zwangsheng opened a new pull request, #4663:
URL: https://github.com/apache/kyuubi/pull/4663

   <!--
   Thanks for sending a pull request!
   
   Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/CONTRIBUTING.html
     2. If the PR is related to an issue in https://github.com/apache/kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
   -->
   
   ### _Why are the changes needed?_
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you add a feature, you can talk about the use case of it.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   Close #3650
   
   ### _How was this patch tested?_
   - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
   
   - [ ] Add screenshots for manual tests if appropriate
   
   - [ ] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request
   
   ![popo_2023-04-04  15-50-15](https://user-images.githubusercontent.com/52876270/229724723-c6ddc892-0a1c-4d38-acf6-f2c6c8bf20b2.jpg)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] pan3793 closed pull request #4663: [KYUUBI #3650][UI] Add Operation Statistics Page

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 closed pull request #4663: [KYUUBI #3650][UI] Add Operation Statistics Page
URL: https://github.com/apache/kyuubi/pull/4663


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] pan3793 commented on a diff in pull request #4663: [KYUUBI #3650][UI] Add Operation Statistics Page

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #4663:
URL: https://github.com/apache/kyuubi/pull/4663#discussion_r1158266901


##########
kyuubi-server/web-ui/src/views/operation/operation-statistics/index.vue:
##########
@@ -0,0 +1,144 @@
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+<template>
+  <el-card class="table-container">
+    <el-table v-loading="loading" :data="tableData" style="width: 100%">
+      <el-table-column prop="sessionUser" :label="$t('user')" width="160" />
+      <el-table-column
+        prop="identifier"
+        :label="$t('operation_id')"
+        width="300" />
+      <el-table-column prop="statement" :label="$t('statement')" width="160" />
+      <el-table-column prop="state" :label="$t('state')" width="160" />
+      <el-table-column :label="$t('start_time')" width="160">
+        <template #default="scope">
+          {{
+            scope.row.startTime != null && scope.row.startTime > 0
+              ? format(scope.row.startTime, 'yyyy-MM-dd HH:mm:ss')
+              : '-'
+          }}
+        </template>
+      </el-table-column>
+      <el-table-column :label="$t('complete_time')" width="160">
+        <template #default="scope">
+          {{
+            scope.row.completeTime != null && scope.row.completeTime > 0
+              ? format(scope.row.completeTime, 'yyyy-MM-dd HH:mm:ss')
+              : '-'
+          }}
+        </template>
+      </el-table-column>
+      <el-table-column :label="$t('duration')" width="140">
+        <template #default="scope">{{
+          scope.row.startTime != null &&
+          scope.row.completeTime != null &&
+          scope.row.startTime > 0 &&
+          scope.row.completeTime > 0
+            ? millTransfer(scope.row.completeTime - scope.row.startTime)
+            : '-'
+        }}</template>
+      </el-table-column>
+      <el-table-column fixed="right" :label="$t('operation')" width="110">
+        <template #default="scope">
+          <el-space wrap>
+            <el-popconfirm
+              v-if="!isTerminalState(scope.row.state)"
+              :title="$t('cancel_confirm')"
+              @confirm="handleOperate(scope.row.identifier, 'CANCEL')">
+              <template #reference>
+                <span>
+                  <el-tooltip
+                    effect="dark"
+                    :content="$t('cancel')"
+                    placement="top">
+                    <template #default>
+                      <el-button type="danger" icon="Remove" circle />
+                    </template>
+                  </el-tooltip>
+                </span>
+              </template>
+            </el-popconfirm>
+            <el-popconfirm
+              :title="$t('close_confirm')"
+              @confirm="handleOperate(scope.row.identifier, 'CLOSE')">
+              <template #reference>
+                <span>
+                  <el-tooltip
+                    effect="dark"
+                    :content="$t('close')"
+                    placement="top">
+                    <template #default>
+                      <el-button type="danger" icon="CircleClose" circle />
+                    </template>
+                  </el-tooltip>
+                </span>
+              </template>
+            </el-popconfirm>
+          </el-space>
+        </template>
+      </el-table-column>
+    </el-table>
+  </el-card>
+</template>
+
+<script lang="ts" setup>
+  import { getAllOperations, actionOnOperation } from '@/api/operation'
+  import { millTransfer } from '@/utils/unit'
+  import { format } from 'date-fns'
+  import { useI18n } from 'vue-i18n'
+  import { ElMessage } from 'element-plus'
+  import { useTable } from '@/views/common/use-table'
+
+  const { t } = useI18n()
+  const { tableData, loading, getList: _getList } = useTable()
+  const handleOperate = (operationId: string, action: 'CANCEL' | 'CLOSE') => {
+    actionOnOperation(operationId, { action: action }).then(() => {
+      // need add delete success or failed logic after api support

Review Comment:
   ```suggestion
         // TODO add delete success or failed logic after api support
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] zwangsheng commented on pull request #4663: [KYUUBI #3650][UI] Add Operation Statistics Page

Posted by "zwangsheng (via GitHub)" <gi...@apache.org>.
zwangsheng commented on PR #4663:
URL: https://github.com/apache/kyuubi/pull/4663#issuecomment-1495522446

   CC @turboFei @pan3793,
   There is a question about how we should treat the interfaces that currently exist for some operations that are not under `AdminResource`, such like `cancleOperation`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] pan3793 commented on pull request #4663: [KYUUBI #3650][UI] Add Operation Statistics Page

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on PR #4663:
URL: https://github.com/apache/kyuubi/pull/4663#issuecomment-1497193127

   Thanks, merged to master


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] codecov-commenter commented on pull request #4663: [KYUUBI #3650][UI] Add Operation Statistics Page

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #4663:
URL: https://github.com/apache/kyuubi/pull/4663#issuecomment-1495678125

   ## [Codecov](https://codecov.io/gh/apache/kyuubi/pull/4663?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#4663](https://codecov.io/gh/apache/kyuubi/pull/4663?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (688cfb4) into [master](https://codecov.io/gh/apache/kyuubi/commit/3815bc4a71560606eff632887152d51272215f15?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3815bc4) will **increase** coverage by `4.02%`.
   > The diff coverage is `n/a`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #4663      +/-   ##
   ============================================
   + Coverage     53.56%   57.59%   +4.02%     
     Complexity       13       13              
   ============================================
     Files           579      579              
     Lines         31781    31964     +183     
     Branches       4253     4269      +16     
   ============================================
   + Hits          17025    18411    +1386     
   + Misses        13169    11788    -1381     
   - Partials       1587     1765     +178     
   ```
   
   
   [see 57 files with indirect coverage changes](https://codecov.io/gh/apache/kyuubi/pull/4663/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org