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

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <pingsutw@apache.org>
  • Loading branch information
pingsutw committed Mar 6, 2023
1 parent c185a89 commit 1c20b26
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions go/tasks/pluginmachinery/internal/webapi/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ func (c CorePlugin) GetProperties() core.PluginProperties {

func (c CorePlugin) Handle(ctx context.Context, tCtx core.TaskExecutionContext) (core.Transition, error) {
c.metrics.NumberOfTasks.Inc(ctx)
start := time.Now()
incomingState, err := c.unmarshalState(ctx, tCtx.PluginStateReader())
if err != nil {
return core.UnknownTransition, err
Expand Down Expand Up @@ -100,7 +99,7 @@ func (c CorePlugin) Handle(ctx context.Context, tCtx core.TaskExecutionContext)
}
c.metrics.NumberOfTasks.Dec(ctx)
logger.Infof(ctx, "number of requests [%v]", c.metrics.NumberOfTasks)
logger.Infof(ctx, "request latency [%v]", time.Since(start).Round(time.Microsecond).String())
// logger.Infof(ctx, "request latency [%v]", time.Since(start).Round(time.Microsecond).String())
logger.Infof(ctx, "phaseInfo [%v]", phaseInfo)
return core.DoTransitionType(core.TransitionTypeBarrier, phaseInfo), nil
}
Expand Down
3 changes: 3 additions & 0 deletions go/tasks/plugins/webapi/fastapi/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/flyteorg/flytestdlib/logger"
"io/ioutil"
"net/http"
"time"

"github.com/flyteorg/flytestdlib/promutils"

Expand Down Expand Up @@ -84,7 +85,9 @@ func (p Plugin) Create(ctx context.Context, taskCtx webapi.TaskExecutionContextR
return nil, nil, err
}

start := time.Now()
resp, err := p.client.Do(req)
logger.Infof(ctx, "fastapi create request latency [%v]", time.Since(start).Round(time.Microsecond).String())
if err != nil {
return nil, nil, err
}
Expand Down

0 comments on commit 1c20b26

Please sign in to comment.