Skip to content

Commit

Permalink
Renamed Metrics.RpcRequestCount to RPCRequestCount to conform to styl…
Browse files Browse the repository at this point in the history
…e check (#417)
  • Loading branch information
merlimat authored Dec 14, 2020
1 parent 0e48f3b commit a0f59a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions pulsar/internal/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ type Metrics struct {
ConnectionsEstablishmentErrors prometheus.Counter
ConnectionsHandshakeErrors prometheus.Counter
LookupRequestsCount prometheus.Counter
RpcRequestCount prometheus.Counter
RPCRequestCount prometheus.Counter
}

type TopicMetrics struct {
Expand Down Expand Up @@ -268,7 +268,7 @@ func NewMetricsProvider(userDefinedLabels map[string]string) *Metrics {
ConstLabels: constLabels,
}),

RpcRequestCount: prometheus.NewCounter(prometheus.CounterOpts{
RPCRequestCount: prometheus.NewCounter(prometheus.CounterOpts{
Name: "pulsar_client_rpc_count",
Help: "Counter of RPC requests made by the client",
ConstLabels: constLabels,
Expand Down Expand Up @@ -306,7 +306,7 @@ func NewMetricsProvider(userDefinedLabels map[string]string) *Metrics {
prometheus.DefaultRegisterer.Register(metrics.ConnectionsEstablishmentErrors)
prometheus.DefaultRegisterer.Register(metrics.ConnectionsHandshakeErrors)
prometheus.DefaultRegisterer.Register(metrics.LookupRequestsCount)
prometheus.DefaultRegisterer.Register(metrics.RpcRequestCount)
prometheus.DefaultRegisterer.Register(metrics.RPCRequestCount)
return metrics
}

Expand Down
6 changes: 3 additions & 3 deletions pulsar/internal/rpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (c *rpcClient) RequestToAnyBroker(requestID uint64, cmdType pb.BaseCommand_

func (c *rpcClient) Request(logicalAddr *url.URL, physicalAddr *url.URL, requestID uint64,
cmdType pb.BaseCommand_Type, message proto.Message) (*RPCResult, error) {
c.metrics.RpcRequestCount.Inc()
c.metrics.RPCRequestCount.Inc()
cnx, err := c.pool.GetConnection(logicalAddr, physicalAddr)
if err != nil {
return nil, err
Expand Down Expand Up @@ -138,7 +138,7 @@ func (c *rpcClient) Request(logicalAddr *url.URL, physicalAddr *url.URL, request

func (c *rpcClient) RequestOnCnx(cnx Connection, requestID uint64, cmdType pb.BaseCommand_Type,
message proto.Message) (*RPCResult, error) {
c.metrics.RpcRequestCount.Inc()
c.metrics.RPCRequestCount.Inc()
wg := sync.WaitGroup{}
wg.Add(1)

Expand All @@ -158,7 +158,7 @@ func (c *rpcClient) RequestOnCnx(cnx Connection, requestID uint64, cmdType pb.Ba
}

func (c *rpcClient) RequestOnCnxNoWait(cnx Connection, cmdType pb.BaseCommand_Type, message proto.Message) error {
c.metrics.RpcRequestCount.Inc()
c.metrics.RPCRequestCount.Inc()
return cnx.SendRequestNoWait(baseCommand(cmdType, message))
}

Expand Down

0 comments on commit a0f59a3

Please sign in to comment.