Skip to main content

Billing

User is billed according to YTsaurus scheduler CPU, RAM and GPU usage reportings, and YTsaurus master storage usage reportings.

You can check the actual prices by logging in to your TractoAI console.

In order to retrieve the consumption data, you may use the following YQL queries.

Compute (CPU, RAM and GPU) consumption:

SELECT
pool_tree,
year,
month,
SUM(cpu * (finish - start)) / (60 * 60) as cpu_hour_consumption,
SUM(user_memory * (finish - start)) / (60 * 60) as memory_hour_consumption,
SUM(gpu * (finish - start)) / (60 * 60) as gpu_hour_consumption
FROM
(
SELECT
CAST(CAST(Yson::ConvertToDouble(tags.allocated_resources.cpu) AS String) AS Decimal(35, 10)) AS cpu,
CAST(CAST(Yson::ConvertToDouble(tags.allocated_resources.user_memory) AS String) AS Decimal(35, 10)) / 1073741824 AS user_memory,
CAST(CAST(Yson::ConvertToDouble(tags.allocated_resources.gpu) AS String) AS Decimal(35, 10)) AS gpu,
CAST(Yson::ConvertToInt64(usage.start) AS Decimal(35, 10)) AS start,
CAST(Yson::ConvertToInt64(usage.finish) AS Decimal(35, 10)) AS finish,
DateTime::GetMonth(DateTime::FromSeconds(CAST(Yson::ConvertToInt64(usage.start) AS Uint32))) as month,
DateTime::GetYear(DateTime::FromSeconds(CAST(Yson::ConvertToInt64(usage.start) AS Uint32))) as year,
Yson::ConvertToString(labels.pool_tree) as pool_tree
FROM `//sys/logs/scheduler/resource_metering_log`
)
group by pool_tree, year, month
order by pool_tree, year, month;

Formally, the above query calculates the integral of the CPU, RAM and GPU allocation time over all jobs of all operations within the "universe" pool.

Storage consumption:

SELECT
medium,
year,
month,
SUM(space_tib * duration_hr) AS space_tib_hr_consumption
FROM (
SELECT
(timestamp_end - timestamp_start) / 3600.0 AS duration_hr,
DateTime::GetMonth(DateTime::FromSeconds(CAST(timestamp_start AS Uint32))) as month,
DateTime::GetYear(DateTime::FromSeconds(CAST(timestamp_start AS Uint32))) as year,
'hdd' as medium,
Yson::ConvertToDouble(resource_usage["default"]) / Math::Pow(1024, 4) AS space_tib
FROM `//sys/resource_collector/logs/disk_log`
UNION ALL
SELECT
(timestamp_end - timestamp_start) / 3600.0 AS duration_hr,
DateTime::GetMonth(DateTime::FromSeconds(CAST(timestamp_start AS Uint32))) as month,
DateTime::GetYear(DateTime::FromSeconds(CAST(timestamp_start AS Uint32))) as year,
'nvme' as medium,
Yson::ConvertToDouble(resource_usage["nvme"]) / Math::Pow(1024, 4) AS space_tib
FROM `//sys/resource_collector/logs/disk_log`
)
GROUP BY medium, year, month
ORDER BY medium, year, month;