service

package
v1.29.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2020 License: Apache-2.0 Imports: 7 Imported by: 12

Documentation

Overview

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

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.

Types

type ProfilingConfig

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL