Go 1.11 has reached end of support and will be deprecated on January 31, 2026. After deprecation, you won't be able to deploy Go 1.11 applications, even if your organization previously used an organization policy to re-enable deployments of legacy runtimes. Your existing Go 1.11 applications will continue to run and receive traffic after their deprecation date. We recommend that you migrate to the latest supported version of Go.

Package google.golang.org/appengine/runtime (v1.6.8)

Package runtime exposes information about the resource usage of the application. It also provides a way to run code in a new background context of a module.

This package does not work on App Engine "flexible environment".

Functions

func RunInBackground

funcRunInBackground(ccontext .Context ,ffunc(ccontext .Context ))error 

RunInBackground runs f in a background goroutine in this process. f is provided a context that may outlast the context provided to RunInBackground. This is only valid to invoke from a service set to basic or manual scaling.

Statistics

typeStatisticsstruct{
// CPU records the CPU consumed by this instance, in megacycles.
CPUstruct{
Totalfloat64
Rate1Mfloat64 // consumption rate over one minute
Rate10Mfloat64 // consumption rate over ten minutes
}
// RAM records the memory used by the instance, in megabytes.
RAMstruct{
Currentfloat64
Average1Mfloat64 // average usage over one minute
Average10Mfloat64 // average usage over ten minutes
}
}

Statistics represents the system's statistics.

func Stats

funcStats(ccontext .Context )(*Statistics ,error )

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.