Skip to content

Commit

Permalink
0.1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
ovx committed Feb 13, 2024
1 parent e704bfa commit ec6206a
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 47 deletions.
4 changes: 2 additions & 2 deletions dist/inspector.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ export declare class Inspector {
constructor(init: InspectorInit);
activate(): void;
deactivate(): void;
createSessions(init?: SessionInit): Session;
getInstrument(instrument: keyof typeof this.instruments): TracesInstrument | ErrorsInstrument | LogsInstrument | MetricsInstrument | NetworkInstrument;
createSession(init?: SessionInit): Session;
getInstrument(instrument: keyof typeof this.instruments): ErrorsInstrument | LogsInstrument | MetricsInstrument | NetworkInstrument | TracesInstrument;
}
2 changes: 1 addition & 1 deletion dist/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class Inspector {
this.instruments[key].deactivate();
}
}
createSessions(init) {
createSession(init) {
const session = new Session(this, init);
this.sessions.add(session);
session.on('destroy', () => {
Expand Down
20 changes: 1 addition & 19 deletions dist/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// <reference types="node" />
import type { Store, MeasurementConfig } from '@exotjs/measurements/types';
export * from '@exotjs/trace/types';
export interface MeasurementsInit {
measurements: MeasurementConfig[];
}
Expand All @@ -23,29 +24,10 @@ export interface TrackResponse {
duration: number;
status: number;
}
/** @deprecated */
export interface TraceSpan {
attributes?: Record<string, any>;
end: () => Omit<TraceSpan, 'end'>;
description?: string;
duration: number;
label?: string;
name: string;
parent?: TraceSpan;
start: number;
traceId?: string;
traces?: TraceSpan[];
}
export interface ErrorObject {
message: string;
stack: string;
}
/** @deprecated */
export type TraceSpanOptions = Pick<TraceSpan, 'attributes' | 'label' | 'description' | 'traceId'> & {
name?: string;
start?: number;
parent?: TraceSpan;
};
export interface NetworkRequest {
duration: number;
error?: string;
Expand Down
2 changes: 1 addition & 1 deletion dist/types.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export {};
export * from '@exotjs/trace/types';
2 changes: 1 addition & 1 deletion example/example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function delay(msec: number) {

wss.on('connection', async (ws, req) => {
const remoteAddress = req.socket.remoteAddress;
const session = inspector.createSessions({
const session = inspector.createSession({
remoteAddress,
});
session.on('message', (data) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/inspector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class Inspector {
}
}

createSessions(init?: SessionInit) {
createSession(init?: SessionInit) {
const session = new Session(this, init);
this.sessions.add(session);
session.on('destroy', () => {
Expand Down
22 changes: 2 additions & 20 deletions lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import type { Store, MeasurementConfig } from '@exotjs/measurements/types';

export * from '@exotjs/trace/types';

export interface MeasurementsInit {
measurements: MeasurementConfig[];
}
Expand Down Expand Up @@ -28,31 +30,11 @@ export interface TrackResponse {
status: number;
}

/** @deprecated */
export interface TraceSpan {
attributes?: Record<string, any>;
end: () => Omit<TraceSpan, 'end'>;
description?: string;
duration: number;
label?: string;
name: string;
parent?: TraceSpan;
start: number;
traceId?: string;
traces?: TraceSpan[];
}

export interface ErrorObject {
message: string;
stack: string;
}

/** @deprecated */
export type TraceSpanOptions = Pick<
TraceSpan,
'attributes' | 'label' | 'description' | 'traceId'
> & { name?: string; start?: number; parent?: TraceSpan };

export interface NetworkRequest {
duration: number;
error?: string;
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@exotjs/inspector",
"version": "0.1.7",
"version": "0.1.8",
"description": "Exot application inspector",
"author": "Daniel Regeci",
"license": "MIT",
Expand Down Expand Up @@ -57,7 +57,7 @@
},
"dependencies": {
"@exotjs/measurements": "0.1.4",
"@exotjs/trace": "0.1.3"
"@exotjs/trace": "0.1.4"
},
"devDependencies": {
"@types/node": "^20.9.0",
Expand Down

0 comments on commit ec6206a

Please sign in to comment.