Github user liancheng commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5730#discussion_r29211143
  
    --- Diff: 
sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2.scala
 ---
    @@ -73,15 +94,146 @@ object HiveThriftServer2 extends Logging {
         }
       }
     
    +  private[thriftserver] class SessionInfo(
    +      val sessionId: String,
    +      val startTimestamp: Long,
    +      val ip: String,
    +      val userName: String) {
    +    var finishTimestamp: Long = 0L
    +    var totalExecute: Int = 0
    +    def totalTime: Long = {
    +      if (finishTimestamp == 0L) {
    +        System.currentTimeMillis() - startTimestamp
    +      } else {
    +        finishTimestamp - startTimestamp
    +      }
    +    }
    --- End diff --
    
    According to [this section] [1] of Databricks Scala Guide, I think we 
prefer `System.nanoTime` to do timing.
    
    [1]: 
https://github.com/databricks/scala-style-guide#prefer-nanotime-over-currenttimemillis


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to