Skip to content

Commit d2bded3

Browse files
committed
Specify time extracted
1 parent caa12f0 commit d2bded3

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

tap/output.go

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ type Output struct {
3232
Schema *Schema `json:"schema,omitempty"`
3333
// Record is a record from the stream, if Type == "RECORD".
3434
Record map[string]any `json:"record,omitempty"`
35+
// TimeExtracted is the time that this record was extracted, if Type == "RECORD".
36+
TimeExtracted string `json:"time_extracted,omitempty"`
3537
// KeyProperties is a list of strings indicating which properties make up the primary
3638
// key for this stream.
3739
//

tap/tap.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ func Run(ctx context.Context, logger kitlog.Logger, ol *OutputLogger, cl *client
1717
return err
1818
}
1919

20-
start := time.Now()
21-
logger.Log("msg", "loading records", "start", start.Format(time.RFC3339))
20+
timeExtracted := time.Now().Format(time.RFC3339)
21+
logger.Log("msg", "loading records", "time_extracted", timeExtracted)
2222
records, err := stream.GetRecords(ctx, logger, cl)
2323
if err != nil {
2424
return err
@@ -27,8 +27,10 @@ func Run(ctx context.Context, logger kitlog.Logger, ol *OutputLogger, cl *client
2727
logger.Log("msg", "outputting records", "count", len(records))
2828
for _, record := range records {
2929
op := &Output{
30-
Type: OutputTypeRecord,
31-
Record: record,
30+
Type: OutputTypeRecord,
31+
Stream: name,
32+
Record: record,
33+
TimeExtracted: timeExtracted,
3234
}
3335
if err := ol.Log(op); err != nil {
3436
return err

0 commit comments

Comments
 (0)