1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
package main
import (
"os"
"github.com/gocql/gocql"
)
func main() {
configuration := GetConfig(os.Getenv("HOME") + "/.yats.json")
cluster := gocql.NewCluster(configuration.DB_HOST)
cluster.Authenticator = gocql.PasswordAuthenticator{Username: configuration.DB_USERNAME, Password: configuration.DB_PASSWORD}
cluster.Keyspace = configuration.DB_NAME
session, _ := cluster.CreateSession()
defer session.Close()
var metrics = LoadMetrics(session)
PrintMetrics(metrics)
}
|