Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit 9158af5

Browse files
authored
Add compilerOptions: usedLocals (#200)
1 parent 04f7649 commit 9158af5

20 files changed

Lines changed: 17 additions & 56 deletions

packages/opencensus-core/src/exporters/console-exporter.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
import * as loggerTypes from '../common/types';
18-
import {Measure, Measurement, View} from '../stats/types';
18+
import {Measurement, View} from '../stats/types';
1919
import * as modelTypes from '../trace/model/types';
2020

2121
import {ExporterBuffer} from './exporter-buffer';
@@ -34,6 +34,7 @@ export class NoopExporter implements types.Exporter {
3434
/** Format and sends span data to the console. */
3535
export class ConsoleExporter implements types.Exporter {
3636
/** Buffer object to store the spans. */
37+
// @ts-ignore
3738
private logger: loggerTypes.Logger;
3839
private buffer: ExporterBuffer;
3940

packages/opencensus-core/src/exporters/exporter-buffer.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
import * as uuidv4 from 'uuid/v4';
1817
import * as logger from '../common/console-logger';
1918
import * as loggerTypes from '../common/types';
2019
import * as configTypes from '../trace/config/types';

packages/opencensus-core/src/stats/view.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616

1717
import * as defaultLogger from '../common/console-logger';
1818
import * as loggerTypes from '../common/types';
19-
2019
import {BucketBoundaries} from './bucket-boundaries';
2120
import {Recorder} from './recorder';
22-
import {AggregationData, AggregationMetadata, AggregationType, CountData, DistributionData, LastValueData, Measure, Measurement, MeasureType, SumData, Tags, View} from './types';
21+
import {AggregationData, AggregationType, Measure, Measurement, Tags, View} from './types';
2322

2423
const RECORD_SEPARATOR = String.fromCharCode(30);
2524
const UNIT_SEPARATOR = String.fromCharCode(31);
@@ -64,6 +63,7 @@ export class BaseView implements View {
6463
/** true if the view was registered */
6564
registered = false;
6665
/** An object to log information to */
66+
// @ts-ignore
6767
private logger: loggerTypes.Logger;
6868

6969
/**

packages/opencensus-core/src/trace/instrumentation/base-plugin.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,8 @@
1515
*/
1616
import * as path from 'path';
1717
import * as semver from 'semver';
18-
19-
import {logger} from '../../common/console-logger';
2018
import {Logger} from '../../common/types';
2119
import * as modelTypes from '../model/types';
22-
2320
import * as types from './types';
2421

2522
/**

packages/opencensus-core/src/trace/model/root-span.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@
1515
*/
1616

1717
import * as uuid from 'uuid';
18-
1918
import * as logger from '../../common/console-logger';
20-
import {Clock} from '../../internal/clock';
21-
2219
import {Span} from './span';
2320
import {SpanBase} from './span-base';
2421
import * as types from './types';

packages/opencensus-core/src/trace/model/span-base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import {Logger} from '../../common/types';
1717
import {Clock} from '../../internal/clock';
1818
import {randomSpanId} from '../../internal/util';
19-
2019
import * as types from './types';
2120

2221

@@ -30,6 +29,7 @@ export abstract class SpanBase implements types.Span {
3029
/** Indicates if this span was ended */
3130
private endedLocal = false;
3231
/** Indicates if this span was forced to end */
32+
// @ts-ignore
3333
private truncated = false;
3434
/** The Span ID of this span */
3535
readonly id: string;

packages/opencensus-core/src/trace/model/tracer.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ import * as configTypes from '../config/types';
2121
import {Propagation} from '../propagation/types';
2222
import {SamplerBuilder} from '../sampler/sampler';
2323
import * as samplerTypes from '../sampler/types';
24-
2524
import {RootSpan} from './root-span';
26-
import {Span} from './span';
2725
import * as types from './types';
2826

2927

@@ -40,6 +38,7 @@ export class CoreTracer implements types.Tracer {
4038
/** A list of end span event listeners */
4139
private eventListenersLocal: types.SpanEventListener[] = [];
4240
/** A list of ended root spans */
41+
// @ts-ignore
4342
private endedTraces: types.RootSpan[] = [];
4443
/** Bit to represent whether trace is sampled or not. */
4544
private readonly IS_SAMPLED = 0x1;

packages/opencensus-core/src/trace/sampler/sampler.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
import {randomSpanId} from '../../internal/util';
1817
import {Sampler} from './types';
1918

2019
// We use 52-bits as our max number because it remains a javascript "safe

packages/opencensus-core/src/trace/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@
1515
*/
1616

1717
import * as exportersTypes from '../exporters/types';
18-
1918
import * as configTypes from './config/types';
2019
import * as modelTypes from './model/types';
21-
import * as samplerTypes from './sampler/types';
2220

2321
/** Main interface for tracing. */
2422
export interface Tracing {

packages/opencensus-core/test/test-console-exporter.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@
1515
*/
1616

1717
import * as assert from 'assert';
18-
import * as mocha from 'mocha';
19-
2018
import {ConsoleExporter, NoopExporter} from '../src/exporters/console-exporter';
21-
import {ExporterBuffer} from '../src/exporters/exporter-buffer';
2219
import {RootSpan} from '../src/trace/model/root-span';
2320
import {CoreTracer} from '../src/trace/model/tracer';
2421

@@ -57,7 +54,7 @@ describe('ConsoleLogExporter', () => {
5754
it('should end a span', () => {
5855
const intercept = require('intercept-stdout');
5956
let capturedText = '';
60-
const unhookIntercept = intercept((txt: string) => {
57+
intercept((txt: string) => {
6158
capturedText += txt;
6259
});
6360

@@ -82,7 +79,7 @@ describe('ConsoleLogExporter', () => {
8279
it('should publish the rootspans in queue', () => {
8380
const intercept = require('intercept-stdout');
8481
let capturedText = '';
85-
const unhookIntercept = intercept((txt: string) => {
82+
intercept((txt: string) => {
8683
capturedText += txt;
8784
});
8885

0 commit comments

Comments
 (0)