## GetAdoptionUsageSummary `client.Usage.GetAdoptionUsageSummary(ctx, body) (*UsageGetAdoptionUsageSummaryResponse, error)` **post** `/gitpod.v1.UsageService/GetAdoptionUsageSummary` Gets a summary of adoption and usage metrics. Returns all scalar values, trends, and a sparkline for the Adoption & Usage insight category. For full-resolution time series, use the individual time series RPCs. Use this method to: - Build adoption and usage insight cards - Filter adoption metrics by project, user, or team - Compare the requested date range against the previous period ### Example ```yaml dateRange: startTime: "2024-01-01T00:00:00Z" endTime: "2024-02-01T00:00:00Z" projectId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ``` ### Parameters - `body UsageGetAdoptionUsageSummaryParams` - `DateRange param.Field[DateRange]` Date range to query metrics within. - `ProjectID param.Field[string]` Optional project ID to filter metrics by. - `TeamID param.Field[string]` Optional team ID to scope results to members of a specific team. - `UserID param.Field[string]` Optional user ID to filter metrics for a specific user (personal insights view). ### Returns - `type UsageGetAdoptionUsageSummaryResponse struct{…}` - `ActiveUsersCount string` Count of active users in the date range. - `ActiveUsersTrend float64` Fractional change in active_users_count vs previous period. Computed as (current - previous) / previous. - `EnvRuntimePerUserSeconds float64` Average environment runtime in seconds per active user. - `EnvRuntimePerUserTrend float64` Fractional change in env_runtime_per_user_seconds vs previous period. Computed as (current - previous) / previous. - `PowerUsersCount string` Count of power users in the date range. - `PowerUsersThresholdSeconds string` Threshold in seconds used to determine power users. Displayed to users so they understand the definition. - `PowerUsersTrend float64` Fractional change in power_users_count vs previous period. Computed as (current - previous) / previous. - `SessionsCount string` Count of environment sessions (total starts) in the date range. - `SessionsTrend float64` Fractional change in sessions_count vs previous period. Computed as (current - previous) / previous. - `Sparkline []TimeSeriesPoint` Sparkline data for the card's trend line (typically ~4 weekly points). - `Time Time` Timestamp for this data point. - `Value int64` The numerical value for this data point. ### Example ```go package main import ( "context" "fmt" "time" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" "github.com/gitpod-io/gitpod-sdk-go/shared" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) response, err := client.Usage.GetAdoptionUsageSummary(context.TODO(), gitpod.UsageGetAdoptionUsageSummaryParams{ DateRange: gitpod.F(shared.DateRangeParam{ EndTime: gitpod.F(time.Now()), StartTime: gitpod.F(time.Now()), }), ProjectID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.ActiveUsersCount) } ``` #### Response ```json { "activeUsersCount": "activeUsersCount", "activeUsersTrend": 0, "envRuntimePerUserSeconds": 0, "envRuntimePerUserTrend": 0, "powerUsersCount": "powerUsersCount", "powerUsersThresholdSeconds": "powerUsersThresholdSeconds", "powerUsersTrend": 0, "sessionsCount": "sessionsCount", "sessionsTrend": 0, "sparkline": [ { "time": "2019-12-27T18:11:19.117Z", "value": 0 } ] } ```