Giter Club home page Giter Club logo

eureka-client's Issues

根据服务名获取服务实例列表

添加一个需求,根据服务名获取注册的服务列表

func (c *Client) GetApplicationInstance(name string) []Instance {
	instances := make([]Instance, 0)
	c.mutex.Lock()
	if c.Applications != nil {
		for _, app := range c.Applications.Applications {
			if app.Name == name {
				instances = append(instances, app.Instances...)
			}
		}
	}
	c.mutex.Unlock()

	return instances
}

Memory leaks and the number of coroutines keeps increasing

Memory leaks and the number of coroutines keeps increasing,Profiling using the "pprof" tool。

`goroutine profile: total 159
71 @ 0xcdb6f6 0xceae52 0xf40075 0xd09b21

0xf40074 net/http.(*persistConn).writeLoop+0xf4 D:/goPath/src/net/http/transport.go:2392

69 @ 0xcdb6f6 0xceae52 0xf3ef85 0xd09b21

0xf3ef84 net/http.(*persistConn).readLoop+0xda4 D:/goPath/src/net/http/transport.go:2213`

[allocs abnormal display]

0xd17ec4 io.ReadAll+0xa4 D:/goPath/src/io/io.go:643

0xf4d0b3 io/ioutil.ReadAll+0x73 D:/goPath/src/io/ioutil/ioutil.go:27

0xf4d08e github.com/xuanbo/requests.(*Result).Raw+0x4e D:/goPath/pkg/mod/github.com/xuanbo/[email protected]/requests.go:286

0xf4d2c7 github.com/xuanbo/requests.(*Result).Json+0x27 D:/goPath/pkg/mod/github.com/xuanbo/[email protected]/requests.go:309

0xf4e3bc github.com/xuanbo/eureka-client.Refresh+0x2dc D:/goPath/pkg/mod/github.com/xuanbo/[email protected]/api.go:66

0xf4efef github.com/xuanbo/eureka-client.(*Client).doRefresh+0x2f D:/goPath/pkg/mod/github.com/xuanbo/[email protected]/client.go:112

0xf4ed47 github.com/xuanbo/eureka-client.(*Client).refresh+0x47 D:/goPath/pkg/mod/github.com/xuanbo/[email protected]/client.go:56

InstanceID error?

InstanceID: fmt.Sprintf("%s:%s:%d", ip, config.App, config.Port),

or

InstanceID: fmt.Sprintf("%s:%s:%d", config.App, ip, config.Port),

which right?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.