logologo
开始
手册
开发
插件
API
English
简体中文
开始
手册
开发
插件
API
English
简体中文
logologo
API Overview

@nocobase/auth

AuthManager
Auth
BaseAuth

@nocobase/cache

CacheManager
Cache

@nocobase/cli

NocoBase CLI
全局环境变量

@nocobase/client

Application
Plugin

@nocobase/database

Collection
Field

interfaces

BaseInterface
Filter Operators

RelationRepository

BelongsToManyRepository
belongs-to-repository
HasManyRepository
HasOneRepository
Repository

shared

create-options
destroy-options
find-one
find-options
transaction
update-options

@nocobase/data-source-manager

DataSourceManager
DataSource (abstract)
ICollectionManager
ICollection
IField
IModel
IRepository

@nocobase/flow-engine

DataSourceManager
FlowContext
FlowEngine
FlowModel
FlowResource

@nocobase/logger

Logger

@nocobase/server

AppCommand
Application
AuditManager
Context
Migration
Plugin

@nocobase/sdk

Auth
Storage

@nocobase/telemetry

Metric
Telemetry
Trace
Previous PageStorage
Next PageTelemetry

#Metric

#类方法

#constructor()

构造函数,创建一个 Metric 实例。

#签名

  • constructor(options?: MetricOptions)

#类型

export type MetricOptions = {
  meterName?: string;
  version?: string;
  readerName?: string | string[];
};

#详细信息

属性类型描述默认值
meterNamestringmeter 标识nocobase-meter
versionstringNocoBase 当前版本号
readerNamestring | string[]想启用的已注册的 MetricReader 的标识

#init()

初始化 MetricProvider.

#签名

  • init(): void

#registerReader()

注册 MetricReader

#签名

  • registerReader(name: string, reader: GetMetricReader)

#类型

import { MetricReader } from '@opentelemetry/sdk-metrics';

type GetMetricReader = () => MetricReader;

#详细信息

参数类型描述
namestringMetricReader 唯一标识
processor() => MetricReader获取 MetricReader 的方法

#addView()

添加 View. 参考 Configure Metric Views.

#签名

  • addView(...view: View[])

#类型

import { View } from '@opentelemetry/sdk-metrics';

#getMeter()

获取 Meter.

#签名

  • getMeter(name?: string, version?: string)

#详细信息

参数类型描述默认值
namestringmeter 标识nocobase-meter
versionstringNocoBase 当前版本号

#start()

启动 MetricReader.

#签名

  • start(): void

#shutdown()

停止 MetricReader.

#签名

  • shutdown(): Promise<void>