prooftime

package
v0.3.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package prooftime 累计一次请求取 WAA proof 的分项耗时

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Observe

func Observe(ctx context.Context, phase Phase, duration time.Duration)

Observe 把 duration 累计进 ctx 所带 Timing 的 phase 分项,ctx 没有 Timing 时不记录

func Skip

func Skip(ctx context.Context, steps int)

Skip 把 steps 累计进 ctx 所带 Timing 的跳过步数,ctx 没有 Timing 时不记录

func With

func With(ctx context.Context, timing *Timing) context.Context

With 返回带 timing 的 ctx,取 proof 的各层把分项耗时累计进 timing

Types

type Phase

type Phase int

Phase 是取 proof 耗时的分项

const (
	// Lock 是等待页面、VM 与界面操作锁的时间,含按需新开页面
	Lock Phase = iota
	// Interaction 是在页面上点击、粘贴、提交与页面应用发出请求的时间
	Interaction
	// Refresh 是等待 VM 到期重建完成的时间
	Refresh
	// Compute 是 VM 或页面应用生成 proof 的时间
	Compute
)

type Timing

type Timing struct {
	// contains filtered or unexported fields
}

Timing 累计一次请求各次取 proof 的分项耗时与空闲不够而没有做的界面操作步数

func (*Timing) Duration

func (timing *Timing) Duration(phase Phase) time.Duration

Duration 返回 phase 分项累计的耗时

func (*Timing) Skipped

func (timing *Timing) Skipped() int

Skipped 返回空闲不够而没有做的界面操作步数

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL