Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Segaran committed Aug 1, 2020
1 parent 664d56a commit 9bc8f2c
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions packages/apollo-engine-reporting/src/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,13 +404,6 @@ export interface AddTraceArgs {
document?: DocumentNode;
logger: Logger;
}

interface TraceCacheKey {
statsReportKey: string;
statsBucket: number;
endsAtMinute: number;
}

const serviceHeaderDefaults = {
hostname: os.hostname(),
agentVersion: `apollo-engine-reporting@${require('../package.json').version}`,
Expand Down Expand Up @@ -447,11 +440,7 @@ class StatsMap {
>();

public toArray(): IContextualizedStats[] {
const statsWithContext = new Array<IContextualizedStats>();
for (const statWithContext of this.map.values()) {
statsWithContext.push(statWithContext);
}
return statsWithContext;
return Array.from(this.map.values());
}

public addTrace(trace: Trace) {
Expand Down Expand Up @@ -681,9 +670,7 @@ export class EngineReportingAgent<TContext = any> {
if (!report.tracesPerQuery.hasOwnProperty(statsReportKey)) {
report.tracesPerQuery[statsReportKey] = new TracesAndStats();
(report.tracesPerQuery[statsReportKey] as any).encodedTraces = [];
(report.tracesPerQuery[
statsReportKey
] as any).statsWithContext = new StatsMap();
report.tracesPerQuery[statsReportKey].statsWithContext = new StatsMap();
}

const traceCacheKey = JSON.stringify({
Expand Down

0 comments on commit 9bc8f2c

Please sign in to comment.