WriteRecords
Source:
src/AWS/Timestream/WriteRecords.ts
Runtime binding for timestream-write:WriteRecords — ingest time-series
records into a Timestream Table.
Bind the operation to a table inside a function runtime to get a callable
with DatabaseName and TableName injected automatically; you only supply
the Records (and optional CommonAttributes). For high-volume streaming
ingestion prefer the batching RecordsSink.
Provide Timestream.WriteRecordsHttp on the Function to implement the
binding.
Writing Records
Section titled “Writing Records”// init — bind the operation to the tableconst writeRecords = yield* Timestream.WriteRecords(table);
// runtime — ingest a recordconst result = yield* writeRecords({ Records: [ { Dimensions: [{ Name: "host", Value: "web-1" }], MeasureName: "cpu", MeasureValue: "42.5", MeasureValueType: "DOUBLE", Time: `${Date.now()}`, TimeUnit: "MILLISECONDS", }, ],});// result.RecordsIngested reports how many records landed