Compare commits

..

2 Commits

Author SHA1 Message Date
e79b883faa Remove unused caching structs 2018-07-26 19:50:08 +02:00
0d3e2638c1 Add profiler for microsub server 2018-07-26 19:49:55 +02:00
2 changed files with 12 additions and 11 deletions

View File

@ -39,17 +39,6 @@ import (
"willnorris.com/go/microformats" "willnorris.com/go/microformats"
) )
type cacheItem struct {
item []byte
created time.Time
}
var cache map[string]cacheItem
func init() {
cache = make(map[string]cacheItem)
}
func (b *memoryBackend) feedHeader(fetchURL, contentType string, body io.Reader) (microsub.Feed, error) { func (b *memoryBackend) feedHeader(fetchURL, contentType string, body io.Reader) (microsub.Feed, error) {
log.Printf("ProcessContent %s\n", fetchURL) log.Printf("ProcessContent %s\n", fetchURL)
log.Println("Found " + contentType) log.Println("Found " + contentType)

View File

@ -26,6 +26,7 @@ import (
"regexp" "regexp"
"time" "time"
"cloud.google.com/go/profiler"
"github.com/garyburd/redigo/redis" "github.com/garyburd/redigo/redis"
"github.com/pstuifzand/ekster/pkg/microsub" "github.com/pstuifzand/ekster/pkg/microsub"
) )
@ -58,6 +59,17 @@ func newPool(addr string) *redis.Pool {
} }
func main() { func main() {
if os.Getenv("GOOGLE_APPLICATION_CREDENTIALS") != "" {
if err := profiler.Start(profiler.Config{
Service: "microsub-server",
ServiceVersion: "1.0",
ProjectID: "microsub-server", // optional on GCP
}); err != nil {
log.Fatalf("Cannot start the profiler: %v", err)
}
}
log.Println("eksterd - microsub server") log.Println("eksterd - microsub server")
flag.Parse() flag.Parse()