public static void decrementMetric(String name, long count) { Metrics metrics = MetricsFactory.getInstance(); if (metrics != null) { metrics.decrementCounter(name, count); } }
public static void incrementMetric(String name, long count) { Metrics metrics = MetricsFactory.getInstance(); if (metrics != null) { metrics.incrementCounter(name, count); } }
@Override public void afterCompile(QueryLifeTimeHookContext ctx, boolean hasError) { if (metrics != null && compilingQryScp != null) { metrics.endScope(compilingQryScp); } }
private void endMetrics(String method) { Metrics metrics = MetricsFactory.getInstance(); if (metrics != null) { MetricsScope scope = openScopes.remove(method); if (scope != null) { metrics.endScope(scope); } } }
private void beginMetrics(String method) { Metrics metrics = MetricsFactory.getInstance(); if (metrics != null) { MetricsScope scope = metrics.createScope(MetricsConstant.API_PREFIX + method); openScopes.put(method, scope); } }
@Override public Void call() throws Exception { MetricsFactory.getInstance().startStoredScope("method2"); MetricsFactory.getInstance().endStoredScope("method2"); return null; } });
@Override public void updateTaskMetrics(Metrics metrics) { metrics.incrementCounter(MetricsConstant.HIVE_MR_TASKS); }
public void destroy() { ms.unregisterSource(sourceName); ms = null; if (codahaleGaugeNames != null) { Metrics metrics = MetricsFactory.getInstance(); for (String chgName : codahaleGaugeNames) { metrics.removeGauge(chgName); } codahaleGaugeNames = null; } }
@Override public void beforeCompile(QueryLifeTimeHookContext ctx) { if (metrics != null) { compilingQryScp = metrics.createScope(MetricsConstant.HS2_COMPILING_QUERIES); } }
private void markQueryMetric(Metrics metric, String name) { if(metric != null) { metric.markMeter(name); } }
/** * Closes and removes static Metrics instance. */ public synchronized static void close() throws Exception { if (metrics != null) { metrics.close(); metrics = null; } } }
@Override public Object getValue() { return variable.getValue(); } };
private void openConnection() { Metrics metrics = MetricsFactory.getInstance(); if (metrics != null) { try { metrics.incrementCounter(MetricsConstant.OPEN_CONNECTIONS); metrics.incrementCounter(MetricsConstant.CUMULATIVE_CONNECTION_COUNT); } catch (Exception e) { LOG.warn("Error reporting HS2 open connection operation to Metrics system", e); } } }
private void closeConnection() { Metrics metrics = MetricsFactory.getInstance(); if (metrics != null) { try { metrics.decrementCounter(MetricsConstant.OPEN_CONNECTIONS); } catch (Exception e) { LOG.warn("Error reporting HS2 close connection operation to Metrics system", e); } } }
@Override public void updateTaskMetrics(Metrics metrics) { metrics.incrementCounter(MetricsConstant.HIVE_TEZ_TASKS); }
@Override public void afterExecution(QueryLifeTimeHookContext ctx, boolean hasError) { if (metrics != null && executingQryScp != null) { metrics.endScope(executingQryScp); } } }
@Override public void beforeExecution(QueryLifeTimeHookContext ctx) { if (metrics != null) { executingQryScp = metrics.createScope(MetricsConstant.HS2_EXECUTING_QUERIES); } }
private void incrementMetricsCounter(String name, long count) { Metrics metrics = MetricsFactory.getInstance(); if (metrics != null) { try { metrics.incrementCounter(name, count); } catch (Exception e) { LOG.warn("Error Reporting JvmPauseMonitor to Metrics system", e); } } } }
@Override public void updateTaskMetrics(Metrics metrics) { metrics.incrementCounter(MetricsConstant.HIVE_SPARK_TASKS); }
public void run() throws HiveSQLException { beforeRun(); try { Metrics metrics = MetricsFactory.getInstance(); if (metrics != null) { metrics.incrementCounter(MetricsConstant.OPEN_OPERATIONS); } runInternal(); } finally { afterRun(); } }