_record_dimension_timestream¶
- swxsoc.db.timeseries._record_dimension_timestream(dimensions: list, instrument_name: str = None, measure_name: str = 'timestamp', measure_value: any = None, measure_value_type: str = 'DOUBLE', timestamp: str = None) None[source]¶
Record a single measurement to an AWS timestream for viewing on a dashboard such as Grafana.
Warning
This function requires AWS credentials with permission to write to the AWS timestream database.
- Parameters:
dimensions (list[dict]) – A list of dimensions to record. Each dimension should be a dictionary with ‘Name’ and ‘Value’ keys.
instrument_name (str, optional) – Optional. Name of the instrument to add as a dimension. Defaults to None.
measure_name (str) – The name of the measure being recorded. Defaults to “timestamp”.
measure_value (any, optional) – The value of the measure being recorded. Defaults to the current UTC timestamp if not provided.
measure_value_type (str) – The type of the measure value (e.g., “DOUBLE”, “BIGINT”). Defaults to “DOUBLE”.
timestamp (str, optional) – The timestamp for the record in milliseconds. Defaults to the current time if not provided.
- Returns:
None