Dela via


Frågor för tabellen DevCenterBillingEventLogs

Information om hur du använder dessa frågor i Azure Portal finns i Log Analytics-självstudien. Information om REST-API:et finns i Fråga.

DevCenter – DevBox-lagrings- och beräkningsanvändningsuppdelning efter dev box

Hämta totalt lagringsutrymme och beräkningsenheter för en viss månad.

let startSearchTime = startofmonth(now());
let endSearchTime = startofmonth(now(), 1); // The second parameter represents the number of months to offset from the input date.
DevCenterBillingEventLogs 
| where OperationName == "DevBoxUsage"
    and StartTime >= startSearchTime 
    and StartTime < endSearchTime
| summarize arg_min(StartTime, *) by EventId // This will remove any duplicate rows. NOTE: Usages with the same EventId are not double charged, the dupe rows are only related to double logging.
| extend DevBoxName = UsageResourceName
| extend DevBoxId = UsageResourceUniqueId
| summarize StorageHours = countif(UsageType == "Storage"),
    StorageMeterQuantity = round(sum(iff(UsageType == "Storage", Quantity, 0.0)), 6),
    TotalRunningHours = round(sum(iff(UsageType == "Compute", Quantity, 0.0)), 6),
    NormalRateComputeHours = round(sum(iff(UsageType == "Compute" and IsOverMonthlyBillingCap == false, Quantity, 0.0)), 6),
    DiscountRateComputeHours = round(sum(iff(UsageType == "Compute" and IsOverMonthlyBillingCap == true, Quantity, 0.0)), 6) 
    by DevBoxName, DevBoxId
| project-reorder DevBoxName, DevBoxId, StorageHours, StorageMeterQuantity, TotalRunningHours, NormalRateComputeHours, DiscountRateComputeHours

DevCenter – Uppdelning av DevBox-faktureringsmätare efter pool

Hämta de totala mätarenheterna per pool för en viss månad.

let startSearchTime = startofmonth(now());
let endSearchTime = startofmonth(now(), 1); // The second parameter represents the number of months to offset from the input date.
DevCenterBillingEventLogs 
| where OperationName == "DevBoxUsage"
    and StartTime >= startSearchTime 
    and StartTime < endSearchTime
| summarize arg_min(StartTime, *) by EventId // This will remove any duplicate rows. NOTE: Usages with the same EventId are not double charged, the dupe rows are only related to double logging.
| extend Pool = tolower(BilledResourceId)
| summarize MeterUsage = round(sum(Quantity), 6)
    by Pool, MeterId, UsageType