emit
Synthetically generate live or historical points containing only a time stamp. This simple source is like a blank canvas for building synthetic points; you can customize points by adding fields using put.
emit -every :duration: -from moment -to moment -limit limit -points point-array
Parameter | Description | Required? |
---|---|---|
-every |
The interval at which to emit points, specified as a :duration: See Time notation in Juttle for syntax information. |
No |
-from |
Stream points whose time stamps are greater than or equal to the specified moment See Time notation in Juttle for syntax information. |
No; defaults to :now: |
-to |
Stream points whose time stamps are less than the specified moment, which is less than or equal to :now: See Time notation in Juttle for syntax information. |
No; defaults to forever |
-last |
Given a duration, shorthand for -from (:now: - duration) -to :now: |
No |
-limit |
Total number of points to emit | No; defaults to 1. |
-points |
An array of points to stream | No |
The time field can be a moment expression, a quoted date/time string as generated by Juttle output, or a number of seconds since the Unix epoch. If the points have no time stamps, then a time field is added with values determined by the -from
options, or the current time if those options are omitted.
By default, this source node emits one point per second starting at the current time for a total of 100. Points with time in the past are emitted all at once, while points with time in the future are emitted in real time.
Example: Emit a point every second containing the current time, for a total of 100 points
emit -limit 100
| view text
Example: Emit 50 points in one-second intervals starting one day ago
emit -limit 50 -from :1 day ago:
All points are emitted at once, since their times are in the past. To emit them in real time, see pace.
Example: Replay points having a variety of timestamp formats text window
const points = [
{time: "1970-01-01", n:1},
{time: 1, n:2},
{time: "1970-01-01T00:00:02.000Z", n:3},
{time: Date.parse("Thu Jan 1 01:00:03 1970 UTC"), n:4},
{time: :1970-01-01T00:00:04:, n:5},
{time: :5:, n:6},
];
emit -points points