Пример #1
0
func InitTupleComponent(db *sql.DB, hostname string, verbose bool) platform.IComponent {

	component := ext.NewDynamicPluginComponent(hostname, "com.github.maciejmrowiec.pgmonitor", verbose)

	component.AddDynamicMetrica(NewTableMetric(db, "tuple/table/$/percent/active", TupleActivePercent, "%"))
	component.AddDynamicMetrica(NewTableMetric(db, "tuple/table/$/percent/dead", TupleDeadPercent, "%"))
	component.AddDynamicMetrica(NewTableMetric(db, "tuple/table/$/percent/free", TupleFreePercent, "%"))

	return component
}
Пример #2
0
func InitDynamicSamplesComponent(hostname string, verbose bool) platform.IComponent {

	rss := NewRssProcessor()
	NewDynamicCollector(rss).Run()

	component := ext.NewDynamicPluginComponent(hostname, "com.github.maciejmrowiec.cfclientmonitor", verbose)
	component.AddDynamicMetrica(NewRssPerCommand(rss, "memory/rss/average", regexp.MustCompile("/var/cfengine/bin/.*")))
	component.AddDynamicMetrica(NewMaxRssPerCommand(rss, "memory/rss/max", regexp.MustCompile("/var/cfengine/bin/.*")))

	return component
}
Пример #3
0
func InitTableSizeComponent(db *sql.DB, hostname string, verbose bool) platform.IComponent {

	component := ext.NewDynamicPluginComponent(hostname, "com.github.maciejmrowiec.pgmonitor", verbose)

	component.AddDynamicMetrica(NewTableMetric(db, "disksize/table/$/table", TableDiskSize, "B"))
	component.AddDynamicMetrica(NewTableMetric(db, "disksize/table/$/index", TableIndexesDiskSize, "B"))

	component.AddDynamicMetrica(NewTableMetric(db, "disksize/summary/table/$", TableDiskSize, "B"))
	component.AddDynamicMetrica(NewTableMetric(db, "disksize/summary/index/$", TableIndexesDiskSize, "B"))

	return component
}