You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by GitBox <gi...@apache.org> on 2021/12/11 06:09:49 UTC

[GitHub] [incubator-kyuubi] zhenjiaguo opened a new pull request #1545: KYUUBI #1393][TASK-1] Add avg rpc time for each operation

zhenjiaguo opened a new pull request #1545:
URL: https://github.com/apache/incubator-kyuubi/pull/1545


   <!--
   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/contributions.html
     2. If the PR is related to an issue in https://github.com/apache/incubator-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.
   -->
   Subtask of #1393. Add avg rpc time for each operation on Kyuubi server.
   
   Use MetricRegistry default histogram to record.
   
   Screenshot of the json file generated by the json reporter:
   
   ![Screenshot from 2021-12-11 09-20-35](https://user-images.githubusercontent.com/29809822/145666232-1beebb64-43aa-4016-8740-eaa3722549fb.png)
   
   
   ### _How was this patch tested?_
   - [x] Add some test cases that check the changes thoroughly including negative and positive cases if possible
   
   - [x] Add screenshots for manual tests if appropriate
   
   - [x] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] codecov-commenter commented on pull request #1545: [KYUUBI #1393][TASK-1] Add avg rpc time for each operation

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #1545:
URL: https://github.com/apache/incubator-kyuubi/pull/1545#issuecomment-991497539


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?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 [#1545](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c4fc14b) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/81b14eadc837b76ffc453cb8ce9e86363a2d27b3?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (81b14ea) will **increase** coverage by `0.04%`.
   > The diff coverage is `74.28%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1545      +/-   ##
   ============================================
   + Coverage     59.27%   59.32%   +0.04%     
     Complexity      172      172              
   ============================================
     Files           241      242       +1     
     Lines         12215    12255      +40     
     Branches       1500     1501       +1     
   ============================================
   + Hits           7241     7270      +29     
   - Misses         4363     4372       +9     
   - Partials        611      613       +2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...cala/org/apache/kyuubi/metrics/MetricsSystem.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLW1ldHJpY3Mvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvbWV0cmljcy9NZXRyaWNzU3lzdGVtLnNjYWxh) | `75.00% <0.00%> (-5.00%)` | :arrow_down: |
   | [...ubi/client/KyuubiThriftClientCallTimeStatics.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9jbGllbnQvS3l1dWJpVGhyaWZ0Q2xpZW50Q2FsbFRpbWVTdGF0aWNzLnNjYWxh) | `77.27% <77.27%> (ø)` | |
   | [.../org/apache/kyuubi/operation/KyuubiOperation.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9vcGVyYXRpb24vS3l1dWJpT3BlcmF0aW9uLnNjYWxh) | `57.14% <77.77%> (+3.62%)` | :arrow_up: |
   | [...a/org/apache/kyuubi/metrics/MetricsConstants.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLW1ldHJpY3Mvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvbWV0cmljcy9NZXRyaWNzQ29uc3RhbnRzLnNjYWxh) | `100.00% <100.00%> (ø)` | |
   | [.../apache/kyuubi/client/KyuubiSyncThriftClient.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9jbGllbnQvS3l1dWJpU3luY1RocmlmdENsaWVudC5zY2FsYQ==) | `82.45% <100.00%> (ø)` | |
   | [...he/kyuubi/engine/spark/repl/KyuubiSparkILoop.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9yZXBsL0t5dXViaVNwYXJrSUxvb3Auc2NhbGE=) | `89.47% <0.00%> (-3.51%)` | :arrow_down: |
   | [...rc/main/scala/org/apache/spark/ui/EnginePage.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvc3BhcmsvdWkvRW5naW5lUGFnZS5zY2FsYQ==) | `80.06% <0.00%> (-0.13%)` | :arrow_down: |
   | [.../scala/org/apache/spark/ui/EngineSessionPage.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvc3BhcmsvdWkvRW5naW5lU2Vzc2lvblBhZ2Uuc2NhbGE=) | `3.07% <0.00%> (-0.05%)` | :arrow_down: |
   | [...la/org/apache/kyuubi/ha/HighAvailabilityConf.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWhhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2hhL0hpZ2hBdmFpbGFiaWxpdHlDb25mLnNjYWxh) | `98.85% <0.00%> (ø)` | |
   | ... and [15 more](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [81b14ea...c4fc14b](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] zhenjiaguo commented on a change in pull request #1545: [TASK-1] Add avg rpc time for each operation

Posted by GitBox <gi...@apache.org>.
zhenjiaguo commented on a change in pull request #1545:
URL: https://github.com/apache/incubator-kyuubi/pull/1545#discussion_r771024119



##########
File path: kyuubi-server/src/main/scala/org/apache/kyuubi/client/KyuubiThriftClientCallTimeStatics.scala
##########
@@ -0,0 +1,133 @@
+/*
+ * 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.
+ */
+
+package org.apache.kyuubi.client
+
+import java.util
+
+import org.apache.hive.service.rpc.thrift.{TGetOperationStatusResp, TOperationHandle, TProtocolVersion, TRowSet, TTableSchema}
+
+import org.apache.kyuubi.operation.FetchOrientation.FetchOrientation
+import org.apache.kyuubi.session.SessionHandle
+
+class KyuubiThriftClientCallTimeStatics(client: KyuubiThriftClient) extends KyuubiThriftClient {
+
+  private var timeCost: Long = 0L
+
+  /**
+   * Get the time cost millis on each call of the function in the [[KyuubiThriftClient]]
+   */
+  def getTimeCostMillis: Long = {
+    timeCost
+  }
+
+  @throws[Exception]
+  private def time[T](f: => T): T = {
+    val startTime = System.currentTimeMillis()

Review comment:
       I think it is no need to use such precision.




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #1545: [TASK-1] Add avg rpc time for each operation

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1545:
URL: https://github.com/apache/incubator-kyuubi/pull/1545#issuecomment-991497539


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?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 [#1545](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c4fc14b) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/81b14eadc837b76ffc453cb8ce9e86363a2d27b3?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (81b14ea) will **increase** coverage by `0.04%`.
   > The diff coverage is `74.28%`.
   
   > :exclamation: Current head c4fc14b differs from pull request most recent head 9e1de67. Consider uploading reports for the commit 9e1de67 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1545      +/-   ##
   ============================================
   + Coverage     59.27%   59.32%   +0.04%     
     Complexity      172      172              
   ============================================
     Files           241      242       +1     
     Lines         12215    12255      +40     
     Branches       1500     1501       +1     
   ============================================
   + Hits           7241     7270      +29     
   - Misses         4363     4372       +9     
   - Partials        611      613       +2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...cala/org/apache/kyuubi/metrics/MetricsSystem.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLW1ldHJpY3Mvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvbWV0cmljcy9NZXRyaWNzU3lzdGVtLnNjYWxh) | `75.00% <0.00%> (-5.00%)` | :arrow_down: |
   | [...ubi/client/KyuubiThriftClientCallTimeStatics.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9jbGllbnQvS3l1dWJpVGhyaWZ0Q2xpZW50Q2FsbFRpbWVTdGF0aWNzLnNjYWxh) | `77.27% <77.27%> (ø)` | |
   | [.../org/apache/kyuubi/operation/KyuubiOperation.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9vcGVyYXRpb24vS3l1dWJpT3BlcmF0aW9uLnNjYWxh) | `57.14% <77.77%> (+3.62%)` | :arrow_up: |
   | [...a/org/apache/kyuubi/metrics/MetricsConstants.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLW1ldHJpY3Mvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvbWV0cmljcy9NZXRyaWNzQ29uc3RhbnRzLnNjYWxh) | `100.00% <100.00%> (ø)` | |
   | [.../apache/kyuubi/client/KyuubiSyncThriftClient.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9jbGllbnQvS3l1dWJpU3luY1RocmlmdENsaWVudC5zY2FsYQ==) | `82.45% <100.00%> (ø)` | |
   | [...he/kyuubi/engine/spark/repl/KyuubiSparkILoop.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9yZXBsL0t5dXViaVNwYXJrSUxvb3Auc2NhbGE=) | `89.47% <0.00%> (-3.51%)` | :arrow_down: |
   | [...rc/main/scala/org/apache/spark/ui/EnginePage.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvc3BhcmsvdWkvRW5naW5lUGFnZS5zY2FsYQ==) | `80.06% <0.00%> (-0.13%)` | :arrow_down: |
   | [.../scala/org/apache/spark/ui/EngineSessionPage.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvc3BhcmsvdWkvRW5naW5lU2Vzc2lvblBhZ2Uuc2NhbGE=) | `3.07% <0.00%> (-0.05%)` | :arrow_down: |
   | [...la/org/apache/kyuubi/ha/HighAvailabilityConf.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWhhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2hhL0hpZ2hBdmFpbGFiaWxpdHlDb25mLnNjYWxh) | `98.85% <0.00%> (ø)` | |
   | ... and [15 more](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [81b14ea...9e1de67](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] ulysses-you commented on a change in pull request #1545: [TASK-1] Add avg rpc time for each operation

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #1545:
URL: https://github.com/apache/incubator-kyuubi/pull/1545#discussion_r770487658



##########
File path: kyuubi-server/src/main/scala/org/apache/kyuubi/client/KyuubiThriftClientCallTimeStatics.scala
##########
@@ -0,0 +1,133 @@
+/*
+ * 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.
+ */
+
+package org.apache.kyuubi.client
+
+import java.util
+
+import org.apache.hive.service.rpc.thrift.{TGetOperationStatusResp, TOperationHandle, TProtocolVersion, TRowSet, TTableSchema}
+
+import org.apache.kyuubi.operation.FetchOrientation.FetchOrientation
+import org.apache.kyuubi.session.SessionHandle
+
+class KyuubiThriftClientCallTimeStatics(client: KyuubiThriftClient) extends KyuubiThriftClient {
+
+  private var timeCost: Long = 0L
+
+  /**
+   * Get the time cost millis on each call of the function in the [[KyuubiThriftClient]]
+   */
+  def getTimeCostMillis: Long = {
+    timeCost
+  }
+
+  @throws[Exception]
+  private def time[T](f: => T): T = {
+    val startTime = System.currentTimeMillis()
+    try {
+      f
+    } finally {
+      timeCost += System.currentTimeMillis() - startTime
+    }
+  }
+
+  override def openSession(
+      protocol: TProtocolVersion,
+      user: String,
+      password: String,
+      configs: Map[String, String]): SessionHandle = {
+    client.openSession(protocol, user, password, configs)
+  }
+
+  override def closeSession(): Unit = {
+    client.closeSession()
+  }
+
+  override def executeStatement(
+      statement: String,
+      shouldRunAsync: Boolean,
+      queryTimeout: Long): TOperationHandle = {

Review comment:
       time {
     xxx
   }




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #1545: [TASK-1] Add avg rpc time for each operation

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #1545:
URL: https://github.com/apache/incubator-kyuubi/pull/1545#discussion_r767396559



##########
File path: kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/MetricsConstants.scala
##########
@@ -40,4 +40,5 @@ object MetricsConstants {
   final val OPERATION_FAIL: String = OPERATION + "failed"
   final val OPERATION_TOTAL: String = OPERATION + "total"
 
+  final val OPERATION_RPC_TIME: String = OPERATION + "rpc_time"

Review comment:
       how about rpc_ms or rpc_millis?




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] zhenjiaguo closed pull request #1545: [TASK-1] Add avg rpc time for each operation

Posted by GitBox <gi...@apache.org>.
zhenjiaguo closed pull request #1545:
URL: https://github.com/apache/incubator-kyuubi/pull/1545


   


-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] zhenjiaguo commented on a change in pull request #1545: [KYUUBI #1393][TASK-1] Add avg rpc time for each operation

Posted by GitBox <gi...@apache.org>.
zhenjiaguo commented on a change in pull request #1545:
URL: https://github.com/apache/incubator-kyuubi/pull/1545#discussion_r767096943



##########
File path: dev/kyuubi-tpcds/src/main/scala/org/apache/kyuubi/tpcds/DataGenerator.scala
##########
@@ -570,31 +570,31 @@ object DataGenerator {
       $"web_tax_percentage"       .decimal(5, 2))
     // format: on
 
-   Seq(
-     store_sales,
-     store_returns,
-     catalog_sales,
-     catalog_returns,
-     web_sales,
-     web_returns,
-     inventory,
-     catalog_page,
-     call_center,
-     customer,
-     customer_address,
-     customer_demographics,
-     household_demographics,
-     store,
-     warehouse,
-     item,
-     income_band,
-     web_site,
-     web_page,
-     date_dim,
-     time_dim,
-     ship_mode,
-     reason,
-     promotion)
+    Seq(

Review comment:
       I use `dev/reformat` to reformat the code. This file format is no correct. Ignore this file when review.




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] zhenjiaguo commented on a change in pull request #1545: [KYUUBI #1393][TASK-1] Add avg rpc time for each operation

Posted by GitBox <gi...@apache.org>.
zhenjiaguo commented on a change in pull request #1545:
URL: https://github.com/apache/incubator-kyuubi/pull/1545#discussion_r767096943



##########
File path: dev/kyuubi-tpcds/src/main/scala/org/apache/kyuubi/tpcds/DataGenerator.scala
##########
@@ -570,31 +570,31 @@ object DataGenerator {
       $"web_tax_percentage"       .decimal(5, 2))
     // format: on
 
-   Seq(
-     store_sales,
-     store_returns,
-     catalog_sales,
-     catalog_returns,
-     web_sales,
-     web_returns,
-     inventory,
-     catalog_page,
-     call_center,
-     customer,
-     customer_address,
-     customer_demographics,
-     household_demographics,
-     store,
-     warehouse,
-     item,
-     income_band,
-     web_site,
-     web_page,
-     date_dim,
-     time_dim,
-     ship_mode,
-     reason,
-     promotion)
+    Seq(

Review comment:
       I use `dev/reformat` to reformat the code. This file format is no correct. Ignore this file when review.




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] codecov-commenter commented on pull request #1545: [KYUUBI #1393][TASK-1] Add avg rpc time for each operation

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #1545:
URL: https://github.com/apache/incubator-kyuubi/pull/1545#issuecomment-991497539


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?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 [#1545](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c4fc14b) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/81b14eadc837b76ffc453cb8ce9e86363a2d27b3?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (81b14ea) will **increase** coverage by `0.04%`.
   > The diff coverage is `74.28%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1545      +/-   ##
   ============================================
   + Coverage     59.27%   59.32%   +0.04%     
     Complexity      172      172              
   ============================================
     Files           241      242       +1     
     Lines         12215    12255      +40     
     Branches       1500     1501       +1     
   ============================================
   + Hits           7241     7270      +29     
   - Misses         4363     4372       +9     
   - Partials        611      613       +2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...cala/org/apache/kyuubi/metrics/MetricsSystem.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLW1ldHJpY3Mvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvbWV0cmljcy9NZXRyaWNzU3lzdGVtLnNjYWxh) | `75.00% <0.00%> (-5.00%)` | :arrow_down: |
   | [...ubi/client/KyuubiThriftClientCallTimeStatics.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9jbGllbnQvS3l1dWJpVGhyaWZ0Q2xpZW50Q2FsbFRpbWVTdGF0aWNzLnNjYWxh) | `77.27% <77.27%> (ø)` | |
   | [.../org/apache/kyuubi/operation/KyuubiOperation.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9vcGVyYXRpb24vS3l1dWJpT3BlcmF0aW9uLnNjYWxh) | `57.14% <77.77%> (+3.62%)` | :arrow_up: |
   | [...a/org/apache/kyuubi/metrics/MetricsConstants.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLW1ldHJpY3Mvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvbWV0cmljcy9NZXRyaWNzQ29uc3RhbnRzLnNjYWxh) | `100.00% <100.00%> (ø)` | |
   | [.../apache/kyuubi/client/KyuubiSyncThriftClient.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9jbGllbnQvS3l1dWJpU3luY1RocmlmdENsaWVudC5zY2FsYQ==) | `82.45% <100.00%> (ø)` | |
   | [...he/kyuubi/engine/spark/repl/KyuubiSparkILoop.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9yZXBsL0t5dXViaVNwYXJrSUxvb3Auc2NhbGE=) | `89.47% <0.00%> (-3.51%)` | :arrow_down: |
   | [...rc/main/scala/org/apache/spark/ui/EnginePage.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvc3BhcmsvdWkvRW5naW5lUGFnZS5zY2FsYQ==) | `80.06% <0.00%> (-0.13%)` | :arrow_down: |
   | [.../scala/org/apache/spark/ui/EngineSessionPage.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvc3BhcmsvdWkvRW5naW5lU2Vzc2lvblBhZ2Uuc2NhbGE=) | `3.07% <0.00%> (-0.05%)` | :arrow_down: |
   | [...la/org/apache/kyuubi/ha/HighAvailabilityConf.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWhhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2hhL0hpZ2hBdmFpbGFiaWxpdHlDb25mLnNjYWxh) | `98.85% <0.00%> (ø)` | |
   | ... and [15 more](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [81b14ea...c4fc14b](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] ulysses-you commented on a change in pull request #1545: [TASK-1] Add avg rpc time for each operation

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #1545:
URL: https://github.com/apache/incubator-kyuubi/pull/1545#discussion_r770487890



##########
File path: kyuubi-server/src/main/scala/org/apache/kyuubi/client/KyuubiThriftClientCallTimeStatics.scala
##########
@@ -0,0 +1,133 @@
+/*
+ * 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.
+ */
+
+package org.apache.kyuubi.client
+
+import java.util
+
+import org.apache.hive.service.rpc.thrift.{TGetOperationStatusResp, TOperationHandle, TProtocolVersion, TRowSet, TTableSchema}
+
+import org.apache.kyuubi.operation.FetchOrientation.FetchOrientation
+import org.apache.kyuubi.session.SessionHandle
+
+class KyuubiThriftClientCallTimeStatics(client: KyuubiThriftClient) extends KyuubiThriftClient {
+
+  private var timeCost: Long = 0L
+
+  /**
+   * Get the time cost millis on each call of the function in the [[KyuubiThriftClient]]
+   */
+  def getTimeCostMillis: Long = {
+    timeCost
+  }
+
+  @throws[Exception]
+  private def time[T](f: => T): T = {
+    val startTime = System.currentTimeMillis()
+    try {
+      f
+    } finally {
+      timeCost += System.currentTimeMillis() - startTime
+    }
+  }
+
+  override def openSession(
+      protocol: TProtocolVersion,
+      user: String,
+      password: String,
+      configs: Map[String, String]): SessionHandle = {
+    client.openSession(protocol, user, password, configs)
+  }
+
+  override def closeSession(): Unit = {
+    client.closeSession()
+  }
+
+  override def executeStatement(
+      statement: String,
+      shouldRunAsync: Boolean,
+      queryTimeout: Long): TOperationHandle = {
+    time(client.executeStatement(statement, shouldRunAsync, queryTimeout))

Review comment:
       ```scala
   time {
     xxx
   }
   ```




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] ulysses-you commented on a change in pull request #1545: [TASK-1] Add avg rpc time for each operation

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #1545:
URL: https://github.com/apache/incubator-kyuubi/pull/1545#discussion_r770488084



##########
File path: kyuubi-server/src/main/scala/org/apache/kyuubi/client/KyuubiThriftClientCallTimeStatics.scala
##########
@@ -0,0 +1,133 @@
+/*
+ * 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.
+ */
+
+package org.apache.kyuubi.client
+
+import java.util
+
+import org.apache.hive.service.rpc.thrift.{TGetOperationStatusResp, TOperationHandle, TProtocolVersion, TRowSet, TTableSchema}
+
+import org.apache.kyuubi.operation.FetchOrientation.FetchOrientation
+import org.apache.kyuubi.session.SessionHandle
+
+class KyuubiThriftClientCallTimeStatics(client: KyuubiThriftClient) extends KyuubiThriftClient {
+
+  private var timeCost: Long = 0L
+
+  /**
+   * Get the time cost millis on each call of the function in the [[KyuubiThriftClient]]
+   */
+  def getTimeCostMillis: Long = {
+    timeCost
+  }
+
+  @throws[Exception]
+  private def time[T](f: => T): T = {
+    val startTime = System.currentTimeMillis()
+    try {
+      f
+    } finally {
+      timeCost += System.currentTimeMillis() - startTime
+    }
+  }
+
+  override def openSession(
+      protocol: TProtocolVersion,
+      user: String,
+      password: String,
+      configs: Map[String, String]): SessionHandle = {
+    client.openSession(protocol, user, password, configs)
+  }
+
+  override def closeSession(): Unit = {
+    client.closeSession()
+  }
+
+  override def executeStatement(
+      statement: String,
+      shouldRunAsync: Boolean,
+      queryTimeout: Long): TOperationHandle = {
+    time(client.executeStatement(statement, shouldRunAsync, queryTimeout))

Review comment:
       all methods should use this style




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #1545: [TASK-1] Add avg rpc time for each operation

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #1545:
URL: https://github.com/apache/incubator-kyuubi/pull/1545#discussion_r767398183



##########
File path: kyuubi-server/src/main/scala/org/apache/kyuubi/client/KyuubiThriftClientCallTimeStatics.scala
##########
@@ -0,0 +1,133 @@
+/*
+ * 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.
+ */
+
+package org.apache.kyuubi.client
+
+import java.util
+
+import org.apache.hive.service.rpc.thrift.{TGetOperationStatusResp, TOperationHandle, TProtocolVersion, TRowSet, TTableSchema}
+
+import org.apache.kyuubi.operation.FetchOrientation.FetchOrientation
+import org.apache.kyuubi.session.SessionHandle
+
+class KyuubiThriftClientCallTimeStatics(client: KyuubiThriftClient) extends KyuubiThriftClient {
+
+  private var timeCost: Long = 0L
+
+  /**
+   * Get the time cost millis on each call of the function in the [[KyuubiThriftClient]]
+   */
+  def getTimeCostMillis: Long = {
+    timeCost
+  }
+
+  @throws[Exception]
+  private def time[T](f: => T): T = {
+    val startTime = System.currentTimeMillis()
+    try {
+      f
+    } finally {
+      timeCost += System.currentTimeMillis() - startTime
+    }
+  }
+
+  override def openSession(
+      protocol: TProtocolVersion,
+      user: String,
+      password: String,
+      configs: Map[String, String]): SessionHandle = {
+    time(client.openSession(protocol, user, password, configs))

Review comment:
       this is for session RPC, why do we wrap them to track as operation metrics. IIUC, they are not used acturally.




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #1545: [TASK-1] Add avg rpc time for each operation

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #1545:
URL: https://github.com/apache/incubator-kyuubi/pull/1545#discussion_r767398220



##########
File path: kyuubi-server/src/main/scala/org/apache/kyuubi/client/KyuubiThriftClientCallTimeStatics.scala
##########
@@ -0,0 +1,133 @@
+/*
+ * 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.
+ */
+
+package org.apache.kyuubi.client
+
+import java.util
+
+import org.apache.hive.service.rpc.thrift.{TGetOperationStatusResp, TOperationHandle, TProtocolVersion, TRowSet, TTableSchema}
+
+import org.apache.kyuubi.operation.FetchOrientation.FetchOrientation
+import org.apache.kyuubi.session.SessionHandle
+
+class KyuubiThriftClientCallTimeStatics(client: KyuubiThriftClient) extends KyuubiThriftClient {
+
+  private var timeCost: Long = 0L
+
+  /**
+   * Get the time cost millis on each call of the function in the [[KyuubiThriftClient]]
+   */
+  def getTimeCostMillis: Long = {
+    timeCost
+  }
+
+  @throws[Exception]
+  private def time[T](f: => T): T = {
+    val startTime = System.currentTimeMillis()
+    try {
+      f
+    } finally {
+      timeCost += System.currentTimeMillis() - startTime
+    }
+  }
+
+  override def openSession(
+      protocol: TProtocolVersion,
+      user: String,
+      password: String,
+      configs: Map[String, String]): SessionHandle = {
+    time(client.openSession(protocol, user, password, configs))
+  }
+
+  override def closeSession(): Unit = {

Review comment:
       ditto




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #1545: [TASK-1] Add avg rpc time for each operation

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1545:
URL: https://github.com/apache/incubator-kyuubi/pull/1545#issuecomment-991497539


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?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 [#1545](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9e1de67) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/81b14eadc837b76ffc453cb8ce9e86363a2d27b3?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (81b14ea) will **increase** coverage by `0.05%`.
   > The diff coverage is `74.28%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1545      +/-   ##
   ============================================
   + Coverage     59.27%   59.33%   +0.05%     
     Complexity      172      172              
   ============================================
     Files           241      242       +1     
     Lines         12215    12255      +40     
     Branches       1500     1501       +1     
   ============================================
   + Hits           7241     7271      +30     
   - Misses         4363     4371       +8     
   - Partials        611      613       +2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...cala/org/apache/kyuubi/metrics/MetricsSystem.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLW1ldHJpY3Mvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvbWV0cmljcy9NZXRyaWNzU3lzdGVtLnNjYWxh) | `75.00% <0.00%> (-5.00%)` | :arrow_down: |
   | [...ubi/client/KyuubiThriftClientCallTimeStatics.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9jbGllbnQvS3l1dWJpVGhyaWZ0Q2xpZW50Q2FsbFRpbWVTdGF0aWNzLnNjYWxh) | `77.27% <77.27%> (ø)` | |
   | [.../org/apache/kyuubi/operation/KyuubiOperation.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9vcGVyYXRpb24vS3l1dWJpT3BlcmF0aW9uLnNjYWxh) | `57.14% <77.77%> (+3.62%)` | :arrow_up: |
   | [...a/org/apache/kyuubi/metrics/MetricsConstants.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLW1ldHJpY3Mvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvbWV0cmljcy9NZXRyaWNzQ29uc3RhbnRzLnNjYWxh) | `100.00% <100.00%> (ø)` | |
   | [.../apache/kyuubi/client/KyuubiSyncThriftClient.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9jbGllbnQvS3l1dWJpU3luY1RocmlmdENsaWVudC5zY2FsYQ==) | `82.45% <100.00%> (ø)` | |
   | [...ache/kyuubi/operation/KyuubiOperationManager.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9vcGVyYXRpb24vS3l1dWJpT3BlcmF0aW9uTWFuYWdlci5zY2FsYQ==) | `82.50% <0.00%> (-2.50%)` | :arrow_down: |
   | [...rc/main/scala/org/apache/spark/ui/EnginePage.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvc3BhcmsvdWkvRW5naW5lUGFnZS5zY2FsYQ==) | `80.06% <0.00%> (-0.13%)` | :arrow_down: |
   | [.../scala/org/apache/spark/ui/EngineSessionPage.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvc3BhcmsvdWkvRW5naW5lU2Vzc2lvblBhZ2Uuc2NhbGE=) | `3.07% <0.00%> (-0.05%)` | :arrow_down: |
   | [...la/org/apache/kyuubi/ha/HighAvailabilityConf.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWhhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2hhL0hpZ2hBdmFpbGFiaWxpdHlDb25mLnNjYWxh) | `98.85% <0.00%> (ø)` | |
   | ... and [15 more](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [81b14ea...9e1de67](https://codecov.io/gh/apache/incubator-kyuubi/pull/1545?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] ulysses-you commented on a change in pull request #1545: [TASK-1] Add avg rpc time for each operation

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #1545:
URL: https://github.com/apache/incubator-kyuubi/pull/1545#discussion_r770484320



##########
File path: kyuubi-server/src/main/scala/org/apache/kyuubi/client/KyuubiThriftClientCallTimeStatics.scala
##########
@@ -0,0 +1,133 @@
+/*
+ * 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.
+ */
+
+package org.apache.kyuubi.client
+
+import java.util
+
+import org.apache.hive.service.rpc.thrift.{TGetOperationStatusResp, TOperationHandle, TProtocolVersion, TRowSet, TTableSchema}
+
+import org.apache.kyuubi.operation.FetchOrientation.FetchOrientation
+import org.apache.kyuubi.session.SessionHandle
+
+class KyuubiThriftClientCallTimeStatics(client: KyuubiThriftClient) extends KyuubiThriftClient {
+
+  private var timeCost: Long = 0L
+
+  /**
+   * Get the time cost millis on each call of the function in the [[KyuubiThriftClient]]
+   */
+  def getTimeCostMillis: Long = {
+    timeCost
+  }
+
+  @throws[Exception]
+  private def time[T](f: => T): T = {
+    val startTime = System.currentTimeMillis()

Review comment:
       shall we use `System.nanoTime` ?




-- 
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: commits-unsubscribe@kyuubi.apache.org

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