@itwin/ecschema-metadata
Version:
ECObjects core concepts in typescript
60 lines • 2.04 kB
TypeScript
/**
* Contains the properties needed to track load times
* for SchemaItem queries.
* @internal
*/
export interface SchemaItemLoadData {
loadTime: number;
itemCount: number;
}
/**
* Contains the properties needed to track load times
* for Schema queries.
* @internal
*/
export interface SchemaLoadData {
loadTime?: number;
schemaItemMap: Map<string, SchemaItemLoadData>;
}
/**
* Utility class used to log query load times for Schema and
* SchemaItem queries.
* @internal
*/
export declare class PerformanceLogger {
private _iModelItems;
private _label;
disableLogging: boolean;
/**
* Initializes a new PerformanceLogger instance.
* @param label Arbitrary label used to tag this logging session (ex. IModel name)
*/
constructor(label?: string);
/**
* Gets the Map of logged Schema entries. The Map key is the iModel name. The Map
* value is a second Map whose key is a Schema name and value is a SchemaLoadData
* object.
*/
get logItems(): Map<string, Map<string, SchemaLoadData>>;
/**
* Adds a new log entry to the Schema Map.
* @param startTime The start time of the entry to be logged (end time/duration is handled in this method).
* @param schemaName The Schema being queried.
*/
logSchema(startTime: number, schemaName: string): void;
/**
* Adds a new log entry to the SchemaItem Map.
* @param startTime The start time of the entry to be logged (end time/duration is handled in this method).
* @param schemaName The name of the Schema being queried.
* @param schemaItemType The SchemaItemType name of the type being queried.
* @param itemCount The number of items retrieved in the query.
*/
logSchemaItem(startTime: number, schemaName: string, schemaItemType: string, itemCount: number): void;
/**
* Clears all log entries from the Map.
*/
clearLogs(): void;
private getSchemaMap;
private getSchemaLoadData;
}
//# sourceMappingURL=PerformanceLogger.d.ts.map