1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/benchmark/BMConfig.ts

43 lines
1.1 KiB
TypeScript
Raw Normal View History

2020-12-29 05:08:57 +08:00
/* tslint:disable:no-inferrable-types */
import * as path from 'path';
import {ConfigClass, ConfigClassBuilder} from 'typeconfig/node';
import {ConfigProperty} from 'typeconfig/common';
@ConfigClass({
configPath: path.join(__dirname, './../bm_config.json'),
saveIfNotExist: true,
attachDescription: true,
enumsAsString: true,
softReadonly: true,
cli: {
2020-12-31 04:13:19 +08:00
prefix: 'bm-config',
2020-12-29 05:08:57 +08:00
enable: {
configPath: true,
attachState: true,
attachDescription: true,
rewriteCLIConfig: true,
rewriteENVConfig: true,
enumsAsString: true,
saveIfNotExist: true,
exitOnConfig: true
},
defaults: {
enabled: true
}
}
})
export class PrivateConfigClass {
@ConfigProperty({description: 'Images are loaded from this folder (read permission required)'})
2020-12-31 21:26:45 +08:00
path: string = '/app/data/images';
2020-12-29 05:08:57 +08:00
@ConfigProperty({description: 'Describe your system setup'})
system: string = '';
2020-12-31 04:13:19 +08:00
@ConfigProperty({description: 'Number of times to run the benchmark'})
RUNS: number = 50;
2020-12-29 05:08:57 +08:00
}
export const BMConfig = ConfigClassBuilder.attachInterface(new PrivateConfigClass());
BMConfig.loadSync();