Skip to content

Commit

Permalink
Added RestLayer Changes for PIT stats (opensearch-project#4217)
Browse files Browse the repository at this point in the history
Signed-off-by: Ajay Kumar Movva <movvaam@amazon.com>
  • Loading branch information
ajaymovva authored and pranikum committed Sep 25, 2022
1 parent 0c9a76d commit 42b6f41
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Added
- Github workflow for changelog verification ([#4085](https://github.com/opensearch-project/OpenSearch/pull/4085))
- Label configuration for dependabot PRs ([#4348](https://github.com/opensearch-project/OpenSearch/pull/4348))
- Added RestLayer Changes for PIT stats ([#4217](https://github.com/opensearch-project/OpenSearch/pull/4217))

### Changed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
search.scroll_current .+ \n
search.scroll_time .+ \n
search.scroll_total .+ \n
search.point_in_time_current .+ \n
search.point_in_time_time .+ \n
search.point_in_time_total .+ \n
segments.count .+ \n
segments.memory .+ \n
segments.index_writer_memory .+ \n
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,24 @@ protected Table getTableWithHeader(final RestRequest request) {
);
table.addCell("pri.search.scroll_total", "default:false;text-align:right;desc:completed scroll contexts");

table.addCell(
"search.point_in_time_current",
"sibling:pri;alias:scc,searchPointInTimeCurrent;default:false;text-align:right;desc:open point in time contexts"
);
table.addCell("pri.search.point_in_time_current", "default:false;text-align:right;desc:open point in time contexts");

table.addCell(
"search.point_in_time_time",
"sibling:pri;alias:scti,searchPointInTimeTime;default:false;text-align:right;desc:time point in time contexts held open"
);
table.addCell("pri.search.point_in_time_time", "default:false;text-align:right;desc:time point in time contexts held open");

table.addCell(
"search.point_in_time_total",
"sibling:pri;alias:scto,searchPointInTimeTotal;default:false;text-align:right;desc:completed point in time contexts"
);
table.addCell("pri.search.point_in_time_total", "default:false;text-align:right;desc:completed point in time contexts");

table.addCell("segments.count", "sibling:pri;alias:sc,segmentsCount;default:false;text-align:right;desc:number of segments");
table.addCell("pri.segments.count", "default:false;text-align:right;desc:number of segments");

Expand Down Expand Up @@ -878,6 +896,15 @@ Table buildTable(
table.addCell(totalStats.getSearch() == null ? null : totalStats.getSearch().getTotal().getScrollCount());
table.addCell(primaryStats.getSearch() == null ? null : primaryStats.getSearch().getTotal().getScrollCount());

table.addCell(totalStats.getSearch() == null ? null : totalStats.getSearch().getTotal().getPitCurrent());
table.addCell(primaryStats.getSearch() == null ? null : primaryStats.getSearch().getTotal().getPitCurrent());

table.addCell(totalStats.getSearch() == null ? null : totalStats.getSearch().getTotal().getPitTime());
table.addCell(primaryStats.getSearch() == null ? null : primaryStats.getSearch().getTotal().getPitTime());

table.addCell(totalStats.getSearch() == null ? null : totalStats.getSearch().getTotal().getPitCount());
table.addCell(primaryStats.getSearch() == null ? null : primaryStats.getSearch().getTotal().getPitCount());

table.addCell(totalStats.getSegments() == null ? null : totalStats.getSegments().getCount());
table.addCell(primaryStats.getSegments() == null ? null : primaryStats.getSegments().getCount());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,19 @@ protected Table getTableWithHeader(final RestRequest request) {
);
table.addCell("search.scroll_total", "alias:scto,searchScrollTotal;default:false;text-align:right;desc:completed scroll contexts");

table.addCell(
"search.point_in_time_current",
"alias:scc,searchPointInTimeCurrent;default:false;text-align:right;desc:open point in time contexts"
);
table.addCell(
"search.point_in_time_time",
"alias:scti,searchPointInTimeTime;default:false;text-align:right;desc:time point in time contexts held open"
);
table.addCell(
"search.point_in_time_total",
"alias:scto,searchPointInTimeTotal;default:false;text-align:right;desc:completed point in time contexts"
);

table.addCell("segments.count", "alias:sc,segmentsCount;default:false;text-align:right;desc:number of segments");
table.addCell("segments.memory", "alias:sm,segmentsMemory;default:false;text-align:right;desc:memory used by segments");
table.addCell(
Expand Down Expand Up @@ -519,6 +532,9 @@ Table buildTable(
table.addCell(searchStats == null ? null : searchStats.getTotal().getScrollCurrent());
table.addCell(searchStats == null ? null : searchStats.getTotal().getScrollTime());
table.addCell(searchStats == null ? null : searchStats.getTotal().getScrollCount());
table.addCell(searchStats == null ? null : searchStats.getTotal().getPitCurrent());
table.addCell(searchStats == null ? null : searchStats.getTotal().getPitTime());
table.addCell(searchStats == null ? null : searchStats.getTotal().getPitCount());

SegmentsStats segmentsStats = indicesStats == null ? null : indicesStats.getSegments();
table.addCell(segmentsStats == null ? null : segmentsStats.getCount());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,18 @@ protected Table getTableWithHeader(final RestRequest request) {
"alias:scti,searchScrollTime;default:false;text-align:right;desc:time scroll contexts held open"
);
table.addCell("search.scroll_total", "alias:scto,searchScrollTotal;default:false;text-align:right;desc:completed scroll contexts");
table.addCell(
"search.point_in_time_current",
"alias:spc,searchPointInTimeCurrent;default:false;text-align:right;desc:open point in time contexts"
);
table.addCell(
"search.point_in_time_time",
"alias:spti,searchPointInTimeTime;default:false;text-align:right;desc:time point in time contexts held open"
);
table.addCell(
"search.point_in_time_total",
"alias:spto,searchPointInTimeTotal;default:false;text-align:right;desc:completed point in time contexts"
);

table.addCell("segments.count", "alias:sc,segmentsCount;default:false;text-align:right;desc:number of segments");
table.addCell("segments.memory", "alias:sm,segmentsMemory;default:false;text-align:right;desc:memory used by segments");
Expand Down Expand Up @@ -390,6 +402,9 @@ Table buildTable(RestRequest request, ClusterStateResponse state, IndicesStatsRe
table.addCell(getOrNull(commonStats, CommonStats::getSearch, i -> i.getTotal().getScrollCurrent()));
table.addCell(getOrNull(commonStats, CommonStats::getSearch, i -> i.getTotal().getScrollTime()));
table.addCell(getOrNull(commonStats, CommonStats::getSearch, i -> i.getTotal().getScrollCount()));
table.addCell(getOrNull(commonStats, CommonStats::getSearch, i -> i.getTotal().getPitCurrent()));
table.addCell(getOrNull(commonStats, CommonStats::getSearch, i -> i.getTotal().getPitTime()));
table.addCell(getOrNull(commonStats, CommonStats::getSearch, i -> i.getTotal().getPitCount()));

table.addCell(getOrNull(commonStats, CommonStats::getSegments, SegmentsStats::getCount));
table.addCell(getOrNull(commonStats, CommonStats::getSegments, SegmentsStats::getZeroMemory));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ public void testBuildTable() {
assertThat(row.get(3).value, equalTo(shardRouting.state()));
assertThat(row.get(6).value, equalTo(localNode.getHostAddress()));
assertThat(row.get(7).value, equalTo(localNode.getId()));
assertThat(row.get(69).value, equalTo(shardStats.getDataPath()));
assertThat(row.get(70).value, equalTo(shardStats.getStatePath()));
assertThat(row.get(72).value, equalTo(shardStats.getDataPath()));
assertThat(row.get(73).value, equalTo(shardStats.getStatePath()));
}
}
}

0 comments on commit 42b6f41

Please sign in to comment.