add event log and timestamp to events api

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2016-02-12 10:17:59 -08:00
parent 3dc59d565a
commit 9341a95c26
6 changed files with 191 additions and 111 deletions

View file

@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"syscall"
"time"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
@ -270,7 +271,7 @@ func (s *apiServer) UpdateProcess(ctx context.Context, r *types.UpdateProcessReq
}
func (s *apiServer) Events(r *types.EventsRequest, stream types.API_EventsServer) error {
events := s.sv.Events()
events := s.sv.Events(time.Unix(int64(r.Timestamp), 0))
defer s.sv.Unsubscribe(events)
for e := range events {
if err := stream.Send(&types.Event{