# Package google.golang.org/appengine/v2/runtime (v2.0.6)

> [!NOTE]
> **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/v2/runtime).

<br />

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

    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

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

    type Statistics struct {
    	// CPU records the CPU consumed by this instance, in megacycles.
    	CPU struct {
    		Total   https://pkg.go.dev/builtin#float64
    		Rate1M  https://pkg.go.dev/builtin#float64 // consumption rate over one minute
    		Rate10M https://pkg.go.dev/builtin#float64 // consumption rate over ten minutes
    	}
    	// RAM records the memory used by the instance, in megabytes.
    	RAM struct {
    		Current    https://pkg.go.dev/builtin#float64
    		Average1M  https://pkg.go.dev/builtin#float64 // average usage over one minute
    		Average10M https://pkg.go.dev/builtin#float64 // average usage over ten minutes
    	}
    }

Statistics represents the system's statistics.

### func Stats

    func Stats(c https://pkg.go.dev/context.https://pkg.go.dev/context#Context) (*https://docs.cloud.google.com/appengine/docs/standard/go/reference/services/bundled/latest/runtime#google_golang_org_appengine_v2_runtime_Statistics, https://pkg.go.dev/builtin#error)