TSContainerUsage function
The TSContainerUsage function returns information about the size and capacity of the specified container or of all containers.
Syntax
TSContainerUsage(container_name varchar(128,1));
TSContainerUsage(container_name varchar(128,1),
rw_flag integer default 0);
- container_name
- Specifies which container to return information about. Must be an existing container name. You can include wildcard characters from the MATCHES operator: *, ?, [...], \, ^. The function returns information for all containers that have names that match the expression. See MATCHES Operator.
- rw_flag
- For rolling window containers, specifies for which partitions to return the sum of storage space usage:
Description
Use the TSContainerUsage function to monitor how full the specified container is. For rolling window containers, the TSContainerTotalUsage function returns summary values for how full the specified set of partitions is. You can use the information from this function to determine how quickly your containers are filling and whether you must allocate more storage space.
Returns
The number of pages that contain
time series data in the pages
column, the number
of elements in the slots
column, and the number of
pages that are allocated to the container in the total
column.
Example: Monitor a container
The following statement returns the information for the container that is named mult_container:
EXECUTE FUNCTION TSContainerUsage("mult_container");
pages slots total
30 26 50
1 row(s) retrieved.
This container has 26 time series data elements that use 30 pages out of the total 50 pages of space. Although the container is almost half empty, the container can probably accommodate fewer than 20 more time series elements.
Example: Monitor all containers
The following statement returns the information for all containers:
EXECUTE FUNCTION TSContainerUsage(NULL);
pages slots total
2029 241907 2169
1 row(s) retrieved.
The containers have only 140 pages of available space.
Example: Monitor a group of containers
Suppose that you have containers that have the following names:
- active_cnt1
- active_cnt2
- historical_cnt1
The following statement returns the information for the two containers that have names that begin with active:
EXECUTE FUNCTION TSContainerUsage(active*);
pages slots total
202 4197 169
1 row(s) retrieved.