Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update API #52

Open
wants to merge 4 commits into
base: v3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions samples/runner/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ var customPortForAkitaRTM = flag.Int("akitartm-port", 0,
this number is not given or a invalid number is given number, a random port
will be used.`)

var analyszerNameFlag = flag.String("analyzer-name", "",
var analyzerNameFlag = flag.String("analyzer-name", "",
"The name of the analyzer to use.")

var analyszerPeriodFlag = flag.Float64("analyzer-period", 0.0,
var analyzerPeriodFlag = flag.Float64("analyzer-period", 0.0000001,
"The period to dump the analyzer results.")

var visTracing = flag.Bool("trace-vis", false,
Expand Down
15 changes: 8 additions & 7 deletions samples/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func (r *Runner) buildTimingPlatform() {

b = b.WithMonitor(r.monitor)

b = r.setAnalyszer(b)
b = r.setAnalyzer(b)

if *magicMemoryCopy {
b = b.WithMagicMemoryCopy()
Expand All @@ -146,19 +146,20 @@ func (r *Runner) buildTimingPlatform() {
r.monitor.StartServer()
}

func (*Runner) setAnalyszer(
func (*Runner) setAnalyzer(
b R9NanoPlatformBuilder,
) R9NanoPlatformBuilder {
if *analyszerPeriodFlag != 0 && *analyszerNameFlag == "" {
panic("must specify -analyszer-name when using -analyszer-period")
if *analyzerPeriodFlag == 0 && *analyzerNameFlag != "" {
panic("must specify -analyzer-period when using -analyzer-name")
}

if *analyszerNameFlag != "" {
if *analyzerPeriodFlag != 0 {
b = b.WithPerfAnalyzer(
*analyszerNameFlag,
*analyszerPeriodFlag,
*analyzerNameFlag,
*analyzerPeriodFlag,
)
}

return b
}

Expand Down
14 changes: 8 additions & 6 deletions samples/runner/timingplatform.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,14 @@
}

func (b *R9NanoPlatformBuilder) setupPerformanceAnalyzer() {
if b.perfAnalysisFileName != "" {
b.perfAnalyzer = analysis.MakePerfAnalyzerBuilder().
WithPeriod(sim.VTimeInSec(b.perfAnalyzingPeriod)).
WithDBFilename(b.perfAnalysisFileName).
WithEngine(b.engine).
Build()
b.perfAnalyzer = analysis.MakePerfAnalyzerBuilder().
WithPeriod(sim.VTimeInSec(b.perfAnalyzingPeriod)).
WithDBFilename(b.perfAnalysisFileName).
WithEngine(b.engine).
Build()

if b.monitor != nil {
b.monitor.RegisterPerfAnalyzer(b.perfAnalyzer)

Check failure on line 251 in samples/runner/timingplatform.go

View workflow job for this annotation

GitHub Actions / Compile

b.monitor.RegisterPerfAnalyzer undefined (type *monitoring.Monitor has no field or method RegisterPerfAnalyzer)

Check failure on line 251 in samples/runner/timingplatform.go

View workflow job for this annotation

GitHub Actions / Compile

b.monitor.RegisterPerfAnalyzer undefined (type *monitoring.Monitor has no field or method RegisterPerfAnalyzer)
}
}

Expand Down
Loading