org.apache.hadoop.hive.ql.log
Class PerfLogger

java.lang.Object
  extended by org.apache.hadoop.hive.ql.log.PerfLogger

public class PerfLogger
extends Object

PerfLogger. Can be used to measure and log the time spent by a piece of code.


Field Summary
static String ACQUIRE_READ_WRITE_LOCKS
           
static String ANALYZE
           
static String CLONE_PLAN
           
static String COMPILE
           
static String DESERIALIZE_PLAN
           
static String DO_AUTHORIZATION
           
static String DRIVER_EXECUTE
           
static String DRIVER_RUN
           
static String FAILURE_HOOK
           
static String GET_SPLITS
           
static String INPUT_SUMMARY
           
static String LOAD_HASHTABLE
           
static String ORC_GET_SPLITS
           
static String PARSE
           
static String PARTITION_RETRIEVING
           
static String POST_HOOK
           
static String PRE_HOOK
           
static String PRUNE_LISTING
           
static String RELEASE_LOCKS
           
static String RUN_TASKS
           
static String SERIALIZE_PLAN
           
static String TASK
           
static String TEZ_BUILD_DAG
           
static String TEZ_CREATE_VERTEX
           
static String TEZ_INIT_OPERATORS
           
static String TEZ_INITIALIZE_PROCESSOR
           
static String TEZ_RUN_DAG
           
static String TEZ_RUN_PROCESSOR
           
static String TEZ_RUN_VERTEX
           
static String TEZ_SUBMIT_DAG
           
static String TEZ_SUBMIT_TO_RUNNING
           
static String TIME_TO_SUBMIT
           
 
Constructor Summary
PerfLogger()
           
 
Method Summary
 void close(org.apache.commons.logging.Log _log, QueryPlan queryPlan)
          Call this function at the end of processing a query (any time after the last call to PerfLogEnd for a given query) to run any cleanup/final steps that need to be run
 Long getEndTime(String method)
           
static PerfLogger getPerfLogger()
           
static PerfLogger getPerfLogger(boolean resetPerfLogger)
          Call this function to get an instance of PerfLogger.
 Long getStartTime(String method)
           
 void PerfLogBegin(String callerName, String method)
          Call this function when you start to measure time spent by a piece of code.
 long PerfLogEnd(String callerName, String method)
          Call this function in correspondence of PerfLogBegin to mark the end of the measurement.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACQUIRE_READ_WRITE_LOCKS

public static final String ACQUIRE_READ_WRITE_LOCKS
See Also:
Constant Field Values

COMPILE

public static final String COMPILE
See Also:
Constant Field Values

PARSE

public static final String PARSE
See Also:
Constant Field Values

ANALYZE

public static final String ANALYZE
See Also:
Constant Field Values

DO_AUTHORIZATION

public static final String DO_AUTHORIZATION
See Also:
Constant Field Values

DRIVER_EXECUTE

public static final String DRIVER_EXECUTE
See Also:
Constant Field Values

INPUT_SUMMARY

public static final String INPUT_SUMMARY
See Also:
Constant Field Values

GET_SPLITS

public static final String GET_SPLITS
See Also:
Constant Field Values

RUN_TASKS

public static final String RUN_TASKS
See Also:
Constant Field Values

SERIALIZE_PLAN

public static final String SERIALIZE_PLAN
See Also:
Constant Field Values

DESERIALIZE_PLAN

public static final String DESERIALIZE_PLAN
See Also:
Constant Field Values

CLONE_PLAN

public static final String CLONE_PLAN
See Also:
Constant Field Values

TASK

public static final String TASK
See Also:
Constant Field Values

RELEASE_LOCKS

public static final String RELEASE_LOCKS
See Also:
Constant Field Values

PRUNE_LISTING

public static final String PRUNE_LISTING
See Also:
Constant Field Values

PARTITION_RETRIEVING

public static final String PARTITION_RETRIEVING
See Also:
Constant Field Values

PRE_HOOK

public static final String PRE_HOOK
See Also:
Constant Field Values

POST_HOOK

public static final String POST_HOOK
See Also:
Constant Field Values

FAILURE_HOOK

public static final String FAILURE_HOOK
See Also:
Constant Field Values

DRIVER_RUN

public static final String DRIVER_RUN
See Also:
Constant Field Values

TIME_TO_SUBMIT

public static final String TIME_TO_SUBMIT
See Also:
Constant Field Values

TEZ_SUBMIT_TO_RUNNING

public static final String TEZ_SUBMIT_TO_RUNNING
See Also:
Constant Field Values

TEZ_BUILD_DAG

public static final String TEZ_BUILD_DAG
See Also:
Constant Field Values

TEZ_SUBMIT_DAG

public static final String TEZ_SUBMIT_DAG
See Also:
Constant Field Values

TEZ_RUN_DAG

public static final String TEZ_RUN_DAG
See Also:
Constant Field Values

TEZ_CREATE_VERTEX

public static final String TEZ_CREATE_VERTEX
See Also:
Constant Field Values

TEZ_RUN_VERTEX

public static final String TEZ_RUN_VERTEX
See Also:
Constant Field Values

TEZ_INITIALIZE_PROCESSOR

public static final String TEZ_INITIALIZE_PROCESSOR
See Also:
Constant Field Values

TEZ_RUN_PROCESSOR

public static final String TEZ_RUN_PROCESSOR
See Also:
Constant Field Values

TEZ_INIT_OPERATORS

public static final String TEZ_INIT_OPERATORS
See Also:
Constant Field Values

LOAD_HASHTABLE

public static final String LOAD_HASHTABLE
See Also:
Constant Field Values

ORC_GET_SPLITS

public static final String ORC_GET_SPLITS
See Also:
Constant Field Values
Constructor Detail

PerfLogger

public PerfLogger()
Method Detail

getPerfLogger

public static PerfLogger getPerfLogger()

getPerfLogger

public static PerfLogger getPerfLogger(boolean resetPerfLogger)
Call this function to get an instance of PerfLogger. Use resetPerfLogger to require a new instance. Useful at the beginning of execution.

Returns:
Session perflogger if there's a sessionstate, otherwise return the thread local instance

PerfLogBegin

public void PerfLogBegin(String callerName,
                         String method)
Call this function when you start to measure time spent by a piece of code.

Parameters:
_log - the logging object to be used.
method - method or ID that identifies this perf log element.

PerfLogEnd

public long PerfLogEnd(String callerName,
                       String method)
Call this function in correspondence of PerfLogBegin to mark the end of the measurement.

Parameters:
_log -
method -
Returns:
long duration the difference between now and startTime, or -1 if startTime is null

close

public void close(org.apache.commons.logging.Log _log,
                  QueryPlan queryPlan)
Call this function at the end of processing a query (any time after the last call to PerfLogEnd for a given query) to run any cleanup/final steps that need to be run

Parameters:
_log -

getStartTime

public Long getStartTime(String method)

getEndTime

public Long getEndTime(String method)


Copyright © 2014 The Apache Software Foundation. All rights reserved.