示例#1
0
// NewMetricMetadataAPI creates a new instance of the API.
func NewMetricMetadataAPI(config cassandra.CassandraMetricMetadataConfig) api.MetricMetadataAPI {
	apiInstance, err := cassandra.NewCassandraMetricMetadataAPI(config)
	if err != nil {
		ExitWithMessage(fmt.Sprintf("Cannot instantiate a new API from %#v: %s\n", config, err.Error()))
	}
	return apiInstance
}
示例#2
0
func main() {
	flag.Parse()
	// common.SetupLogger()

	// Hosts    []string `yaml:"hosts"`
	// Keyspace string   `yaml:"keyspace"`
	config := cassandra.CassandraMetricMetadataConfig{Hosts: []string{"aws1.medium-trigger.universe.square"}, Keyspace: "metrics_indexer"}
	var metadataAPI api.MetricMetadataAPI
	metadataAPI, err := cassandra.NewCassandraMetricMetadataAPI(config)
	if err != nil {
		fmt.Printf("ERROR %s\n", err)
		os.Exit(1)
	}
	fmt.Printf("Success\n")
	stuff, err := metadataAPI.GetAllTags("jvm.thread-states", api.MetricMetadataAPIContext{})
	if err != nil {
		fmt.Printf("ERROR %s\n", err)
		os.Exit(1)
	}
	fmt.Printf("Stuff %+v\n", stuff)
}