internal/outcome: measure finalise time
All checks were successful
Test / Create distribution (push) Successful in 35s
Test / Sandbox (push) Successful in 2m16s
Test / Hakurei (push) Successful in 3m11s
Test / Hpkg (push) Successful in 4m8s
Test / Flake checks (push) Successful in 1m19s
Test / Sandbox (race detector) (push) Successful in 4m4s
Test / Hakurei (race detector) (push) Successful in 4m56s
All checks were successful
Test / Create distribution (push) Successful in 35s
Test / Sandbox (push) Successful in 2m16s
Test / Hakurei (push) Successful in 3m11s
Test / Hpkg (push) Successful in 4m8s
Test / Flake checks (push) Successful in 1m19s
Test / Sandbox (race detector) (push) Successful in 4m4s
Test / Hakurei (race detector) (push) Successful in 4m56s
This also increases precision of state time output. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
6931ad95c3
commit
e7161f8e61
@ -690,6 +690,7 @@ func (panicMsgContext) Value(any) any { panic("unreachable") }
|
|||||||
type panicDispatcher struct{}
|
type panicDispatcher struct{}
|
||||||
|
|
||||||
func (panicDispatcher) new(func(k syscallDispatcher, msg message.Msg)) { panic("unreachable") }
|
func (panicDispatcher) new(func(k syscallDispatcher, msg message.Msg)) { panic("unreachable") }
|
||||||
|
func (panicDispatcher) getppid() int { panic("unreachable") }
|
||||||
func (panicDispatcher) getpid() int { panic("unreachable") }
|
func (panicDispatcher) getpid() int { panic("unreachable") }
|
||||||
func (panicDispatcher) getuid() int { panic("unreachable") }
|
func (panicDispatcher) getuid() int { panic("unreachable") }
|
||||||
func (panicDispatcher) getgid() int { panic("unreachable") }
|
func (panicDispatcher) getgid() int { panic("unreachable") }
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package outcome
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"log"
|
"log"
|
||||||
|
"time"
|
||||||
|
|
||||||
"hakurei.app/hst"
|
"hakurei.app/hst"
|
||||||
"hakurei.app/message"
|
"hakurei.app/message"
|
||||||
@ -16,10 +17,13 @@ func Main(ctx context.Context, msg message.Msg, config *hst.Config) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
seal := outcome{syscallDispatcher: direct{msg}}
|
seal := outcome{syscallDispatcher: direct{msg}}
|
||||||
|
|
||||||
|
finaliseTime := time.Now()
|
||||||
if err := seal.finalise(ctx, msg, &id, config); err != nil {
|
if err := seal.finalise(ctx, msg, &id, config); err != nil {
|
||||||
printMessageError(msg.GetLogger().Fatalln, "cannot seal app:", err)
|
printMessageError(msg.GetLogger().Fatalln, "cannot seal app:", err)
|
||||||
panic("unreachable")
|
panic("unreachable")
|
||||||
}
|
}
|
||||||
|
msg.Verbosef("finalise took %.2f ms", float64(time.Since(finaliseTime).Nanoseconds())/1e6)
|
||||||
|
|
||||||
seal.main(msg)
|
seal.main(msg)
|
||||||
panic("unreachable")
|
panic("unreachable")
|
||||||
|
|||||||
@ -110,14 +110,13 @@ func (k *outcome) main(msg message.Msg) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
for {
|
for {
|
||||||
var processTimePrev time.Time
|
|
||||||
processTimePrev, processTime = processTime, time.Now()
|
|
||||||
var processStatePrev uintptr
|
var processStatePrev uintptr
|
||||||
processStatePrev, processStateCur = processStateCur, processState
|
processStatePrev, processStateCur = processStateCur, processState
|
||||||
|
|
||||||
if !processTimePrev.IsZero() && processStatePrev != processLifecycle {
|
if !processTime.IsZero() && processStatePrev != processLifecycle {
|
||||||
msg.Verbosef("state %d took %d ms", processStatePrev, processTime.Sub(processTimePrev).Milliseconds())
|
msg.Verbosef("state %d took %.2f ms", processStatePrev, float64(time.Since(processTime).Nanoseconds())/1e6)
|
||||||
}
|
}
|
||||||
|
processTime = time.Now()
|
||||||
|
|
||||||
switch processState {
|
switch processState {
|
||||||
case processStart:
|
case processStart:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user