THE LINUX FOUNDATION PROJECTS
Docs navigation
On this page

    Analyze service costs by subaccount

    FOCUS Versions

    v1.0 v1.1 v1.2 v1.3 v1.4

    Context

    By understanding the services incurring the highest cost in a subaccount for a period of time, Engineers can get a high-level picture of where to prioritize their efforts when it comes to optimizing usage. Often, the largest optimization opportunities are in the services that incur the most cost.

    FOCUS SQL Query

    SELECT
      ChargePeriodStart,
      SubAccountId,
      SubAccountName,
      ServiceName,
      SUM(EffectiveCost) AS TotalEffectiveCost
    FROM focus_data_table
    WHERE SubAccountID = ?
      AND ChargePeriodStart >= ? AND ChargePeriodEnd < ?
    GROUP BY
      ChargePeriodStart,
      SubAccountId,
      SubAccountName,
      ServiceName
    ORDER BY SUM(EffectiveCost) DESC
    LIMIT 10

    FOCUS Datasets

    FOCUS Columns