Hi Yong Zhi,
With a trivial test I cannot reproduce the same issue with mongotop 3.0.4.
> ./bin/mongotop --version
mongotop version: 3.0.4
git version: efe71bf185cdcfe9632f1fc2e42ca4e895f93269
The ns field does not contain any spaces between the db name and the collection’s name.
2015-11-24T14:00:55.108+1100 connected to: 127.0.0.1
ns total read write 2015-11-24T14:00:56+11:00
AnnotationSource.nospaces 0ms 0ms 0ms
...
Although, I can create a collection with spaces on the collection’s name which will show up in mongotop
. For example:
2015-11-24T14:04:25.445+1100 connected to: 127.0.0.1
ns total read write 2015-11-24T14:04:26+11:00
AnnotationSource. prefix3spaces 0ms 0ms 0ms
AnnotationSource.nospaces 0ms 0ms 0ms
...
You can also output the result in JSON format with --json
option, to check whether the shell output was altered in some way.
To help troubleshoot can you please confirm some further details:
db.version()
reported in the mongo
shell.Regards,
Wan.
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to a topic in the Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mongodb-user/YZsPMviglGQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/e480efdc-7530-4d45-9c03-831ee8eff9b2%40googlegroups.com.
I had new observations when I compared the results from mongotop & db.getCollectionNames():
1, There is no space in the collection name in db.getCollectionNames() outputs;
2, Some collection shown in the mongotop doesn’t exist in db.getCollectionNames() list. for example, AnnotationSource. Oncomine.
3, One collection owns multiple rows in mongotop outputs (dgv_20130723 in this case with different spaces)
Hi Yong Zhi,
Based on your observations, there is a possibility that these collections may have existed at some point, and then later on removed by dropping the database (i.e. AnnotationSource).
mongotop
uses MongoDB top admin command to retrieve usage statistics; and currently there is an open ticket in MongoDB JIRA issue tracker for top
command (see SERVER-21168), where databases that have been dropped still shows up in the top’s result.
You can search the mongod
log file to confirm whether AnnotationSource database was dropped at some point in the past. For example, the log entries would be something like below :
2015-11-25T14:08:45.486+1100 I COMMAND [conn1] dropDatabase AnnotationSource starting
2015-11-25T14:08:45.511+1100 I COMMAND [conn1] dropDatabase AnnotationSource finished
If indeed these collections are only residue of the dropped database, you could schedule a restart of the mongod
process to clear them up. Alternatively, if the ‘spaces’ does not effect your operations you could leave it until the next scheduled downtime.
Please feel free to watch or up-vote the issue tracker SERVER-21168 for updates.
Regards,
Wan.
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to a topic in the Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mongodb-user/YZsPMviglGQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/f8441a5c-493c-4f20-9d45-e2b0677fdb46%40googlegroups.com.
how mongotop/top decide the order of the collection in the output? Do they use the collections’ creation time stamps?
Hi Yong Zhi,
Based on the mongotop
code, the output order will be sorted by namespace and total milliseconds. See sortableTotal struct.
If you are interested to know more about the inner workings of mongotop
, you can view the source code on github under mongo-tools/mongotop.
Kind regards,
Wan.