當需要查看分析儲存的詳細配置資訊,您可以使用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))
}
}