동일 실행파일을 여러개 실행시켰을 때 구분해서 affinity 설정

This commit is contained in:
2023-11-30 14:17:27 +09:00
parent 023a2a5194
commit 1d3266bbaf
6 changed files with 154 additions and 33 deletions

View File

@ -94,20 +94,21 @@ func (pm *procmeta) setState(s protos.ProcessState) {
}
type houstonClient struct {
childProcs []*procmeta
extraMetrics unsafe.Pointer // map[string]float32
deploys map[string][]*protos.VersionAndArgs
shutdownFunc context.CancelFunc
ctx context.Context
operationChan chan *protos.OperationQueryResponse
exitChan chan *exec.Cmd
clientChan chan *grpc.ClientConn
timestamp string
wg sync.WaitGroup
config clientConfig
version string
standalone bool
metricExporter metric.Exporter
childProcs []*procmeta
extraMetrics unsafe.Pointer // map[string]float32
deploys map[string][]*protos.VersionAndArgs
shutdownFunc context.CancelFunc
ctx context.Context
operationChan chan *protos.OperationQueryResponse
exitChan chan *exec.Cmd
clientChan chan *grpc.ClientConn
timestamp string
wg sync.WaitGroup
config clientConfig
version string
standalone bool
metricExporter metric.Exporter
siblingProcIndex map[string]uint64
}
func unmarshal[T any](val *T, src map[string]string) {
@ -260,14 +261,15 @@ func NewClient(standalone bool) (HoustonClient, error) {
}
hc := &houstonClient{
config: clientConfig,
clientChan: make(chan *grpc.ClientConn),
extraMetrics: unsafe.Pointer(&map[string]float32{}),
deploys: deploys,
timestamp: exefi.ModTime().String(),
version: string(ver),
standalone: standalone,
metricExporter: metric.NewPrometheusExport(clientConfig.MetricNamespace),
config: clientConfig,
clientChan: make(chan *grpc.ClientConn),
extraMetrics: unsafe.Pointer(&map[string]float32{}),
deploys: deploys,
timestamp: exefi.ModTime().String(),
version: string(ver),
standalone: standalone,
metricExporter: metric.NewPrometheusExport(clientConfig.MetricNamespace),
siblingProcIndex: make(map[string]uint64),
}
ctx, cancel := context.WithCancel(context.Background())