Search in sources :

Example 1 with MetricsScope

use of org.apache.hadoop.hive.common.metrics.common.MetricsScope in project hive by apache.

the class PerfLogger method cleanupPerfLogMetrics.

/**
 * Cleans up any dangling perfLog metric call scopes.
 */
public void cleanupPerfLogMetrics() {
    Metrics metrics = MetricsFactory.getInstance();
    if (metrics != null) {
        for (MetricsScope openScope : openScopes.values()) {
            metrics.endScope(openScope);
        }
    }
    openScopes.clear();
}
Also used : Metrics(org.apache.hadoop.hive.common.metrics.common.Metrics) MetricsScope(org.apache.hadoop.hive.common.metrics.common.MetricsScope)

Example 2 with MetricsScope

use of org.apache.hadoop.hive.common.metrics.common.MetricsScope in project hive by apache.

the class PerfLogger method beginMetrics.

private void beginMetrics(String method) {
    Metrics metrics = MetricsFactory.getInstance();
    if (metrics != null) {
        MetricsScope scope = metrics.createScope(MetricsConstant.API_PREFIX + method);
        openScopes.put(method, scope);
    }
}
Also used : Metrics(org.apache.hadoop.hive.common.metrics.common.Metrics) MetricsScope(org.apache.hadoop.hive.common.metrics.common.MetricsScope)

Aggregations

Metrics (org.apache.hadoop.hive.common.metrics.common.Metrics)2 MetricsScope (org.apache.hadoop.hive.common.metrics.common.MetricsScope)2