@Override public void beforeCompile(QueryLifeTimeHookContext ctx) { if (metrics != null) { compilingQryScp = metrics.createScope(MetricsConstant.HS2_COMPILING_QUERIES); } }
@Override public void beforeExecution(QueryLifeTimeHookContext ctx) { if (metrics != null) { executingQryScp = metrics.createScope(MetricsConstant.HS2_EXECUTING_QUERIES); } }
@Override public void beforeCompile(QueryLifeTimeHookContext ctx) { if (metrics != null) { compilingQryScp = metrics.createScope(MetricsConstant.HS2_COMPILING_QUERIES); } }
@Override public void beforeExecution(QueryLifeTimeHookContext ctx) { if (metrics != null) { executingQryScp = metrics.createScope(MetricsConstant.HS2_EXECUTING_QUERIES); } }
private void beginMetrics(String method) { Metrics metrics = MetricsFactory.getInstance(); if (metrics != null) { MetricsScope scope = metrics.createScope(MetricsConstant.API_PREFIX + method); openScopes.put(method, scope); } }
protected final MetricsScope updateOperationStateMetrics(MetricsScope stateScope, String operationPrefix, String completedOperationPrefix, OperationState state) { Metrics metrics = MetricsFactory.getInstance(); if (metrics != null) { if (stateScope != null) { metrics.endScope(stateScope); stateScope = null; } if (scopeStates.contains(state)) { stateScope = metrics.createScope(MetricsConstant.API_PREFIX + operationPrefix + state); } if (terminalStates.contains(state)) { metrics.incrementCounter(completedOperationPrefix + state); } } return stateScope; }
public SQLOperation(HiveSession parentSession, String statement, Map<String, String> confOverlay, boolean runInBackground, long queryTimeout) { // TODO: call setRemoteUser in ExecuteStatementOperation or higher. super(parentSession, statement, confOverlay, runInBackground); this.runAsync = runInBackground; this.queryTimeout = queryTimeout; long timeout = HiveConf.getTimeVar(queryState.getConf(), HiveConf.ConfVars.HIVE_QUERY_TIMEOUT_SECONDS, TimeUnit.SECONDS); if (timeout > 0 && (queryTimeout <= 0 || timeout < queryTimeout)) { this.queryTimeout = timeout; } this.operationLogCleanupDelayMs = HiveConf.getTimeVar(queryState.getConf(), HiveConf.ConfVars.HIVE_SERVER2_OPERATION_LOG_CLEANUP_DELAY, TimeUnit.MILLISECONDS); setupSessionIO(parentSession.getSessionState()); queryInfo = new QueryInfo(getState().toString(), getParentSession().getUserName(), getExecutionEngine(), getHandle().getHandleIdentifier().toString()); Metrics metrics = MetricsFactory.getInstance(); if (metrics != null) { submittedQryScp = metrics.createScope(MetricsConstant.HS2_SUBMITTED_QURIES); } }
private void beginMetrics(String method) { Metrics metrics = MetricsFactory.getInstance(); if (metrics != null) { MetricsScope scope = metrics.createScope(MetricsConstant.API_PREFIX + method); openScopes.put(method, scope); } }
protected final MetricsScope updateOperationStateMetrics(MetricsScope stateScope, String operationPrefix, String completedOperationPrefix, OperationState state) { Metrics metrics = MetricsFactory.getInstance(); if (metrics != null) { if (stateScope != null) { metrics.endScope(stateScope); stateScope = null; } if (scopeStates.contains(state)) { stateScope = metrics.createScope(MetricsConstant.API_PREFIX + operationPrefix + state); } if (terminalStates.contains(state)) { metrics.incrementCounter(completedOperationPrefix + state); } } return stateScope; }
public SQLOperation(HiveSession parentSession, String statement, Map<String, String> confOverlay, boolean runInBackground, long queryTimeout) { // TODO: call setRemoteUser in ExecuteStatementOperation or higher. super(parentSession, statement, confOverlay, runInBackground); this.runAsync = runInBackground; this.queryTimeout = queryTimeout; long timeout = HiveConf.getTimeVar(queryState.getConf(), HiveConf.ConfVars.HIVE_QUERY_TIMEOUT_SECONDS, TimeUnit.SECONDS); if (timeout > 0 && (queryTimeout <= 0 || timeout < queryTimeout)) { this.queryTimeout = timeout; } this.operationLogCleanupDelayMs = HiveConf.getTimeVar(queryState.getConf(), HiveConf.ConfVars.HIVE_SERVER2_OPERATION_LOG_CLEANUP_DELAY, TimeUnit.MILLISECONDS); setupSessionIO(parentSession.getSessionState()); queryInfo = new QueryInfo(getState().toString(), getParentSession().getUserName(), getExecutionEngine(), getHandle().getHandleIdentifier().toString()); Metrics metrics = MetricsFactory.getInstance(); if (metrics != null) { submittedQryScp = metrics.createScope(MetricsConstant.HS2_SUBMITTED_QURIES); } }