mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
Move LongQueryTime option to cluster section of config file
This commit is contained in:
parent
bbffc8f500
commit
5413597998
3 changed files with 5 additions and 4 deletions
|
|
@ -13,9 +13,8 @@ const (
|
|||
|
||||
// Config represents the configuration for the command.
|
||||
type Config struct {
|
||||
DataDir string `toml:"data-dir"`
|
||||
Host string `toml:"host"`
|
||||
LongQueryTime Duration `toml:"long-query-time"`
|
||||
DataDir string `toml:"data-dir"`
|
||||
Host string `toml:"host"`
|
||||
|
||||
Cluster struct {
|
||||
ReplicaN int `toml:"replicas"`
|
||||
|
|
@ -25,6 +24,7 @@ type Config struct {
|
|||
PollingInterval Duration `toml:"polling-interval"`
|
||||
InternalPort string `toml:"internal-port"`
|
||||
GossipSeed string `toml:"gossip-seed"`
|
||||
LongQueryTime Duration `toml:"long-query-time"`
|
||||
} `toml:"cluster"`
|
||||
|
||||
Plugins struct {
|
||||
|
|
|
|||
|
|
@ -117,6 +117,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
// Handle some stats tagging
|
||||
statsTags := make([]string, 0, 3)
|
||||
|
||||
fmt.Printf("long query time: %v\n", h.Cluster.LongQueryTime)
|
||||
if h.Cluster.LongQueryTime > 0 && dif > h.Cluster.LongQueryTime {
|
||||
h.logger().Printf("%s %s %.03fs", r.Method, r.URL.String(), float64(dif))
|
||||
statsTags = append(statsTags, "slow_query")
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ func (m *Command) SetupServer() error {
|
|||
|
||||
// Set configuration options.
|
||||
m.Server.AntiEntropyInterval = time.Duration(m.Config.AntiEntropy.Interval)
|
||||
m.Server.Cluster.LongQueryTime = time.Duration(m.Config.LongQueryTime)
|
||||
m.Server.Cluster.LongQueryTime = time.Duration(m.Config.Cluster.LongQueryTime)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue