Skip to content

Commit 1cd1b89

Browse files
committed
update imports
1 parent dbc4ca4 commit 1cd1b89

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/metrics/listener.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { StatsD } from "hot-shots";
22
import { promisify } from "util";
33
import { logDebug, logError } from "../utils";
44
import { APIClient } from "./api";
5-
import { flushExtension, isAgentRunning } from "./extension";
5+
import { flushExtension, isExtensionRunning } from "./extension";
66
import { KMSService } from "./kms-service";
77
import { writeMetricToStdout } from "./metric-log";
88
import { Distribution } from "./model";
@@ -59,20 +59,20 @@ export class MetricsListener {
5959
private currentProcessor?: Promise<Processor>;
6060
private apiKey: Promise<string>;
6161
private statsDClient?: StatsD;
62-
private isAgentRunning?: boolean = undefined;
62+
private isExtensionRunning?: boolean = undefined;
6363

6464
constructor(private kmsClient: KMSService, private config: MetricsConfig) {
6565
this.apiKey = this.getAPIKey(config);
6666
this.config = config;
6767
}
6868

6969
public async onStartInvocation(_: any) {
70-
if (this.isAgentRunning === undefined) {
71-
this.isAgentRunning = await isAgentRunning();
72-
logDebug(`Extension present: ${this.isAgentRunning}`);
70+
if (this.isExtensionRunning === undefined) {
71+
this.isExtensionRunning = await isExtensionRunning();
72+
logDebug(`Extension present: ${this.isExtensionRunning}`);
7373
}
7474

75-
if (this.isAgentRunning) {
75+
if (this.isExtensionRunning) {
7676
logDebug(`Using StatsD client`);
7777

7878
this.statsDClient = new StatsD({ host: "127.0.0.1", closingFlushInterval: 1 });
@@ -121,7 +121,7 @@ export class MetricsListener {
121121
}
122122
}
123123
try {
124-
if (this.isAgentRunning && this.config.localTesting) {
124+
if (this.isExtensionRunning && this.config.localTesting) {
125125
logDebug(`Flushing Extension for local test`);
126126
await flushExtension();
127127
}
@@ -140,7 +140,7 @@ export class MetricsListener {
140140
forceAsync: boolean,
141141
...tags: string[]
142142
) {
143-
if (this.isAgentRunning) {
143+
if (this.isExtensionRunning) {
144144
this.statsDClient?.distribution(name, value, undefined, tags);
145145
return;
146146
}

0 commit comments

Comments
 (0)