Skip to content

Commit

Permalink
exported bench for use in other projects (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
aricart committed Aug 27, 2020
1 parent c11177b commit 0692345
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions nats-base-client/bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { Empty, NatsConnection } from "./types.ts";
import { nuid } from "./nuid.ts";
import { deferred, Perf } from "./util.ts";
import { ErrorCode, NatsError } from "./error.ts";
import { NatsConnectionImpl } from "./nats.ts";

export class Metric {
name: string;
Expand Down Expand Up @@ -144,8 +145,8 @@ export class Bench {
}

processMetrics(): Metric[] {
//@ts-ignore
const { lang, version } = this.nc.protocol.transport;
const nc = this.nc as NatsConnectionImpl;
const { lang, version } = nc.protocol.transport;

if (this.pub && this.sub) {
this.perf.measure("pubsub", "pubStart", "subStop");
Expand Down
2 changes: 1 addition & 1 deletion nats-base-client/internal_mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,5 @@ export {
} from "./queued_iterator.ts";
export { Kind, Parser, ParserEvent, State } from "./parser.ts";
export { Buffer, MAX_SIZE, readAll, writeAll } from "./buffer.ts";
export { Bench } from "./bench.ts";
export { Bench, BenchOpts, Metric } from "./bench.ts";
export { TE, TD } from "./encoders.ts";

0 comments on commit 0692345

Please sign in to comment.