toptopis an administrative command that returns usage statistics for each collection. You can usetopmetrics to compare the relative performance of your collections against each other.
정의
For every collection, top returns the amount of time, in microseconds, that each event takes to execute and a count of how many times each event has executed. The time and count metrics reset only after you restart your mongod instance.
편집
Queryable Encryption 사용하는 경우 top 명령은 컬렉션 이름만 반환합니다.
호환성
이 명령은 다음 환경에서 호스팅되는 배포에서 사용할 수 있습니다.
- MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud
MongoDB Enterprise: MongoDB의 구독 기반 자체 관리 버전
MongoDB Community: MongoDB의 소스 사용 가능 무료 자체 관리 버전
구문
Issue the top command against the admin database:
db.runCommand( { top: 1 } )
이벤트 필드
The top command returns usage statistics for the following event fields:
필드 | 설명 |
|---|---|
| 모든 |
| 읽기 잠금을 사용하는 작업에 대한 사용량 통계입니다. 이러한 작업에는 쿼리 및 집계가 포함되지만 이에 국한되지는 않습니다. |
| 쓰기 잠금을 사용하는 작업에 대한 사용량 통계입니다. 이러한 작업에는 문서 삽입, 업데이트 및 제거가 포함되지만 이에 국한되지는 않습니다. |
| 쿼리 작업에 대한 사용 통계 (예: |
|
|
|
|
|
|
|
|
| 집계, 인덱스 생성, 인덱스 제거 등의 작업에 대한 사용 통계입니다. 명령 유형에 따라 예를 들어 집계 작업은 |
예시
The output of the top command resembles the following output:
{ "totals" : { note: "all times in microseconds", "records.users" : { "total" : { "time" : 305277, "count" : 2825 }, "readLock" : { "time" : 305264, "count" : 2824 }, "writeLock" : { "time" : 13, "count" : 1 }, "queries" : { "time" : 305264, "count" : 2824 }, "getmore" : { "time" : 0, "count" : 0 }, "insert" : { "time" : 0, "count" : 0 }, "update" : { "time" : 0, "count" : 0 }, "remove" : { "time" : 0, "count" : 0 }, "commands" : { "time" : 0, "count" : 0 } } }