1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2024-12-23 01:27:14 +02:00
pigallery2/benchmark/BMConfig.ts

63 lines
1.7 KiB
TypeScript
Raw Normal View History

2022-04-04 19:37:31 +02:00
/* eslint-disable @typescript-eslint/no-inferrable-types */
2020-12-28 23:08:57 +02:00
import * as path from 'path';
2022-04-04 19:37:31 +02:00
import { ConfigClass, ConfigClassBuilder } from 'typeconfig/node';
import { ConfigProperty, SubConfigClass } from 'typeconfig/common';
2023-01-06 20:01:24 +02:00
@SubConfigClass({softReadonly: true})
2022-04-04 19:37:31 +02:00
export class BenchmarksConfig {
@ConfigProperty()
bmScanDirectory: boolean = true;
@ConfigProperty()
bmSaveDirectory: boolean = true;
@ConfigProperty()
bmListDirectory: boolean = true;
@ConfigProperty()
bmListPersons: boolean = true;
@ConfigProperty()
bmAllSearch: boolean = true;
@ConfigProperty()
bmAutocomplete: boolean = true;
}
2020-12-28 23:08:57 +02:00
@ConfigClass({
configPath: path.join(__dirname, './../bm_config.json'),
saveIfNotExist: true,
attachDescription: true,
enumsAsString: true,
softReadonly: true,
cli: {
2020-12-30 22:13:19 +02:00
prefix: 'bm-config',
2020-12-28 23:08:57 +02:00
enable: {
configPath: true,
attachState: true,
attachDescription: true,
rewriteCLIConfig: true,
rewriteENVConfig: true,
enumsAsString: true,
saveIfNotExist: true,
2022-04-04 19:37:31 +02:00
exitOnConfig: true,
2020-12-28 23:08:57 +02:00
},
defaults: {
2022-04-04 19:37:31 +02:00
enabled: true,
},
},
2020-12-28 23:08:57 +02:00
})
export class PrivateConfigClass {
2022-04-04 19:37:31 +02:00
@ConfigProperty({
description:
'Images are loaded from this folder (read permission required)',
})
2020-12-31 15:26:45 +02:00
path: string = '/app/data/images';
2022-04-04 19:37:31 +02:00
@ConfigProperty({ description: 'Describe your system setup' })
2020-12-28 23:08:57 +02:00
system: string = '';
2022-04-04 19:37:31 +02:00
@ConfigProperty({ description: 'Number of times to run the benchmark' })
2020-12-30 22:13:19 +02:00
RUNS: number = 50;
2022-04-04 19:37:31 +02:00
@ConfigProperty({ description: 'Enables / disables benchmarks' })
Benchmarks: BenchmarksConfig = new BenchmarksConfig();
2020-12-28 23:08:57 +02:00
}
2022-04-04 19:37:31 +02:00
export const BMConfig = ConfigClassBuilder.attachInterface(
new PrivateConfigClass()
);
2020-12-28 23:08:57 +02:00
BMConfig.loadSync();