文档

查询分析存储描述信息

更新时间:

当需要查看分析存储的详细配置信息,您可以使用DescribeTimeseriesAnalyticalStore接口查询分析存储描述信息,例如数据生命周期配置、数据同步选项、数据同步状态、数据存储大小等。

前提条件

参数

参数

说明

timeseriesTableName

时序表名。

analyticalStoreName

分析存储名。

示例

以下示例用于查询test_timeseries_table时序表下的test_analytical_store分析存储的描述信息。

func DescribeAnalyticalStore(client *tablestore.TimeseriesClient) {
  //设置时序表名称和分析存储名称。
	req := tablestore.NewDescribeTimeseriesAnalyticalStoreRequest("test_timeseries_table", "test_analytical_store")
	resp, err := client.DescribeTimeseriesAnalyticalStore(req)
	if err != nil {
		log.Fatal(err)
	}
  //打印分析存储名称。
	fmt.Println("analyticalStoreName:", resp.AnalyticalStore.StoreName)
	//打印分析存储的同步选项。
  if resp.AnalyticalStore.SyncOption != nil {
		fmt.Println("syncOption:", *resp.AnalyticalStore.SyncOption)
	}
  //打印分析存储的数据生命周期。
	if resp.AnalyticalStore.TimeToLive != nil {
		fmt.Println("timeToLive:", *resp.AnalyticalStore.TimeToLive)
	}
  //打印分析存储当前时间的同步状态。
	if resp.SyncStat != nil {
		fmt.Println("syncPhase:", resp.SyncStat.SyncPhase)
		fmt.Println("currentSyncTimestamp:", time.Unix(resp.SyncStat.CurrentSyncTimestamp, 0))
	}
  //打印分析存储当前时间的数据量大小。
	if resp.StorageSize != nil {
		fmt.Println("storageSize:", resp.StorageSize.Size)
		fmt.Println("storageSizeTimestamp:", time.Unix(resp.StorageSize.Timestamp, 0))
	}
}
  • 本页导读 (1)
文档反馈