Exemplo n.º 1
0
//output metrics in specific output format
func outputUserMetrics(u *userstat.MysqlStatUsers,
	m *metrics.MetricContext, form string) {
	//print out json packages
	if form == "json" {
		m.EncodeJSON(os.Stdout)
	}
	//print out in graphite form:
	//<metric_name> <metric_value>
	if form == "graphite" {
		u.FormatGraphite(os.Stdout)
	}
}
Exemplo n.º 2
0
//output metrics in specific output format
func outputTableMetrics(d *dbstat.MysqlStatDBs, t *tablestat.MysqlStatTables,
	m *metrics.MetricContext, form string) {
	//print out json packages
	if form == "json" {
		m.EncodeJSON(os.Stdout)
	}
	//print out in graphite form:
	//<metric_name> <metric_value>
	if form == "graphite" {
		d.FormatGraphite(os.Stdout)
		t.FormatGraphite(os.Stdout)
	}
}