use of org.apache.samza.metrics.SamzaHistogram in project samza by apache.
the class TranslatorOutputMetricsMapFunction method init.
/**
* initializes the TranslatorOutputMetricsMapFunction before any message is processed
* @param context the {@link Context} for this task
*/
@Override
public void init(Context context) {
ContainerContext containerContext = context.getContainerContext();
metricsRegistry = containerContext.getContainerMetricsRegistry();
processingTime = new SamzaHistogram(metricsRegistry, logicalOpId, TranslatorConstants.PROCESSING_TIME_NAME);
outputEvents = metricsRegistry.newCounter(logicalOpId, TranslatorConstants.OUTPUT_EVENTS_NAME);
outputEvents.clear();
}
use of org.apache.samza.metrics.SamzaHistogram in project samza by apache.
the class AsyncSystemProducer method start.
public void start() {
streamIds.forEach(streamId -> {
sendCallbackLatency.put(streamId, new SamzaHistogram(metricsRegistry, streamId, SEND_CALLBACK_LATENCY));
sendLatency.put(streamId, new SamzaHistogram(metricsRegistry, streamId, SEND_LATENCY));
sendErrors.put(streamId, metricsRegistry.newCounter(streamId, SEND_ERRORS));
});
if (aggSendLatency == null) {
aggSendLatency = new SamzaHistogram(metricsRegistry, AGGREGATE, SEND_LATENCY);
aggSendCallbackLatency = new SamzaHistogram(metricsRegistry, AGGREGATE, SEND_CALLBACK_LATENCY);
aggSendErrors = metricsRegistry.newCounter(AGGREGATE, SEND_ERRORS);
}
}
Aggregations