Skip to content

Commit

Permalink
Add how to use EventTime to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
komamitsu committed Apr 2, 2017
1 parent 077486c commit c90e745
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Expand Up @@ -146,6 +146,20 @@ event.put("rate", 3.14);
fluency.emit(tag, event);
```

If you want to use [EventTime](https://github.com/fluent/fluentd/wiki/Forward-Protocol-Specification-v1#eventtime-ext-format) as a timestamp, call `Fluency#emit` with an `EventTime` object in the following way

```java
int epochSeconds;
int nanoSeconds;
:
EventTime eventTime = EventTime.fromEpoch(epochSeconds, nanoSeconds);

// You can also create an EventTime object like this
// EventTime eventTime = EventTime.fromEpochMilli(System.currentTimeMillis());

fluency.emit(tag, eventTime, event);
```

### Release resources

```java
Expand Down

0 comments on commit c90e745

Please sign in to comment.