MCPcopy
hub / github.com/CodisLabs/codis / InfoSentinel

Method InfoSentinel

pkg/topom/topom_api.go:525–541  ·  view source on GitHub ↗
(params martini.Params)

Source from the content-addressed store, hash-verified

523}
524
525func (s *apiServer) InfoSentinel(params martini.Params) (int, string) {
526 addr, err := s.parseAddr(params)
527 if err != nil {
528 return rpc.ApiResponseError(err)
529 }
530 c, err := redis.NewClientNoAuth(addr, time.Second)
531 if err != nil {
532 log.WarnErrorf(err, "create redis client to %s failed", addr)
533 return rpc.ApiResponseError(err)
534 }
535 defer c.Close()
536 if info, err := c.Info(); err != nil {
537 return rpc.ApiResponseError(err)
538 } else {
539 return rpc.ApiResponseJson(info)
540 }
541}
542
543func (s *apiServer) InfoSentinelMonitored(params martini.Params) (int, string) {
544 addr, err := s.parseAddr(params)

Callers

nothing calls this directly

Calls 4

parseAddrMethod · 0.95
WarnErrorfMethod · 0.80
CloseMethod · 0.65
InfoMethod · 0.45

Tested by

no test coverage detected