diff options
author | Benety Goh <benety@mongodb.com> | 2022-04-29 08:54:15 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-05-20 10:23:03 +0000 |
commit | aecbb01f4bf1e34f0f299eab5b6ea950dd2a7a73 (patch) | |
tree | b9f07035066e768253f8ed025db088cd17d19011 /src/mongo/db | |
parent | ea66e125bf6368da4146c1d8974c595e29787542 (diff) | |
download | mongo-aecbb01f4bf1e34f0f299eab5b6ea950dd2a7a73.tar.gz |
SERVER-64659 add external sorter file handle metrics to indexBulkBuilder server status section
(cherry picked from commit bfc606f1cc5ad931f054b5c152993a57d30eef64)
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/index/index_access_method.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/index/index_access_method.cpp b/src/mongo/db/index/index_access_method.cpp index 8edea31fccb..4077f614fd3 100644 --- a/src/mongo/db/index/index_access_method.cpp +++ b/src/mongo/db/index/index_access_method.cpp @@ -97,6 +97,8 @@ public: BSONObjBuilder builder; builder.append("count", count.loadRelaxed()); builder.append("resumed", resumed.loadRelaxed()); + builder.append("filesOpenedForExternalSort", sorterFileStats.opened.loadRelaxed()); + builder.append("filesClosedForExternalSort", sorterFileStats.closed.loadRelaxed()); return builder.obj(); } @@ -106,6 +108,12 @@ public: // Number of times the bulk builder was created for a resumable index build. // This value should not exceed 'count'. AtomicWord<long long> resumed; + + // Number of times the external sorter opened/closed a file handle to spill data to disk. + // This pair of counters in aggregate indicate the number of open file handles used by + // the external sorter and may be useful in diagnosing situations where the process is + // close to exhausting this finite resource. + SorterFileStats sorterFileStats; } indexBulkBuilderSSS; /** @@ -124,6 +132,7 @@ SortOptions makeSortOptions(size_t maxMemoryUsageBytes, StringData dbName) { .TempDir(storageGlobalParams.dbpath + "/_tmp") .ExtSortAllowed() .MaxMemoryUsageBytes(maxMemoryUsageBytes) + .FileStats(&indexBulkBuilderSSS.sorterFileStats) .DBName(dbName.toString()); } |