constructor()Constructor to create a Metric instance.
constructor(options?: MetricOptions)| Property | Type | Description | Default Value |
|---|---|---|---|
meterName | string | Meter identifier | nocobase-meter |
version | string | Current version of NocoBase | |
readerName | string | string[] | Identifier(s) of registered MetricReader to use | - |
init()Initializes MetricProvider.
init(): voidregisterReader()Registers a MetricReader.
registerReader(name: string, reader: GetMetricReader)| Parameter | Type | Description |
|---|---|---|
name | string | Unique identifier for MetricReader |
reader | () => MetricReader | Function to get MetricReader |
addView()Adds a View. Refer to Configure Metric Views.
addView(...view: View[])getMeter()Gets the Meter.
getMeter(name?: string, version?: string)| Parameter | Type | Description | Default Value |
|---|---|---|---|
name | string | Meter identifier | nocobase-meter |
version | string | Current version of NocoBase |
start()Starts the MetricReader.
start(): voidshutdown()Stops the MetricReader.
shutdown(): Promise<void>