dataproxy: added caching of datasources when doing data proxy requests, #9078

This commit is contained in:
Torkel Ödegaard
2017-08-23 13:31:26 +02:00
parent bcb3dfac9f
commit 4f9fbcc211
12 changed files with 155 additions and 107 deletions

View File

@@ -9,7 +9,9 @@ import (
"net/http"
"os"
"path"
"time"
gocache "github.com/patrickmn/go-cache"
macaron "gopkg.in/macaron.v1"
"github.com/grafana/grafana/pkg/api/live"
@@ -29,13 +31,15 @@ type HttpServer struct {
macaron *macaron.Macaron
context context.Context
streamManager *live.StreamManager
cache *gocache.Cache
httpSrv *http.Server
}
func NewHttpServer() *HttpServer {
return &HttpServer{
log: log.New("http.server"),
log: log.New("http.server"),
cache: gocache.New(5*time.Minute, 10*time.Minute),
}
}