Go 1.11 has reached end of support
and will bedeprecatedon 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 theirdeprecation date. We
recommend that youmigrate to the latest supported version of Go.
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".
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{Totalfloat64Rate1Mfloat64// consumption rate over one minuteRate10Mfloat64// consumption rate over ten minutes}// RAM records the memory used by the instance, in megabytes.RAMstruct{Currentfloat64Average1Mfloat64// average usage over one minuteAverage10Mfloat64// average usage over ten minutes}}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eruntime\u003c/code\u003e package provides details on an application's resource usage and allows running code in a new background context.\u003c/p\u003e\n"],["\u003cp\u003eThis package is specifically designed for the App Engine standard environment and is not compatible with the flexible environment.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eRunInBackground\u003c/code\u003e function enables execution of a function in a background goroutine, with its own context.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eStatistics\u003c/code\u003e type offers information on CPU consumption and RAM usage, including rates and averages.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eStats\u003c/code\u003e function provides system statistics in the form of a pointer to the Statistics type and a potential error.\u003c/p\u003e\n"]]],[],null,["# Package google.golang.org/appengine/runtime (v1.6.8)\n\nVersion latestkeyboard_arrow_down\n\n- [1.6.8 (latest)](/appengine/docs/legacy/standard/go111/reference/latest/runtime)\n- [1.6.7](/appengine/docs/legacy/standard/go111/reference/1.6.7/runtime) \n**Note:** To get more information about this package, such as access to older versions, view [this package on pkg.go.dev](https://pkg.go.dev/google.golang.org/appengine/runtime). \n\u003cbr /\u003e\n\nPackage runtime exposes information about the resource usage of the application.\nIt also provides a way to run code in a new background context of a module.\n\nThis package does not work on App Engine \"flexible environment\". \n\nFunctions\n---------\n\n### func RunInBackground\n\n func RunInBackground(c https://pkg.go.dev/context.https://pkg.go.dev/context#Context, f func(c https://pkg.go.dev/context.https://pkg.go.dev/context#Context)) https://pkg.go.dev/builtin#error\n\nRunInBackground runs f in a background goroutine in this process.\nf is provided a context that may outlast the context provided to RunInBackground.\nThis is only valid to invoke from a service set to basic or manual scaling. \n\nStatistics\n----------\n\n type Statistics struct {\n \t// CPU records the CPU consumed by this instance, in megacycles.\n \tCPU struct {\n \t\tTotal https://pkg.go.dev/builtin#float64\n \t\tRate1M https://pkg.go.dev/builtin#float64 // consumption rate over one minute\n \t\tRate10M https://pkg.go.dev/builtin#float64 // consumption rate over ten minutes\n \t}\n \t// RAM records the memory used by the instance, in megabytes.\n \tRAM struct {\n \t\tCurrent https://pkg.go.dev/builtin#float64\n \t\tAverage1M https://pkg.go.dev/builtin#float64 // average usage over one minute\n \t\tAverage10M https://pkg.go.dev/builtin#float64 // average usage over ten minutes\n \t}\n }\n\nStatistics represents the system's statistics. \n\n### func Stats\n\n func Stats(c https://pkg.go.dev/context.https://pkg.go.dev/context#Context) (*#google_golang_org_appengine_runtime_Statistics, https://pkg.go.dev/builtin#error)"]]