grpc: google.golang.org/grpc/profiling/service Index | Files

package service

import "google.golang.org/grpc/profiling/service"

Package service defines methods to register a gRPC client/service for a profiling service that is exposed in the same server. This service can be queried by a client to remotely manage the gRPC profiling behaviour of an application.

This package and all its methods are EXPERIMENTAL.

Index

Package Files

service.go

func Init Uses

func Init(pc *ProfilingConfig) error

Init takes a *ProfilingConfig to initialize profiling (turned on/off depending on the value set in pc.Enabled) and register the profiling service in the server provided in pc.Server.

type ProfilingConfig Uses

type ProfilingConfig struct {
    // Setting this to true will enable profiling.
    Enabled bool

    // Profiling uses a circular buffer (ring buffer) to store statistics for
    // only the last few RPCs so that profiling stats do not grow unbounded. This
    // parameter defines the upper limit on the number of RPCs for which
    // statistics should be stored at any given time. An average RPC requires
    // approximately 2-3 KiB of memory for profiling-related statistics, so
    // choose an appropriate number based on the amount of memory you can afford.
    StreamStatsSize uint32

    // To expose the profiling service and its methods, a *grpc.Server must be
    // provided.
    Server *grpc.Server
}

ProfilingConfig defines configuration options for the Init method.

Package service imports 7 packages (graph). Updated 2019-12-31. Refresh now. Tools for package owners.