Skip to content
This repository has been archived by the owner on Oct 27, 2020. It is now read-only.

Commit

Permalink
commenting changes to be made
Browse files Browse the repository at this point in the history
  • Loading branch information
GRECO, FRANK committed Aug 4, 2017
1 parent de29d40 commit da9245f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions monitor/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ func New() Metrics {

// GetCtxMetric retreives a specific contextual request metric
func GetCtxMetric(ctx context.Context, key string) string {

// TODO: add read/write mutex lock

untypedValue := ctx.Value(MetricsKey)
if untypedValue == nil {
logrus.Errorf("context does not have the correct key")
Expand All @@ -64,6 +67,9 @@ func GetCtxMetric(ctx context.Context, key string) string {

// AddCtxMetric adds a specific contextual request metric
func AddCtxMetric(ctx context.Context, key string, value string) context.Context {

// TODO: add read/write mutex lock

untypedMetrics := ctx.Value(MetricsKey)
if untypedMetrics == nil {
ctx = context.WithValue(context.Background(), MetricsKey, Metrics{map[string]string{}})
Expand Down

0 comments on commit da9245f

Please sign in to comment.