node-universe
Version:
基于 Nodejs 环境的一款微服务框架,原理来自于宇宙中的恒星,行星,卫星等系统。
38 lines (37 loc) • 1.17 kB
TypeScript
import { GenericObject } from '../../typings';
import Tracer from './tracer';
import { LoggerInstance } from '../../typings/logger';
import { SpanLogEntry } from '../../typings/tracing';
export default class Span {
id: string;
name: string;
type: string;
options: GenericObject;
tracer: Tracer | null;
traceID: string;
parentID: string | null;
logger: LoggerInstance | null;
service: {
name?: string;
version?: string | number | null | undefined;
fullName?: string;
};
priority: number;
sampled: boolean;
startTime: number | null;
finishTime: number | null;
duration: number | null;
startTicks: number;
error: Error | boolean | null;
logs: SpanLogEntry[];
tags: GenericObject;
constructor(tracer: Tracer, name: string, options?: GenericObject);
addTags(obj: Object): this;
start(time?: number): this;
getTime(): number;
log(name: string, fields?: GenericObject, time?: number): this;
setError(err: Error): this;
finish(time?: number): this;
isActive(): boolean;
startSpan(name: string, options?: GenericObject): Span | undefined;
}