051 cloud_capacity division by zero

This commit is contained in:
2026-06-18 11:41:59 +03:00
parent f1e4ee238e
commit 1f7ea5c3b1
7 changed files with 52 additions and 17 deletions
+23
View File
@@ -29,6 +29,9 @@
where p.type=3 AND aa.is_actual
order by p.code
</cfquery>
<cfoutput> #getTickCount()-request.startTickCount#</cfoutput><cfflush/>
<!--- <cfdump var=#qCode#/> --->
<cfquery name="qContragent" datasource="dwh">
select k.id_klienta as wz, k.__id::text as contragent_uid, k.__name as contragent
@@ -36,6 +39,7 @@
where k."__deletedAt" IS NULL
</cfquery>
<cfoutput> #getTickCount()-request.startTickCount#</cfoutput><cfflush/>
<!--- нужны компании, которые есть в пейге --->
<cfquery name="qSpec" datasource="dwh">
select k.id_klienta as wz, k.__id::text as contragent_uid, p.code, p.price, p.discount, k.__name as contragent, a.__name as contract, a.__id::text as contract_uid, d.__name as deal, d.__id::text as deal_uid, siv.abstractive_service as abstract_service, siv.modifier, siv.user_description, siv.hash as line_key
@@ -53,10 +57,16 @@
AND (siv.date_end > <cfqueryparam cfsqltype="cf_sql_timestamp" value=#dt_start#/> OR siv.date_end IS NULL)
order by k.id_klienta, p.code
</cfquery>
<cfoutput> #getTickCount()-request.startTickCount#</cfoutput><cfflush/>
<!--- siv means specification item version --->
<cfquery name="qSivAge" datasource="dwh">
select max(dt_load) as dt_load from elma.deals_services
</cfquery>
<cfoutput> #getTickCount()-request.startTickCount#</cfoutput><cfflush/>
<!--- здесь имеем список кодов с ценами и WZ. Каждому коду можно поставить в соответствие запрос, который даст по нему выборку. Изредка один запрос может вывести 2 кода, но разбить на 2 запроса легко. Кроме того, запросы можно объединить через union в один - может быть, так будет лучше читаться (быстрее выполняться не будет) --->
<cfif isDefined("DEBUG")>
<cfdump var=#qSpec#/>
@@ -90,6 +100,8 @@
order by m.clientid, vdc.name;
</cfquery>
<cfoutput> #getTickCount()-request.startTickCount#</cfoutput><cfflush/>
<cfif isDefined("DEBUG")>
<cfdump var=#qComputing#/>
<cfflush/>
@@ -99,6 +111,8 @@
select max(capacity_resource.timestamp) as dt_load from ngcloud_ru.capacity_resource
</cfquery>
<cfoutput> #getTickCount()-request.startTickCount#</cfoutput><cfflush/>
<!--- переделать storage_profile_types с расшифровкой ssd, sata, можно прямо до каталожного кода --->
<cfquery name="qStorage" datasource="billing-vc">
@@ -134,6 +148,9 @@
group by m.clientid, vdc.name, storage_profile_types.name
order by m.clientid, vdc.name, storage_profile_types.name;
</cfquery>
<cfoutput> #getTickCount()-request.startTickCount#</cfoutput><cfflush/>
<cfquery name="qStorageAge" datasource="billing-vc">
select max(capacity_storage.timestamp) as dt_load from ngcloud_ru.capacity_storage
</cfquery>
@@ -143,6 +160,8 @@
<cfflush/>
</cfif>
<cfoutput> #getTickCount()-request.startTickCount#</cfoutput><cfflush/>
<!---
"placement" "size_gb" "get_10k" "put_10k" "bytes_sent_gb"
HOT_FREE_LIMIT 1 10 1 100
@@ -177,10 +196,14 @@ HOT_FREE_LIMIT 1 10 1 100
<cfflush/>
</cfif>
<cfoutput> #getTickCount()-request.startTickCount#</cfoutput><cfflush/>
<cfquery name="qS3VolAge" datasource="billing-s3">
select max(timestamp_addition) as dt_load from s3billing.bucket_stat
</cfquery>
<cfoutput> #getTickCount()-request.startTickCount#</cfoutput><cfflush/>
<cfquery name="qS3OpsTrf" datasource="billing-s3">
select
sum(