Skip to content

Commit

Permalink
Clean up Cache stats (#24)
Browse files Browse the repository at this point in the history
Clean up Cache stats
  • Loading branch information
chanadian authored Oct 22, 2019
2 parents d0212a7 + 20934d2 commit 372a32e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,10 @@ func (m *CatalogClient) Put(ctx context.Context, task *core.TaskTemplate, execID
if err != nil {
if status.Code(err) == codes.AlreadyExists {
logger.Warnf(ctx, "Tag %v already exists for Artifact %v (idempotent)", tagName, cachedArtifact.Id)
} else {
logger.Errorf(ctx, "Failed to add tag %+v for artifact %+v, err: %+v", tagName, cachedArtifact.Id, err)
return err
}

logger.Errorf(ctx, "Failed to add tag %+v for artifact %+v, err: %+v", tagName, cachedArtifact.Id, err)
return err
}

return nil
Expand Down
3 changes: 3 additions & 0 deletions flytepropeller/pkg/controller/nodes/task/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ func (t *taskContext) GetK8sServiceAccount() string {
type metrics struct {
pluginPanics labeled.Counter
unsupportedTaskType labeled.Counter
discoveryPutSuccessCount labeled.Counter
discoveryPutFailureCount labeled.Counter
discoveryGetFailureCount labeled.Counter
discoveryMissCount labeled.Counter
Expand Down Expand Up @@ -350,6 +351,7 @@ func (h *taskHandler) HandleNodeSuccess(ctx context.Context, w v1alpha1.Executab
h.metrics.discoveryPutFailureCount.Inc(ctx)
logger.Errorf(ctx, "Failed to write results to catalog. Err: %v", err2)
} else {
h.metrics.discoveryPutSuccessCount.Inc(ctx)
logger.Debugf(ctx, "Successfully cached results - Task [%s]", task.CoreTask().GetId())
}
}
Expand Down Expand Up @@ -432,6 +434,7 @@ func NewTaskHandlerForFactory(eventSink events.EventSink, store *storage.DataSto
discoveryHitCount: labeled.NewCounter("discovery_hit_count", "Task cached in Discovery", scope),
discoveryMissCount: labeled.NewCounter("discovery_miss_count", "Task not cached in Discovery", scope),
discoveryPutFailureCount: labeled.NewCounter("discovery_put_failure_count", "Discovery Put failure count", scope),
discoveryPutSuccessCount: labeled.NewCounter("discovery_put_success_count", "Discovery Put success count", scope),
discoveryGetFailureCount: labeled.NewCounter("discovery_get_failure_count", "Discovery Get faillure count", scope),
pluginExecutionLatency: labeled.NewStopWatch("plugin_exec_latecny", "Time taken to invoke plugin for one round", time.Microsecond, scope),
},
Expand Down

0 comments on commit 372a32e

Please sign in to comment.