Search in sources :

Example 1 with TableMetricsUtil

use of org.apache.samza.table.utils.TableMetricsUtil in project samza by apache.

the class AsyncRateLimitedTable method init.

@Override
public void init(Context context) {
    table.init(context);
    MetricsConfig metricsConfig = new MetricsConfig(context.getJobContext().getConfig());
    if (metricsConfig.getMetricsTimerEnabled()) {
        TableMetricsUtil tableMetricsUtil = new TableMetricsUtil(context, this, tableId);
        if (isReadRateLimited()) {
            readRateLimiter.setTimerMetric(tableMetricsUtil.newTimer("get-throttle-ns"));
        }
        if (isWriteRateLimited()) {
            writeRateLimiter.setTimerMetric(tableMetricsUtil.newTimer("put-throttle-ns"));
        }
        if (isUpdateRateLimited()) {
            updateRateLimiter.setTimerMetric(tableMetricsUtil.newTimer("update-throttle-ns"));
        }
    }
}
Also used : TableMetricsUtil(org.apache.samza.table.utils.TableMetricsUtil) MetricsConfig(org.apache.samza.config.MetricsConfig)

Example 2 with TableMetricsUtil

use of org.apache.samza.table.utils.TableMetricsUtil in project samza by apache.

the class CachingTable method init.

@Override
public void init(Context context) {
    super.init(context);
    TableMetricsUtil tableMetricsUtil = new TableMetricsUtil(context, this, tableId);
    tableMetricsUtil.newGauge("hit-rate", () -> hitRate());
    tableMetricsUtil.newGauge("miss-rate", () -> missRate());
    tableMetricsUtil.newGauge("req-count", () -> requestCount());
}
Also used : TableMetricsUtil(org.apache.samza.table.utils.TableMetricsUtil)

Example 3 with TableMetricsUtil

use of org.apache.samza.table.utils.TableMetricsUtil in project samza by apache.

the class AsyncBatchingTable method init.

@Override
public void init(Context context) {
    table.init(context);
    final TableMetricsUtil metricsUtil = new TableMetricsUtil(context, this, tableId);
    createBatchProcessor(TableMetricsUtil.mayCreateHighResolutionClock(context.getJobContext().getConfig()), new BatchMetrics(metricsUtil));
}
Also used : TableMetricsUtil(org.apache.samza.table.utils.TableMetricsUtil)

Example 4 with TableMetricsUtil

use of org.apache.samza.table.utils.TableMetricsUtil in project samza by apache.

the class AsyncRetriableTable method init.

@Override
public void init(Context context) {
    table.init(context);
    TableMetricsUtil metricsUtil = new TableMetricsUtil(context, this, tableId);
    if (readRetryPolicy != null) {
        readRetryMetrics = new RetryMetrics("reader", metricsUtil);
    }
    if (writeRetryPolicy != null) {
        writeRetryMetrics = new RetryMetrics("writer", metricsUtil);
    }
}
Also used : TableMetricsUtil(org.apache.samza.table.utils.TableMetricsUtil)

Example 5 with TableMetricsUtil

use of org.apache.samza.table.utils.TableMetricsUtil in project samza by apache.

the class GuavaCacheTable method init.

@Override
public void init(Context context) {
    super.init(context);
    TableMetricsUtil tableMetricsUtil = new TableMetricsUtil(context, this, tableId);
    // hit- and miss-rate are provided by CachingTable.
    tableMetricsUtil.newGauge("evict-count", () -> cache.stats().evictionCount());
}
Also used : TableMetricsUtil(org.apache.samza.table.utils.TableMetricsUtil)

Aggregations

TableMetricsUtil (org.apache.samza.table.utils.TableMetricsUtil)5 MetricsConfig (org.apache.samza.config.MetricsConfig)1