experimentStartupInfo.ts 1.42 KB
Newer Older
liuzhe-lz's avatar
liuzhe-lz committed
1
2
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Deshui Yu's avatar
Deshui Yu committed
3

4
import globals from 'common/globals';
5
6

export class ExperimentStartupInfo {
7
8
9
10
11
12
13
14
15
    public experimentId: string = globals.args.experimentId;
    public newExperiment: boolean = (globals.args.action === 'create');
    public basePort: number = globals.args.port;
    public logDir: string = globals.paths.experimentRoot;
    public logLevel: string = globals.args.logLevel;
    public readonly: boolean = (globals.args.action === 'view');
    public dispatcherPipe: string | null = globals.args.dispatcherPipe ?? null;
    public platform: string = globals.args.mode as string;
    public urlprefix: string = globals.args.urlPrefix;
16

17
    public static getInstance(): ExperimentStartupInfo {
18
        return new ExperimentStartupInfo();
19
    }
Deshui Yu's avatar
Deshui Yu committed
20
21
}

22
export function getExperimentStartupInfo(): ExperimentStartupInfo {
23
    return new ExperimentStartupInfo();
24
25
}

26
export function getExperimentId(): string {
27
    return globals.args.experimentId;
Deshui Yu's avatar
Deshui Yu committed
28
29
}

30
export function getBasePort(): number {
31
    return globals.args.port;
32
33
}

34
export function isNewExperiment(): boolean {
35
    return globals.args.action === 'create';
36
37
}

38
export function getPlatform(): string {
39
    return globals.args.mode as string;
SparkSnail's avatar
SparkSnail committed
40
41
}

42
export function isReadonly(): boolean {
43
    return globals.args.action === 'view';
Deshui Yu's avatar
Deshui Yu committed
44
45
}

46
export function getDispatcherPipe(): string | null {
47
    return globals.args.dispatcherPipe ?? null;
48
}