Partager via


Requêtes pour la table DevCenterBillingEventLogs

Pour obtenir des informations sur l'utilisation de ces requêtes dans le portail Azure, consultez le tutoriel Log Analytics. Pour l’API REST, consultez Requête.

DevCenter - Répartition de l’utilisation du stockage et du calcul DevBox par zone de développement

Obtenez le stockage total et les unités de calcul pour un mois donné.

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 : répartition du compteur de facturation DevBox par pool

Obtenez le nombre total d’unités de compteur par pool pour un mois donné.

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