Skip to content
This repository has been archived by the owner on Dec 3, 2019. It is now read-only.

Commit

Permalink
Add more metrics (#23)
Browse files Browse the repository at this point in the history
* Add more metrics

* Add ConsumeMessageFailedRate to metric map

* Rename ConsumeMessageFailedRate to OutputReadFailedRate

* Rename OutputReadFailedRate to ConsumeReadFailedRate

* Fix build issue

* Rename ConsumeReadFailedRate to ConsumeReadFailed
  • Loading branch information
Bo Yang authored May 18, 2017
1 parent e77b411 commit ccfe5e5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions client/cherami/outputhostconnection.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ func (conn *outputHostConnection) readMessagesPump() {

cmd, err := conn.outputHostStream.Read()
if err != nil {
conn.reporter.IncCounter(metrics.ConsumeReadFailed, nil, 1)
// Error reading from stream. Time to close and bail out.
conn.logger.Infof("Error reading OutputHost Message Stream: %v", err)
// Stream is closed. Close the connection and bail out
Expand Down
1 change: 1 addition & 0 deletions client/cherami/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ func (s *publisherImpl) Publish(message *PublisherMessage) *PublisherReceipt {
srCh := make(chan *PublisherReceipt, 1)
_, err := s.PublishAsync(message, srCh)
if err != nil {
s.reporter.IncCounter(metrics.PublisherMessageFailed, nil, 1)
return err
}

Expand Down
12 changes: 7 additions & 5 deletions common/metrics/names.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ const (
// DeploymentTagName is the tag name to identify current deployment name
DeploymentTagName = "deployment"
// DestinationTag is the tag name to identify destination
DestinationTag = "destination"
DestinationTag = "destination"
// PublisherTypeTag is the tag name to identify publisher type
PublisherTypeTag = "publisherType"
// ConsumerGroupTag is the tag name to identify consumer group
ConsumerGroupTag = "consumerGroup"
// PidTag is the tag name to identify process id
PidTag = "pid"
PidTag = "pid"
// ClientTag is the tag name to identify client
ClientTag = "client"
ClientTag = "client"
// HostNameTag is the tag name to identify host name
HostNameTag = "hostName"
HostNameTag = "hostName"

// PublishMessageRate is the rate of message wrote to input
PublishMessageRate = "cherami.publish.message.rate"
Expand All @@ -71,7 +71,8 @@ const (
PublisherMessageFailed = "cherami.publisher.message.failed"
// PublisherMessageTimedout is the number of messages timed out on the publisher
PublisherMessageTimedout = "cherami.publisher.message.timedout"

// ConsumeReadFailed is the metric of consume read failures
ConsumeReadFailed = "cherami.consume.read.failed"
// ConsumeMessageRate is the rate of message got from output
ConsumeMessageRate = "cherami.consume.message.rate"
// ConsumeCreditRate is the rate of credit sent to output
Expand Down Expand Up @@ -113,6 +114,7 @@ var MetricDefs = map[MetricName]MetricType{
PublisherMessageFailed: Counter,
PublisherMessageTimedout: Counter,

ConsumeReadFailed: Counter,
ConsumeMessageRate: Counter,
ConsumeCreditRate: Counter,
ConsumeCreditFailedRate: Counter,
Expand Down

0 comments on commit ccfe5e5

Please sign in to comment.