5
5
"sync"
6
6
"time"
7
7
8
- "github.com/nyaruka/librato "
8
+ "github.com/nyaruka/gocommon/analytics "
9
9
"github.com/nyaruka/rp-indexer/indexers"
10
10
"github.com/sirupsen/logrus"
11
11
)
@@ -38,10 +38,11 @@ func NewDaemon(cfg *Config, db *sql.DB, ixs []indexers.Indexer, poll time.Durati
38
38
func (d * Daemon ) Start () {
39
39
// if we have a librato token, configure it
40
40
if d .cfg .LibratoToken != "" {
41
- librato .Configure (d .cfg .LibratoUsername , d .cfg .LibratoToken , d .cfg .InstanceName , time .Second , d .wg )
42
- librato .Start ()
41
+ analytics .RegisterBackend (analytics .NewLibrato (d .cfg .LibratoUsername , d .cfg .LibratoToken , d .cfg .InstanceName , time .Second , d .wg ))
43
42
}
44
43
44
+ analytics .Start ()
45
+
45
46
for _ , i := range d .indexers {
46
47
d .startIndexer (i )
47
48
}
@@ -119,7 +120,7 @@ func (d *Daemon) reportStats() {
119
120
log := logrus .NewEntry (logrus .StandardLogger ())
120
121
121
122
for k , v := range metrics {
122
- librato .Gauge ("indexer." + k , v )
123
+ analytics .Gauge ("indexer." + k , v )
123
124
log = log .WithField (k , v )
124
125
}
125
126
@@ -129,7 +130,7 @@ func (d *Daemon) reportStats() {
129
130
// Stop stops this daemon
130
131
func (d * Daemon ) Stop () {
131
132
logrus .Info ("daemon stopping" )
132
- librato .Stop ()
133
+ analytics .Stop ()
133
134
134
135
close (d .quit )
135
136
d .wg .Wait ()
0 commit comments