You need to enable JavaScript to run this app.
导航

命中率

最近更新时间2023.03.31 14:08:54

首次发布时间2023.03.03 11:27:59

阅读本文,您可以快速了解命中率 PHP SDK 的使用方法。

说明

以下 SDK 示例中仅展示了部分参数,您可以在 veImageX 的接口文档中查看该接口支持的全部参数及取值。

初始化

调用接口前请先完成初始化,具体操作请参考初始化

查询请求命中率

查询当前账号下对应域名的 CDN 请求次数命中率用量数据。

具体接口参数和返回字段请参考 DescribeImageXHitRateRequestData。我们同时在 GitHub 上提供了参考示例

具体示例如下所示:

<?php
include_once(__DIR__ . '/../../../vendor/autoload.php');

use Volc\Service\ImageX;

$client = ImageX::getInstance();

// call below method if you dont set ak and sk in ~/.volc/config
$client->setAccessKey("ak");
$client->setSecretKey("sk");

$body = [
    'StartTime' => "2023-01-21T00:00:00+08:00",
    'EndTime' => "2023-01-28T00:00:00+08:00",
    'Interval' => "300",
];

$response = $client->describeImageXHitRateRequestData($body);
print_r($response);

查询流量命中率

查询当前账号下对应域名的 CDN 流量命中率用量数据。

具体接口参数和返回字段请参考 DescribeImageXHitRateTrafficData。我们同时在 GitHub 上提供了参考示例

具体示例如下所示:

<?php
include_once(__DIR__ . '/../../../vendor/autoload.php');

use Volc\Service\ImageX;

$client = ImageX::getInstance();

// call below method if you dont set ak and sk in ~/.volc/config
$client->setAccessKey("ak");
$client->setSecretKey("sk");

$body = [
    'StartTime' => "2023-01-21T00:00:00+08:00",
    'EndTime' => "2023-01-28T00:00:00+08:00",
    'Interval' => "300",
];

$response = $client->describeImageXHitRateTrafficData($body);
print_r($response);