Exemple #1
0
 private void endMetrics(String method) {
   Metrics metrics = MetricsFactory.getInstance();
   try {
     if (metrics != null) {
       metrics.endStoredScope(method);
     }
   } catch (IOException e) {
     LOG.warn("Error recording metrics", e);
   }
 }
Exemple #2
0
 public void closeOperation(OperationHandle opHandle) throws HiveSQLException {
   Operation operation = removeOperation(opHandle);
   if (operation == null) {
     throw new HiveSQLException("Operation does not exist!");
   }
   Metrics metrics = MetricsFactory.getInstance();
   if (metrics != null) {
     try {
       metrics.decrementCounter(MetricsConstant.OPEN_OPERATIONS);
     } catch (Exception e) {
       LOG.warn("Error Reporting close operation to Metrics system", e);
     }
   }
   operation.close();
 }