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

Commit 26eb382

Browse files
authored
Fix docs (#457)
* Fix docs * Fix review comment -> add descriptive class comment
1 parent 469d15a commit 26eb382

File tree

56 files changed

+158
-209
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+158
-209
lines changed

packages/opencensus-core/src/common/console-logger.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export class ConsoleLogger implements types.Logger {
5252

5353
/**
5454
* Logger error function.
55-
* @param message menssage erro to log in console
55+
* @param message message error to log in console
5656
* @param args arguments to log in console
5757
*/
5858
// tslint:disable-next-line:no-any
@@ -62,7 +62,7 @@ export class ConsoleLogger implements types.Logger {
6262

6363
/**
6464
* Logger warning function.
65-
* @param message menssage warning to log in console
65+
* @param message message warning to log in console
6666
* @param args arguments to log in console
6767
*/
6868
// tslint:disable-next-line:no-any
@@ -72,7 +72,7 @@ export class ConsoleLogger implements types.Logger {
7272

7373
/**
7474
* Logger info function.
75-
* @param message menssage info to log in console
75+
* @param message message info to log in console
7676
* @param args arguments to log in console
7777
*/
7878
// tslint:disable-next-line:no-any
@@ -82,7 +82,7 @@ export class ConsoleLogger implements types.Logger {
8282

8383
/**
8484
* Logger debug function.
85-
* @param message menssage debug to log in console
85+
* @param message message debug to log in console
8686
* @param args arguments to log in console
8787
*/
8888
// tslint:disable-next-line:no-any

packages/opencensus-core/src/common/time-util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Copyright 2019, OpenCensus Authors
33
*
4-
* Licensed under the Apache License, Version 2.0 the "License";
4+
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// tslint:disable:no-any
1818
export type LogFunction = (message: any, ...args: any[]) => void;
1919

20-
/** Defines an logger interface. */
20+
/** Defines a logger interface. */
2121
export interface Logger {
2222
/** Logger verbosity level. If omitted, `debug` level is assumed. */
2323
level?: string;
@@ -28,7 +28,7 @@ export interface Logger {
2828
debug: LogFunction;
2929
}
3030

31-
/** Defines an logger options interface. */
31+
/** Defines a logger options interface. */
3232
export interface LoggerOptions {
3333
level?: string;
3434
}

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ import * as loggerTypes from '../common/types';
1818
import {Measurement, View} from '../stats/types';
1919
import {TagKey, TagValue} from '../tags/types';
2020
import * as modelTypes from '../trace/model/types';
21-
2221
import {ExporterBuffer} from './exporter-buffer';
23-
import * as types from './types';
22+
import {Exporter, ExporterConfig, StatsEventListener} from './types';
2423

2524
/** Do not send span data */
26-
export class NoopExporter implements types.Exporter {
25+
export class NoopExporter implements Exporter {
2726
logger?: loggerTypes.Logger;
2827
onStartSpan(root: modelTypes.RootSpan) {}
2928
onEndSpan(root: modelTypes.RootSpan) {}
@@ -33,7 +32,7 @@ export class NoopExporter implements types.Exporter {
3332
}
3433

3534
/** Format and sends span data to the console. */
36-
export class ConsoleExporter implements types.Exporter {
35+
export class ConsoleExporter implements Exporter {
3736
/** Buffer object to store the spans. */
3837
// @ts-ignore
3938
private logger?: loggerTypes.Logger;
@@ -42,23 +41,26 @@ export class ConsoleExporter implements types.Exporter {
4241
/**
4342
* Constructs a new ConsoleLogExporter instance.
4443
* @param config Exporter configuration object to create a console log
45-
* exporter.
44+
* exporter.
4645
*/
47-
constructor(config: types.ExporterConfig) {
46+
constructor(config: ExporterConfig) {
4847
this.buffer = new ExporterBuffer(this, config);
4948
this.logger = config.logger;
5049
}
50+
5151
onStartSpan(root: modelTypes.RootSpan) {}
52+
5253
/**
5354
* Event called when a span is ended.
5455
* @param root Ended span.
5556
*/
5657
onEndSpan(root: modelTypes.RootSpan) {
5758
this.buffer.addToBuffer(root);
5859
}
60+
5961
/**
6062
* Sends the spans information to the console.
61-
* @param rootSpans
63+
* @param rootSpans A list of root spans to publish.
6264
*/
6365
publish(rootSpans: modelTypes.RootSpan[]) {
6466
rootSpans.map((root) => {
@@ -79,7 +81,7 @@ export class ConsoleExporter implements types.Exporter {
7981
}
8082

8183
/** Exporter that receives stats data and shows in the log console. */
82-
export class ConsoleStatsExporter implements types.StatsEventListener {
84+
export class ConsoleStatsExporter implements StatsEventListener {
8385
/**
8486
* Event called when a view is registered
8587
* @param view registered view

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export class ExporterBuffer {
7373
getQueue(): modelTypes.RootSpan[] {
7474
return this.queue;
7575
}
76+
7677
/**
7778
* Add a rootSpan in the buffer.
7879
* @param root RootSpan to be added in the buffer.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export interface StatsEventListener {
3939
* @param view The registered view
4040
*/
4141
onRegisterView(view: View): void;
42+
4243
/**
4344
* Is called whenever a new measurement is recorded.
4445
* @deprecated since version 0.0.9 - use {@link start} instead

packages/opencensus-core/src/index.ts

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

17-
1817
// types
1918
export * from './trace/types';
2019
export * from './trace/model/types';
@@ -25,28 +24,7 @@ export * from './trace/propagation/types';
2524
export * from './exporters/types';
2625
export * from './common/types';
2726
export * from './metrics/gauges/types';
28-
import {Metric, MetricDescriptor, TimeSeries, MetricDescriptorType, LabelKey, LabelValue, Point as TimeSeriesPoint, DistributionValue, BucketOptions, Bucket as DistributionBucket, SummaryValue, Explicit, Exemplar, Timestamp, Snapshot, ValueAtPercentile, MetricProducerManager, MetricProducer} from './metrics/export/types';
29-
30-
export {
31-
Metric,
32-
MetricDescriptor,
33-
TimeSeries,
34-
MetricDescriptorType,
35-
LabelKey,
36-
LabelValue,
37-
TimeSeriesPoint,
38-
DistributionValue,
39-
BucketOptions,
40-
DistributionBucket,
41-
SummaryValue,
42-
Explicit,
43-
Exemplar,
44-
Timestamp,
45-
Snapshot,
46-
ValueAtPercentile,
47-
MetricProducerManager,
48-
MetricProducer
49-
};
27+
export {Metric, MetricDescriptor, TimeSeries, MetricDescriptorType, LabelKey, LabelValue, Point as TimeSeriesPoint, DistributionValue, BucketOptions, Bucket as DistributionBucket, SummaryValue, Explicit, Exemplar, Timestamp, Snapshot, ValueAtPercentile, MetricProducerManager, MetricProducer} from './metrics/export/types';
5028

5129
// classes
5230

@@ -97,7 +75,6 @@ export * from './metrics/metric-registry';
9775
export * from './metrics/gauges/derived-gauge';
9876
export * from './metrics/gauges/gauge';
9977

100-
10178
// Stats singleton instance
10279
import {BaseStats} from './stats/stats';
10380
import {Stats} from './stats/types';

packages/opencensus-core/src/internal/clock.ts

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

17-
1817
/**
1918
* The Clock class is used to record the duration and endTime for spans.
2019
*/
@@ -52,7 +51,6 @@ export class Clock {
5251
return ns / 1e6;
5352
}
5453

55-
5654
/** Starts the clock. */
5755
get startTime(): Date {
5856
return this.startTimeLocal;

packages/opencensus-core/src/internal/string-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2018 Google LLC
2+
* Copyright 2018, OpenCensus Authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@ export class StringUtils {
3838
/**
3939
* Determines whether the Character is printable.
4040
*
41-
* @param {string} str The Character to be validated.
41+
* @param {string} ch The Character to be validated.
4242
* @returns {boolean} Whether the Character is printable.
4343
*/
4444
static isPrintableChar(ch: string): boolean {

packages/opencensus-core/src/internal/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2018 Google LLC
2+
* Copyright 2018, OpenCensus Authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)