Skip to content

Commit

Permalink
feat: add conn_group tag to server_processing_latency_millisecond
Browse files Browse the repository at this point in the history
  • Loading branch information
NNcrawler committed Oct 13, 2021
1 parent f1819bf commit 282b878
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/reference/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ Duration from the time request is sent to the time events are published. This me
Duration from the time request is receieved to the time events are published. This metric is calculated per event by following formula`(PublishedTime - ReceievedTime)/CountEvents`

* Type: `Timing`
* Tags: `conn_group=*`

### `worker_processing_duration_milliseconds`

Expand Down
2 changes: 1 addition & 1 deletion worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (w *Pool) StartWorkers() {
metrics.Timing("event_processing_duration_milliseconds", eventTimingMs, fmt.Sprintf("conn_group=%s", request.ConnIdentifier.Group))
now := time.Now()
metrics.Timing("worker_processing_duration_milliseconds", (now.Sub(batchReadTime).Milliseconds())/lenBatch, "worker="+workerName)
metrics.Timing("server_processing_latency_milliseconds", (now.Sub(request.TimeConsumed)).Milliseconds()/lenBatch, "")
metrics.Timing("server_processing_latency_milliseconds", (now.Sub(request.TimeConsumed)).Milliseconds()/lenBatch, fmt.Sprintf("conn_group=%s", request.ConnIdentifier.Group))
}
metrics.Count("kafka_messages_delivered_total", totalErr, fmt.Sprintf("success=false,conn_group=%s", request.ConnIdentifier.Group))
metrics.Count("kafka_messages_delivered_total", len(request.EventReq.GetEvents())-totalErr, fmt.Sprintf("success=true,conn_group=%s", request.ConnIdentifier.Group))
Expand Down

0 comments on commit 282b878

Please sign in to comment.