Skip to content

Commit fc9e669

Browse files
committed
log time to sync nftables
1 parent db02a26 commit fc9e669

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/dataplane/controller.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,13 @@ func (c *Controller) evaluatePacket(ctx context.Context, p *network.Packet) bool
287287
// and check if network policies must apply.
288288
// TODO: We can divert only the traffic affected by network policies using a set in nftables or an IPset.
289289
func (c *Controller) syncNFTablesRules(ctx context.Context) error {
290-
klog.FromContext(ctx).Info("Syncing nftables rules")
290+
logger := klog.FromContext(ctx)
291+
292+
logger.Info("Syncing nftables rules")
293+
start := time.Now()
294+
defer func() {
295+
logger.Info("Syncing nftables rules", "elapsed", time.Since(start))
296+
}()
291297

292298
nft, err := nftables.New()
293299
if err != nil {

0 commit comments

Comments
 (0)