Skip to content
Closed
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 @@ -69,10 +69,6 @@ public enum ControllerGauge implements AbstractMetrics.Gauge {
// Estimated size of offline table
OFFLINE_TABLE_ESTIMATED_SIZE("OfflineTableEstimatedSize", false),

// Size of the last uploaded offline segment
LAST_PUSHED_SEGMENT_SIZE("LastPushedSegmentSize", false),


// Table quota based on setting in table config
TABLE_QUOTA("TableQuotaBasedOnTableConfig", false),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public enum ServerGauge implements AbstractMetrics.Gauge {
LAST_REALTIME_SEGMENT_INITIAL_CONSUMPTION_DURATION_SECONDS("seconds", false),
LAST_REALTIME_SEGMENT_CATCHUP_DURATION_SECONDS("seconds", false),
LAST_REALTIME_SEGMENT_COMPLETION_DURATION_SECONDS("seconds", false),
// Uncompressed size of the last added segment on disk
LAST_ADDED_SEGMENT_UNCOMPRESSED_SIZE("LastAddedSegmentUncompressedSize", false),
REALTIME_OFFHEAP_MEMORY_USED("bytes", false),
REALTIME_SEGMENT_NUM_PARTITIONS("realtimeSegmentNumPartitions", false),
LLC_SIMULTANEOUS_SEGMENT_BUILDS("llcSimultaneousSegmentBuilds", true),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.pinot.common.metrics.ControllerGauge;
import org.apache.pinot.common.metrics.ControllerMeter;
import org.apache.pinot.common.metrics.ControllerMetrics;
import org.apache.pinot.common.restlet.resources.StartReplaceSegmentsRequest;
Expand Down Expand Up @@ -305,10 +304,6 @@ private SuccessResponse uploadSegment(@Nullable String tableName, TableType tabl
completeZkOperations(enableParallelPushProtection, headers, finalSegmentFile, tableNameWithType, segmentMetadata,
segmentName, zkDownloadUri, moveSegmentToFinalLocation, crypterClassName, allowRefresh);

// We only set this gauge after the segment is successfully pushed.
_controllerMetrics.setValueOfTableGauge(tableNameWithType, ControllerGauge.LAST_PUSHED_SEGMENT_SIZE,
FileUtils.sizeOfDirectory(tempSegmentDir));

return new SuccessResponse("Successfully uploaded segment: " + segmentName + " of table: " + tableNameWithType);
} catch (WebApplicationException e) {
throw e;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ public void addSegment(ImmutableSegment immutableSegment) {
_serverMetrics.addValueToTableGauge(_tableNameWithType, ServerGauge.DOCUMENT_COUNT,
immutableSegment.getSegmentMetadata().getTotalDocs());
_serverMetrics.addValueToTableGauge(_tableNameWithType, ServerGauge.SEGMENT_COUNT, 1L);
// Ideally this would be part of the segment metadata, but this is the only point we have easy, guaranteed
// access to the segment on disk.
_serverMetrics.addValueToTableGauge(_tableNameWithType, ServerGauge.LAST_ADDED_SEGMENT_UNCOMPRESSED_SIZE,
immutableSegment.getSegmentSizeBytes());

ImmutableSegmentDataManager newSegmentManager = new ImmutableSegmentDataManager(immutableSegment);
SegmentDataManager oldSegmentManager = _segmentDataManagerMap.put(segmentName, newSegmentManager);
Expand Down