Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
final class RequestProcessorPool {
private static final Logger LOG = LoggerFactory.getLogger(RequestProcessorPool.class);

private static final String PROCESSOR_INDEX = "processor_index";

private final RequestChannel[] requestChannels;
private final RequestProcessor[] processors;

Expand All @@ -54,10 +56,16 @@ public RequestProcessorPool(

RequestHandler<?>[] requestHandlers = initializeRequestHandlers(protocols, service);
for (int i = 0; i < numProcessors; i++) {
requestChannels[i] = new RequestChannel(totalQueueCapacity / numProcessors);
RequestChannel requestChannel = new RequestChannel(totalQueueCapacity / numProcessors);
requestChannels[i] = requestChannel;
// bind processor to a single channel to make requests from the
// same channel processed serializable
processors[i] = new RequestProcessor(i, requestChannels[i], service, requestHandlers);
processors[i] = new RequestProcessor(i, requestChannel, service, requestHandlers);
requestsMetrics.gauge(
PROCESSOR_INDEX,
String.valueOf(i),
MetricNames.REQUEST_QUEUE_SIZE,
requestChannel::requestsCount);
}
// register requestQueueSize metrics
requestsMetrics.gauge(MetricNames.REQUEST_QUEUE_SIZE, this::getRequestQueueSize);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ <T, G extends Gauge<T>> void gauge(String name, G gauge) {
requestMetricGroup.gauge(name, gauge);
}

/** Create a gauge metric in a child group of the request metric group. */
<T, G extends Gauge<T>> void gauge(String groupKey, String groupValue, String name, G gauge) {
requestMetricGroup.addGroup(groupKey, groupValue).gauge(name, gauge);
}

/** Add a metric group for given request name. */
private void addMetrics(MetricGroup parentMetricGroup, String requestName) {
metricsByRequest.put(
Expand Down
18 changes: 15 additions & 3 deletions website/docs/maintenance/observability/monitor-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -639,19 +639,31 @@ Some metrics might not be exposed when using other JVM implementations (e.g. IBM
</thead>
<tbody>
<tr>
<th rowspan="1"><strong>coordinator</strong></th>
<th rowspan="2"><strong>coordinator</strong></th>
<td rowspan="1">request</td>
<td>requestQueueSize</td>
<td>The CoordinatorServer node network waiting queue size.</td>
<td>Gauge</td>
</tr>
<tr>
<th rowspan="8">tabletserver</th>
<td rowspan="1">request_processor_index</td>
<td>requestQueueSize</td>
<td>The CoordinatorServer node network waiting queue size labeled with <code>processor_index</code>.</td>
<td>Gauge</td>
</tr>
<tr>
<th rowspan="9">tabletserver</th>
<td rowspan="1">request</td>
<td>requestQueueSize</td>
<td>The TabletServer node network waiting queue size.</td>
<td>Gauge</td>
</tr>
<tr>
<td rowspan="1">request_processor_index</td>
<td>requestQueueSize</td>
<td>The TabletServer node network waiting queue size labeled with <code>processor_index</code>.</td>
<td>Gauge</td>
</tr>
<tr>
<td rowspan="7">
request_produceLog
Expand Down Expand Up @@ -1172,4 +1184,4 @@ All metrics are registered under the `fluss.tieringService` metric group, which
<td>Meter</td>
</tr>
</tbody>
</table>
</table>
Loading