#!/usr/bin/python
import json
import pycurl
import cStringIO
def work_url(ip):
buf=cStringIO.StringIO()
c=pycurl.Curl()
c.setopt(c.URL,"http://%s:8983/solr/collection1/admin/mbeans?stats=true&wt=json&_=1409194287592"%ip)
c.setopt(c.WRITEFUNCTION,buf.write)
c.perform()
a=buf.getvalue()
buf.close()
return a
if __name__ == '__main__':
dict={}
for i in range(4,10):
ip='10.13.144.22'+str(i)
b=work_url(ip)
data=json.loads(b)
print data
dict[ip]={}
select_avgTimePerRequest=data['solr-mbeans'][3]['/select']['stats']['avgTimePerRequest']
select_avgRequestsPerSecond=data['solr-mbeans'][3]['/select']['stats']['avgRequestsPerSecond']
cache_document=data['solr-mbeans'][7]['documentCache']['stats']['cumulative_hitratio']
dict[ip]['select']={}
dict[ip]['select']['avgTimePerRequest']=select_avgTimePerRequest
dict[ip]['select']['avgRequestsPerSecond']=select_avgRequestsPerSecond
dict[ip]['select']['hitratio']=cache_document
print dict
solrcloud 数据监控
原创
©著作权归作者所有:来自51CTO博客作者nginx2012的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:solrcloud 监控
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
SolrCloud概述
功能和架构 下面是SolrCloud一些不错的功能: 中心化集群...
SolrCloud概述 SorlCloud 搜索 集群配置 增加节点 -
SolrCloud相关资料
This page is not necessarily kept up to date - for the latest SC...
大数据 java web.xml solr zookeeper -
SolrCloud阶段总结
http://www.cnblogs.com/guozk/p/3498844.htmlSolrCloud阶段总结开发类型全文检索相关开发Solr版本4.2文件内容本文介绍S
solrcloud solr zookeeper jar 服务器