惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
J
Java Code Geeks
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Engineering at Meta
Engineering at Meta
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
小众软件
小众软件
博客园 - 聂微东
酷 壳 – CoolShell
酷 壳 – CoolShell
月光博客
月光博客
Last Week in AI
Last Week in AI
博客园_首页
I
InfoQ
T
Tailwind CSS Blog
爱范儿
爱范儿
雷峰网
雷峰网
Recent Announcements
Recent Announcements
F
Fortinet All Blogs
B
Blog
WordPress大学
WordPress大学
A
About on SuperTechFans
V
Visual Studio Blog
有赞技术团队
有赞技术团队
P
Proofpoint News Feed

博客园 - 风易微凉

AI笔记-快捷键2 AI笔记 快捷键1 AI笔记-钢笔PEN 我的2025 倒影中的你 后座有你 踏入破解行业 一个人、一场梦、一座空城、一生心疼 人间有味是清欢 安卓开发中遇到耗电量高的问题解决方案 no no no no 敢说不 逆向工程-反编译,嵌入 AlarmManager的使用 基于项目中遇到的技术问题,谈谈SharedPreferences的使用的注意问题 根据当前进程号,获取进程下线程数目 MongoDB数据库日志备份压缩脚本 mongodb数据库磁盘碎片整理。 mongodb mapreduce示例 mongodb表字段处理生成域名字段
mongodb库表信息监控脚本
风易微凉 · 2013-12-31 · via 博客园 - 风易微凉
var collnames=db.getCollectionNames();
//print(collnames)
var indexsize="";
var collline="";
var storagesize=""
var size=""
var count=""
/*print("|--------------------------------------------totalIndexSize----------------------------------------|")
for (coll in collnames)
{
    if(collnames[coll].substr(0,7)=='system.')
        continue;
    collline+=collnames[coll]+"   ";
    stats=db[collnames[coll]].stats();
//    print(collnames[coll]+": "+stats["totalIndexSize"]);
    indexsize=indexsize+"   "+stats["totalIndexSize"]
}
print("|"+collline+"|")
print("|"+indexsize+"|")
print("|--------------------------------------------totalIndexSize----------------------------------------|")
*/
print("******************"+db.getName()+"*******************")
for (coll in collnames)
{
        if(collnames[coll].substr(0,7)=='system.')
                continue;
    collline+=collnames[coll]+"   ";
        stats=db[collnames[coll]].stats();
    printjson(stats);
    indexsize=indexsize+"   "+stats["totalIndexSize"]
    storagesize=storagesize+"   "+stats["storageSize"]
    count=count+"   "+stats["count"]
    size=size+"   "+stats["size"]
}
print("******************"+db.getName()+"*******************")
print("|"+db.getName())
print("|-------------------------------------------[totalIndexSize]---------------------------------------|")
print("|"+collline+"|")
print("|"+indexsize+"|")
print("|-------------------------------------------[totalIndexSize]---------------------------------------|")
print("|-------------------------------------------[storageSize]------------------------------------------|")
print("|"+collline+"|")
print("|"+storagesize+"|")
print("|-------------------------------------------[storageSize]------------------------------------------|")
print("|-------------------------------------------[count]------------------------------------------------|")
print("|"+collline+"|")
print("|"+count+"|")
print("|-------------------------------------------[count]------------------------------------------------|")
print("|-------------------------------------------[size]-------------------------------------------------|")
print("|"+collline+"|")
print("|"+size+"|")
print("|-------------------------------------------[size]-------------------------------------------------|")

posted @ 2013-12-31 14:22  风易微凉  阅读(376)  评论()    收藏  举报