neutral_cp

package module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: Apache-2.0 Imports: 5 Imported by: 2

README

neutral-cp

neutral-cp is facade for continuous profiling.

Example

package main

import (
	"net/http"
	ncp "github.com/ohkinozomu/neutral-cp"
)

func startProfiler() {
	c := ncp.Config{
		Registry:        ncp.CLOUD_PROFILER,
		ApplicationName: "example-app",
	}
	ncp := ncp.NeutralCP{Config: c}

	ctx := context.Background()
	err := ncp.Start(ctx)
	if err != nil {
		panic(err)
	}
}

func main() {
	go startProfiler()
	http.ListenAndServe(":8080", nil)
}

Registries

  • Pyroscope

  • Cloud Profiler

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Registry        Registry
	ApplicationName string
	ServerAddress   string
	Version         string
}

type NeutralCP

type NeutralCP struct {
	Config Config
}

func (*NeutralCP) Start

func (n *NeutralCP) Start(ctx context.Context, logger *zap.Logger) error

type Registry added in v0.1.0

type Registry int
const (
	UNKNOWN Registry = iota
	PYROSCOPE
	CLOUD_PROFILER
)

Jump to

Keyboard shortcuts

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