1
0
Fork 0

Implement launch reporting, and ability to disable

master
Philip O'Toole 10 years ago
parent 368bdad119
commit d103397e1f

@ -81,7 +81,7 @@ When a transaction takes place either both statements will succeed, or neither.
Qeurying data is easy. Simply perform a HTTP GET with the SQL query in the body of the request.
curl -L -XGET localhost:4001/db -d 'SELECT * from foo'
An alternative approach is to read the database via `sqlite3`, the command-line tool that comes with SQLite. As long as you can be sure the file you access is under the leader, the records returned will be accurate and up-to-date.
### Performance
@ -110,5 +110,8 @@ Review [issue #14](https://github.com/otoolep/rqlite/issues/14) to learn more ab
This is new software, so it goes without saying it has bugs. It's by no means finished -- issues are now being tracked, and I plan to develop this project further. Pull requests are also welcome.
## Reporting
rqlite reports a small amount anonymous data to Loggly, each time it is launched. This data is just the host operating system and system architecture. This is only used to track the number of rqlite deployments. Reporting can be disabled by passing `-noreport=true` to rqlite at launch time.
## Credits
This project uses the [go-raft](https://github.com/goraft/raft) implementation of the Raft consensus protocol, and was inspired by the [raftd](https://github.com/goraft/raftd) reference implementation. rqlite also borrows some ideas from [etcd](https://github.com/coreos/etcd), and uses [go-sqlite3](http://godoc.org/github.com/mattn/go-sqlite3) to talk to the SQLite database.

@ -10,12 +10,16 @@ the database is made to a majority of underlying SQLite files, or none-at-all.
package main
import (
"bytes"
"flag"
"fmt"
"net/http"
"os"
"os/signal"
"path/filepath"
"runtime"
"runtime/pprof"
"time"
"github.com/otoolep/rqlite/server"
@ -30,6 +34,7 @@ var cpuprofile string
var logFile string
var logLevel string
var snapAfter int
var disableReporting bool
func init() {
flag.StringVar(&host, "h", "localhost", "hostname")
@ -40,6 +45,7 @@ func init() {
flag.StringVar(&logFile, "logfile", "stdout", "log file path")
flag.StringVar(&logLevel, "loglevel", "INFO", "log level (ERROR|WARN|INFO|DEBUG|TRACE)")
flag.IntVar(&snapAfter, "s", 100, "Snapshot and compact after this number of new log entries")
flag.BoolVar(&disableReporting, "noreport", false, "Disable anonymised launch reporting")
flag.Usage = func() {
fmt.Fprintf(os.Stderr, "Usage: %s [arguments] <data-path> \n", os.Args[0])
flag.PrintDefaults()
@ -99,6 +105,9 @@ func main() {
pprof.StartCPUProfile(f)
defer pprof.StopCPUProfile()
}
if !disableReporting {
reportLaunch()
}
setupLogging(logLevel, logFile)
@ -124,3 +133,11 @@ func main() {
<-terminate
log.Info("rqlite server stopped")
}
func reportLaunch() {
json := fmt.Sprintf(`{"os": "%s", "arch": "%s"}`, runtime.GOOS, runtime.GOARCH)
data := bytes.NewBufferString(json)
client := http.Client{Timeout: time.Duration(5 * time.Second)}
go client.Post("https://logs-01.loggly.com/inputs/8a0edd84-92ba-46e4-ada8-c529d0f105af/tag/rqlite/",
"application/json", data)
}

Loading…
Cancel
Save