# Overview

In our example , the Timeseries table with the name environmental_data has the following attributes:

  • "stats": Stats regarding the Timeseries table: "table_size", "index_size", "toast_size", and "total_size". All values of stats are provided in bytes.
  • "dimensions": The dimension name is "city" and the data type of the corresponding dimension column is "varchar".
  • "measurements": The measurement column names are "temperature", "ozone", and "relative_humidity", and the data types of the corresponding dimensions are "real".
  • "defaults": Dictionary containing templates with default dimension value for the measurement "temperature" is set to Gdańsk.
  • "retention": The retention is set to 3 weeks ("retention": "3M").
  • "chunk": The chunk length is set to 1 week ("chunk": "1W").

Our request creates the following Timeseries table:

_timestamp city temperature ozone relative_humidity

If the Timeseries table were to be filled with updated values of Entries of a Ledger, an example of how they would be displayed would be:

_timestamp city temperature ozone relative_humidity
21 Apr 2022, 15:00:00 Gdańsk 12 29 55
21 Apr 2022, 15:00:00 Wrocław 12 29 55
21 Apr 2022, 16:00:00 Gdańsk 13 30 56
21 Apr 2022, 16:00:00 Wrocław 12 29 55
21 Apr 2022, 17:00:00 Gdańsk 15 31 54
21 Apr 2022, 17:00:00 Wrocław 12 29 55
21 Apr 2022, 18:00:00 Gdańsk 10 30 54
21 Apr 2022, 18:00:00 Wrocław 12 29 55

TIP

See add_twin_ledger_entry for information on how to add a Ledger Entry and update_twin_ledger_entry on how to update the value of a Ledger Entry.

Attribute Type Description
stats dictionary
Timeseries table stats.
Attribute Type Description
table_size integer Size of the Timeseries table in bytes.
index_size integer Size of all indexes attached to the Timeseries table in bytes.
toast_size integer TOAST size in bytes.
total_size integer Total size in bytes.
dimensions dictionary
Dictionary containing a list of dimension names and a list of data types of the corresponding dimensions.
Attribute Type Description
names list of strings Name(s) of the dimension(s). Each of the names must match the regular expression (opens new window) ^[a-z_][0-9a-z_]{0,63}$.
types list of string, value is "int", "bigint", "smallint", "integer", "numeric", "double precision", "json", "jsonb", "bool", "boolean", "character varying", "varchar", "text", "date", "time", "interval", "timestamp", "timestamptz", or "uuid". Data types of the corresponding dimensions.
measurements dictionary
Dictionary containing a list of measurement column names and a list of data types of the corresponding measurement columns.
Attribute Type Description
names list of strings Name(s) of the measurement column(s). Each of the names must match the regular expression (opens new window) ^[a-z_][0-9a-z_]{0,63}$.
types list of string, value is "int", "bigint", "smallint", "integer", "numeric", "double precision", "json", "jsonb", "bool", "boolean", "character varying", "varchar", "text", "date", "time", "interval", "timestamp", "timestamptz", or "uuid". Data types of the corresponding measurement columns.
defaults dictionary
Dictionary containing templates for "measurement" (to determine the name of the measurement column to store the Entry value) and "dimensions" (to determine the value for each of the dimensions). Provided default templates are used if no default templates are defined in the "timeseries" property of a Ledger's Entry. The templates follow the Python string format() convention (see Format String Syntax (opens new window)).
Attribute Type Description
measurement string Template that determines the name of the measurement column to store the Entry value. Provided default template is used if no default template is defined in the "timeseries" property of a Ledger's Entry. The template follows the Python string format() convention (see Format String Syntax (opens new window)).
dimensions dictionary Template that determines the value for each of the dimensions. Provided default template is used if no default template is defined in the "timeseries" property of a Ledger's Entry. The template follows the Python string format() convention (see Format String Syntax (opens new window)).
timestamp string Template that determines the value of the timestamp.
retention string Time for which the data is to be stored. It must match the regular expression (opens new window) ^([1-9][0-9]{0,2}[DWMY])|(INF)$.
chunk string Chunk length. It must match the regular expression (opens new window) ^([1-9][0-9]{0,2}[DWMY])|(INF)$.