-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwatchdoggo.py
28 lines (24 loc) · 901 Bytes
/
watchdoggo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from dbinteraction import dbexec
from datadog import initialize, api, statsd
import datetime
class Doggo:
def __init__(self):
self.guildc = None
self.userc = None
self.autorolec = None
self.commandsc = None
self.datadogOpts= {
"api_key": dbexec("dsaApiKey", log=True),
"app_key":dbexec("ddAppKey", log=True),
"statsd_host":"127.0.0.1",
"statsd_port":8125
}
initialize(**self.datadogOpts)
def gather(self, gc, uc, arc, cc):
now = datetime.datetime.now()
self.guildc, self.userc, self.autorolec, self.commandsc= gc, uc, arc, cc
def update(self):
print(self.guildc, self.userc, self.autorolec, self.commandsc)
dbexec("INSERT INTO stats1 VALUES(DATETIME('now','localtime'),?,?,?,?)", (self.guildc, self.userc, self.autorolec, self.commandsc,), db="stats")
def ddNewCommand():
statsd.increment("konata_commandsTotal.increment")