Last active
July 30, 2022 03:02
-
-
Save nekketsuuu/c84479128ca9487be7c018c741732be1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "aws-sdk-timestreamwrite" | |
timestream = Aws::TimestreamWrite::Client.new | |
timestream.write_records( | |
database_name: "nekketsuuu_test", | |
table_name: "sample", | |
records: [ | |
{ | |
dimensions: [ | |
{ | |
name: "servername", | |
value: "orange", | |
dimension_value_type: "VARCHAR", | |
}, | |
], | |
time: Time.now.to_i.to_s, | |
time_unit: "SECONDS", | |
measure_name: "values", | |
measure_value_type: "MULTI", | |
measure_values: [{name: "clock", value: Time.now.to_i.to_s, type: "TIMESTAMP"}, {name: "cpu", value: "10.0", type: "DOUBLE"}], | |
}, | |
{ | |
dimensions: [ | |
{ | |
name: "servername", | |
value: "orange", | |
dimension_value_type: "VARCHAR", | |
}, | |
], | |
time: (Time.now.to_i + 1).to_s, | |
time_unit: "SECONDS", | |
measure_name: "values", | |
measure_value_type: "MULTI", | |
measure_values: [{name: "cpu", value: "10.0", type: "DOUBLE"}], | |
}, | |
], | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment