Skip to content

Commit

Permalink
remove warm up, use file offset instead
Browse files Browse the repository at this point in the history
  • Loading branch information
bentol committed Apr 21, 2018
1 parent 0b37bc1 commit 3a8d2c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 0 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"os"
"os/signal"
"syscall"
"time"

"github.com/martin-helmich/prometheus-nginxlog-exporter/config"
"github.com/martin-helmich/prometheus-nginxlog-exporter/discovery"
Expand Down Expand Up @@ -156,10 +155,6 @@ func main() {
go processNamespace(ns, &opts)
}

warmUpTime := time.Duration(totalFileSize / (5 * 1000 * 1000))
fmt.Printf("warm up for %+v seconds\n", int(warmUpTime))
time.Sleep(warmUpTime * time.Second)

listenAddr := fmt.Sprintf("%s:%d", cfg.Listen.Address, cfg.Listen.Port)
fmt.Printf("running HTTP server on address %s\n", listenAddr)

Expand Down
4 changes: 4 additions & 0 deletions tail/tailer.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ func (f *followerImpl) start() error {
Follow: true,
ReOpen: true,
Poll: true,
Location: &tail.SeekInfo{
Offset: 0,
Whence: 2,
},
})

if err != nil {
Expand Down

0 comments on commit 3a8d2c0

Please sign in to comment.