阅读本文,您可以获取 Go SDK 感知指标监控的接口调用示例,实现快速开发。
调用接口前,请先完成 Go SDK 的安装及初始化操作。
本节为您介绍感知指标监控相关接口的功能和调用示例。
您可以调用 DescribeImageXSensibleCountByTime 接口查询感知指标采集样本量数据。详细的参数说明可参见 DescribeImageXSensibleCountByTime 接口文档。
接口调用示例如下所示。
package imagex_test import ( "context" "encoding/json" "fmt" "testing" "github.com/volcengine/volc-sdk-golang/base" imagex "github.com/volcengine/volc-sdk-golang/service/imagex/v2" ) func Test_DescribeImageXSensibleCountByTime(t *testing.T) { instance := imagex.NewInstance() instance.SetCredential(base.Credentials{ AccessKeyID: "ak", SecretAccessKey: "sk", }) param := &imagex.DescribeImageXSensibleCountByTimeBody{} resp, err := instance.DescribeImageXSensibleCountByTime(context.Background(), param) if err != nil { fmt.Printf("error %v", err) } else { t, _ := json.Marshal(resp) fmt.Printf("success %v", string(t)) } }
您可以调用 DescribeImageXSensibleCacheHitRateByTime 接口查询感知指标内存/磁盘命中率数据。详细的参数说明可参见 DescribeImageXSensibleCacheHitRateByTime 接口文档。
接口调用示例如下所示。
package imagex_test import ( "context" "encoding/json" "fmt" "testing" "github.com/volcengine/volc-sdk-golang/base" imagex "github.com/volcengine/volc-sdk-golang/service/imagex/v2" ) func Test_DescribeImageXSensibleCacheHitRateByTime(t *testing.T) { instance := imagex.NewInstance() instance.SetCredential(base.Credentials{ AccessKeyID: "ak", SecretAccessKey: "sk", }) param := &imagex.DescribeImageXSensibleCacheHitRateByTimeBody{} resp, err := instance.DescribeImageXSensibleCacheHitRateByTime(context.Background(), param) if err != nil { fmt.Printf("error %v", err) } else { t, _ := json.Marshal(resp) fmt.Printf("success %v", string(t)) } }
您可以调用 DescribeImageXSensibleTopSizeURL 接口查询大图文件体积 Top URL 数据。详细的参数说明可参见 DescribeImageXSensibleTopSizeURL 接口文档。
接口调用示例如下所示。
package imagex_test import ( "context" "encoding/json" "fmt" "testing" "github.com/volcengine/volc-sdk-golang/base" imagex "github.com/volcengine/volc-sdk-golang/service/imagex/v2" ) func Test_DescribeImageXSensibleTopSizeURL(t *testing.T) { instance := imagex.NewInstance() instance.SetCredential(base.Credentials{ AccessKeyID: "ak", SecretAccessKey: "sk", }) param := &imagex.DescribeImageXSensibleTopSizeURLBody{} resp, err := instance.DescribeImageXSensibleTopSizeURL(context.Background(), param) if err != nil { fmt.Printf("error %v", err) } else { t, _ := json.Marshal(resp) fmt.Printf("success %v", string(t)) } }
您可以调用 DescribeImageXSensibleTopRamURL 接口查询大图文件内存 Top URL 数据。详细的参数说明可参见 DescribeImageXSensibleTopRamURL 接口文档。
接口调用示例如下所示。
package imagex_test import ( "context" "encoding/json" "fmt" "testing" "github.com/volcengine/volc-sdk-golang/base" imagex "github.com/volcengine/volc-sdk-golang/service/imagex/v2" ) func Test_DescribeImageXSensibleTopRAMURL(t *testing.T) { instance := imagex.NewInstance() instance.SetCredential(base.Credentials{ AccessKeyID: "ak", SecretAccessKey: "sk", }) param := &imagex.DescribeImageXSensibleTopRAMURLBody{} resp, err := instance.DescribeImageXSensibleTopRAMURL(context.Background(), param) if err != nil { fmt.Printf("error %v", err) } else { t, _ := json.Marshal(resp) fmt.Printf("success %v", string(t)) } }
您可以调用 DescribeImageXSensibleTopResolutionURL 接口查询大图文件分辨率 Top URL 数据。详细的参数说明可参见 DescribeImageXSensibleTopResolutionURL 接口文档。
接口调用示例如下所示。
package imagex_test import ( "context" "encoding/json" "fmt" "testing" "github.com/volcengine/volc-sdk-golang/base" imagex "github.com/volcengine/volc-sdk-golang/service/imagex/v2" ) func Test_DescribeImageXSensibleTopResolutionURL(t *testing.T) { instance := imagex.NewInstance() instance.SetCredential(base.Credentials{ AccessKeyID: "ak", SecretAccessKey: "sk", }) param := &imagex.DescribeImageXSensibleTopResolutionURLBody{} resp, err := instance.DescribeImageXSensibleTopResolutionURL(context.Background(), param) if err != nil { fmt.Printf("error %v", err) } else { t, _ := json.Marshal(resp) fmt.Printf("success %v", string(t)) } }
您可以调用 DescribeImageXSensibleTopUnknownURL 接口查询大图文件未知原因 Top URL 列表。详细的参数说明可参见 DescribeImageXSensibleTopUnknownURL 接口文档。
接口调用示例如下所示。
package imagex_test import ( "context" "encoding/json" "fmt" "testing" "github.com/volcengine/volc-sdk-golang/base" imagex "github.com/volcengine/volc-sdk-golang/service/imagex/v2" ) func Test_DescribeImageXSensibleTopUnknownURL(t *testing.T) { instance := imagex.NewInstance() instance.SetCredential(base.Credentials{ AccessKeyID: "ak", SecretAccessKey: "sk", }) param := &imagex.DescribeImageXSensibleTopUnknownURLBody{} resp, err := instance.DescribeImageXSensibleTopUnknownURL(context.Background(), param) if err != nil { fmt.Printf("error %v", err) } else { t, _ := json.Marshal(resp) fmt.Printf("success %v", string(t)) } }