您的位置:首页 > 其它

开发cloudify配方文件- Web Management Console

2013-04-10 00:00 302 查看
配置Web Management Console

Cloudify web management console提供一个基于web的图形用户界面来监控你的应用和其对应的服务。特别在Applications视图下,通过线性图和仪表盘小部件来展示被选中的服务监控指标,每个小部件展示默认的度量,但也可以通过下来菜单来选择其他度量值。度量面板的布局和下拉菜单都要在各自的服务描述文件中配置。

内置和自定义指标

默认情况下, Cloudify监控CPU和内存的使用率这些通用指标,但是它还可以使用下面的自定义机制监控其他更具体的指标

Monitoring Probes closures that emit metrics and their current value.

Monitoring Plugins
classes that emit metrics and their current value.
Cloudify每5秒调用probe或插件,并返回一个包含指标名与对应值的Map,内置和自定义指标都要在web management console中展示
配置指标部件
在 web management console中, Applications视图包含一个专有的窗格来展示监控指标,并允许你通过下拉菜单来选择度量值。默认下,度量指标描述在widgets块中,布局在thewidgetsGroup块描述
下面是PetClinic 应用下的Mongo 数据库服务描述文件下的userInterface块, metricGroups 块描述MongoDB的6个指标的指标组。 widgetGroups块描述上面6个指标的展示图表和布局。

userInterface {
metricGroups = ([
metricGroup {
name "MongoDB"
metrics([
"Open Cursors",
"Current Active Connections",
"Active Read Clients",
"Active Write Clients",
"Read Clients Waiting",
"Write Clients Waiting"
])
}
])

widgetGroups = ([
widgetGroup {
name "Open Cursors"
widgets ([
balanceGauge{metric = "Open Cursors"},
barLineChart{
metric "Open Cursors"
axisYUnit Unit.REGULAR
},
])
},
widgetGroup {
name "Current Active Connections"
widgets ([
balanceGauge{metric = "Current Active Connections"},
barLineChart{
metric "Current Active Connections"
axisYUnit Unit.REGULAR
},
])
},
widgetGroup {
name "Active Read Clients"
widgets ([
balanceGauge{metric = "Active Read Clients"},
barLineChart{
metric "Active Read Clients"
axisYUnit Unit.REGULAR
},
])
},
widgetGroup {
name "Active Write Clients"
widgets ([
balanceGauge{metric = "Active Write Clients"},
barLineChart{
metric "Active Write Clients"
axisYUnit Unit.REGULAR
},
])
},
widgetGroup {
name "Read Clients Waiting"
widgets ([
balanceGauge{metric = "Read Clients Waiting"},
barLineChart{
metric "Read Clients Waiting"
axisYUnit Unit.REGULAR
},
])
},
widgetGroup {
name "Write Clients Waiting"
widgets ([
balanceGauge{metric = "Write Clients Waiting"},
barLineChart{
metric "Write Clients Waiting"
axisYUnit Unit.REGULAR
},
])
}
])
}




内置的配方例子
可以查看cloudify例子:
PetClinic 配方 <cloudifyRoot>/examples/petclinic.
tomcat 配方 /examples/petclinic/tomcat/tomcat-service.groovy(JMX插件)
MongoDB 配方 /examples/petclinic/mongod (使用java API连接MongoDB、MongoDB API命令获取监控指标的自定义插件
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: