diff --git a/src/metrics.ts b/src/metrics.ts index 3b77320..5ff9650 100644 --- a/src/metrics.ts +++ b/src/metrics.ts @@ -1,4 +1,4 @@ -import { AsyncAPIDocumentInterface } from '@asyncapi/parser'; +import { AsyncAPIDocument } from '@smoya/multi-parser'; export enum MetricType { Counter = 'counter', @@ -7,7 +7,7 @@ export enum MetricType { export type MetricMetadata = { [key: string]: any }; -export function MetadataFromDocument(doc: AsyncAPIDocumentInterface, metadata: MetricMetadata = []): MetricMetadata { +export function MetadataFromDocument(doc: AsyncAPIDocument, metadata: MetricMetadata = []): MetricMetadata { metadata['_asyncapi_version'] = doc.version(); metadata['_asyncapi_servers'] = doc.allServers().all().length; metadata['_asyncapi_channels'] = doc.allChannels().all().length; diff --git a/test/metrics.spec.ts b/test/metrics.spec.ts index e34c869..0168e7d 100644 --- a/test/metrics.spec.ts +++ b/test/metrics.spec.ts @@ -1,4 +1,3 @@ -import exp from 'constants'; import { MetadataFromDocument } from '../src/metrics'; import { NewParser, AsyncAPIDocument } from '@smoya/multi-parser';