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

Commit 111223e

Browse files
authored
Cleanup: remove redundant types in JSDoc (#510)
1 parent 53dab13 commit 111223e

File tree

21 files changed

+102
-110
lines changed

21 files changed

+102
-110
lines changed

examples/stats/exporter/prometheus.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ lineReader.on('line', function (line) {
142142

143143
/**
144144
* Takes a line and process it.
145-
* @param {string} line The line to process
145+
* @param line The line to process
146146
*/
147147
function processLine (line) {
148148
// Currently, it just capitalizes it.
@@ -151,8 +151,8 @@ function processLine (line) {
151151

152152
/**
153153
* Converts to milliseconds.
154-
* @param {number} endNanoseconds The end time of REPL.
155-
* @param {number} startNanoseconds The start time of REPL.
154+
* @param endNanoseconds The end time of REPL.
155+
* @param startNanoseconds The start time of REPL.
156156
*/
157157
function sinceInMilliseconds (endNanoseconds, startNanoseconds) {
158158
return (endNanoseconds - startNanoseconds) / 1e6;

examples/stats/exporter/stackdriver.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ setTimeout(function () {
161161

162162
/**
163163
* Takes a line and process it.
164-
* @param {string} line The line to process
164+
* @param line The line to process
165165
*/
166166
function processLine (line) {
167167
// Currently, it just capitalizes it.
@@ -170,8 +170,8 @@ function processLine (line) {
170170

171171
/**
172172
* Converts to milliseconds.
173-
* @param {number} endNanoseconds The end time of REPL.
174-
* @param {number} startNanoseconds The start time of REPL.
173+
* @param endNanoseconds The end time of REPL.
174+
* @param startNanoseconds The start time of REPL.
175175
*/
176176
function sinceInMilliseconds (endNanoseconds, startNanoseconds) {
177177
return (endNanoseconds - startNanoseconds) / 1e6;

examples/stats/web_client_monitoring/web_client/metricsclient.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* limitations under the License.
1414
*/
1515

16-
/**
16+
/**
1717
* A Common JS module for proxying monitoring and trace calls to the server
1818
*/
1919

@@ -24,8 +24,8 @@ class WebMetrics {
2424

2525
/**
2626
* Creates a WebMetrics instance
27-
* @param {string} incrementbutton - ID of the increment button DOM element
28-
* @param {string} flushbutton - ID of the flush button DOM element
27+
* @param incrementbutton - ID of the increment button DOM element
28+
* @param flushbutton - ID of the flush button DOM element
2929
*/
3030
constructor(incrementbutton, flushbutton) {
3131
// [START web_client_monitoring_click_counter]

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function resetHrtimeFunctionCache() {
4444
/**
4545
* Gets the current timestamp with seconds and nanoseconds.
4646
*
47-
* @returns {Timestamp} The Timestamp.
47+
* @returns The Timestamp.
4848
*/
4949
export function getTimestampWithProcessHRTime(): Timestamp {
5050
const [offsetSecs, offsetNanos] = hrtime(hrtimeOrigin);
@@ -62,9 +62,8 @@ export function getTimestampWithProcessHRTime(): Timestamp {
6262
/**
6363
* Creates a new timestamp from the given milliseconds.
6464
*
65-
* @param {number} epochMilli the timestamp represented in milliseconds since
66-
* epoch.
67-
* @returns {Timestamp} new timestamp with specified fields.
65+
* @param epochMilli the timestamp represented in milliseconds since epoch.
66+
* @returns new timestamp with specified fields.
6867
*/
6968
export function timestampFromMillis(epochMilli: number): Timestamp {
7069
return {

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ import {LabelKey, LabelValue} from '../metrics/export/types';
2020
* Validates that an object reference passed as a parameter to the calling
2121
* method is not null.
2222
*
23-
* @param {T} reference An object reference.
24-
* @param {string} errorMessage The exception message to use if the check fails.
25-
* @returns {T} An object reference.
23+
* @param reference An object reference.
24+
* @param errorMessage The exception message to use if the check fails.
25+
* @returns An object reference.
2626
*/
2727
export function validateNotNull<T>(reference: T, errorMessage: string): T {
2828
if (reference === null || reference === undefined) {
@@ -34,8 +34,8 @@ export function validateNotNull<T>(reference: T, errorMessage: string): T {
3434
/**
3535
* Validates that an array passed as a parameter doesn't contain null element.
3636
*
37-
* @param {T} list The argument list to check for null.
38-
* @param {string} errorMessage The exception message to use if the check fails.
37+
* @param list The argument list to check for null.
38+
* @param errorMessage The exception message to use if the check fails.
3939
*/
4040
export function validateArrayElementsNotNull<T>(
4141
array: T[], errorMessage: string) {

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ export class StringUtils {
2222
/**
2323
* Determines whether the String contains only printable characters.
2424
*
25-
* @param {string} str The String to be validated.
26-
* @returns {boolean} Whether the String contains only printable characters.
25+
* @param str The String to be validated.
26+
* @returns Whether the String contains only printable characters.
2727
*/
2828
static isPrintableString(str: string): boolean {
2929
for (let i = 0; i < str.length; i++) {
@@ -38,8 +38,8 @@ export class StringUtils {
3838
/**
3939
* Determines whether the Character is printable.
4040
*
41-
* @param {string} ch The Character to be validated.
42-
* @returns {boolean} Whether the Character is printable.
41+
* @param ch The Character to be validated.
42+
* @returns Whether the Character is printable.
4343
*/
4444
static isPrintableChar(ch: string): boolean {
4545
return ch >= ' ' && ch <= '~';

packages/opencensus-core/src/metrics/cumulative/cumulative.ts

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,12 @@ export class Cumulative implements Meter {
3636
/**
3737
* Constructs a new Cumulative instance.
3838
*
39-
* @param {string} name The name of the metric.
40-
* @param {string} description The description of the metric.
41-
* @param {string} unit The unit of the metric.
42-
* @param {MetricDescriptorType} type The type of metric.
43-
* @param {LabelKey[]} labelKeys The list of the label keys.
44-
* @param {Map<LabelKey, LabelValue>} constantLabels The map of constant
45-
* labels for the Metric.
39+
* @param name The name of the metric.
40+
* @param description The description of the metric.
41+
* @param unit The unit of the metric.
42+
* @param type The type of metric.
43+
* @param labelKeys The list of the label keys.
44+
* @param constantLabels The map of constant labels for the Metric.
4645
*/
4746
constructor(
4847
name: string, description: string, unit: string,
@@ -65,8 +64,8 @@ export class Cumulative implements Meter {
6564
* It is recommended to keep a reference to the Point instead of always
6665
* calling this method for manual operations.
6766
*
68-
* @param {LabelValue[]} labelValues The list of the label values.
69-
* @returns {CumulativePoint} The value of single cumulative.
67+
* @param labelValues The list of the label values.
68+
* @returns The value of single cumulative.
7069
*/
7170
getOrCreateTimeSeries(labelValues: LabelValue[]): CumulativePoint {
7271
validateArrayElementsNotNull(
@@ -78,7 +77,7 @@ export class Cumulative implements Meter {
7877
* Returns a Point for a cumulative with all labels not set, or default
7978
* labels.
8079
*
81-
* @returns {CumulativePoint} The value of single cumulative.
80+
* @returns The value of single cumulative.
8281
*/
8382
getDefaultTimeSeries(): CumulativePoint {
8483
return this.registerTimeSeries(this.defaultLabelValues);
@@ -89,7 +88,7 @@ export class Cumulative implements Meter {
8988
* references to previous Point objects are invalid (not part of the
9089
* metric).
9190
*
92-
* @param {LabelValue[]} labelValues The list of label values.
91+
* @param labelValues The list of label values.
9392
*/
9493
removeTimeSeries(labelValues: LabelValue[]): void {
9594
validateNotNull(labelValues, 'labelValues');
@@ -109,8 +108,8 @@ export class Cumulative implements Meter {
109108
* labelValues is not already associated with this cumulative, else returns an
110109
* existing Point.
111110
*
112-
* @param {LabelValue[]} labelValues The list of the label values.
113-
* @returns {CumulativePoint} The value of single cumulative.
111+
* @param labelValues The list of the label values.
112+
* @returns The value of single cumulative.
114113
*/
115114
private registerTimeSeries(labelValues: LabelValue[]): CumulativePoint {
116115
const hash = hashLabelValues(labelValues);
@@ -131,8 +130,7 @@ export class Cumulative implements Meter {
131130
/**
132131
* Provides a Metric with one or more TimeSeries.
133132
*
134-
* @returns {Metric} The Metric, or null if TimeSeries is not present in
135-
* Metric.
133+
* @returns The Metric, or null if TimeSeries is not present in Metric.
136134
*/
137135
getMetric(): Metric|null {
138136
if (this.registeredPoints.size === 0) {
@@ -168,7 +166,7 @@ export class CumulativePointEntry implements CumulativePoint {
168166

169167
/**
170168
* Increment the cumulative metric.
171-
* @param {number} val The new value.
169+
* @param val The new value.
172170
*/
173171
inc(val?: number): void {
174172
if ((val && !Number.isFinite(val)) || (val !== undefined && isNaN(val))) {
@@ -184,8 +182,8 @@ export class CumulativePointEntry implements CumulativePoint {
184182
/**
185183
* Returns the TimeSeries with one or more Point.
186184
*
187-
* @param {Timestamp} now The time at which the cumulative is recorded.
188-
* @returns {TimeSeries} The TimeSeries.
185+
* @param now The time at which the cumulative is recorded.
186+
* @returns The TimeSeries.
189187
*/
190188
getTimeSeries(now: Timestamp): TimeSeries {
191189
return {

packages/opencensus-core/src/metrics/cumulative/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ export interface CumulativePoint {
2222

2323
/**
2424
* Increment the cumulative metric.
25-
* @param {number} val The new value.
25+
* @param val The new value.
2626
*/
2727
inc(val?: number): void;
2828

2929
/**
3030
* Returns the TimeSeries with one or more Point.
3131
*
32-
* @param {Timestamp} now The time at which the cumulative is recorded.
33-
* @returns {TimeSeries} The TimeSeries.
32+
* @param now The time at which the cumulative is recorded.
33+
* @returns The TimeSeries.
3434
*/
3535
getTimeSeries(now: Timestamp): TimeSeries;
3636
}

packages/opencensus-core/src/metrics/export/base-metric-producer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {Metric, MetricProducer} from './types';
2323
export abstract class BaseMetricProducer implements MetricProducer {
2424
/**
2525
* Gets a collection of produced Metric`s to be exported.
26-
* @returns {Metric[]} List of metrics
26+
* @returns The List of metrics
2727
*/
2828
abstract getMetrics(): Metric[];
2929
}

packages/opencensus-core/src/metrics/export/metric-producer-manager.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ class BaseMetricProducerManager implements MetricProducerManager {
3535
/**
3636
* Adds the MetricProducer to the manager if it is not already present.
3737
*
38-
* @param {MetricProducer} metricProducer The MetricProducer to be added to
39-
* the manager.
38+
* @param metricProducer The MetricProducer to be added to the manager.
4039
*/
4140
add(metricProducer: MetricProducer): void {
4241
validateNotNull(metricProducer, 'metricProducer');
@@ -48,8 +47,7 @@ class BaseMetricProducerManager implements MetricProducerManager {
4847
/**
4948
* Removes the MetricProducer to the manager if it is present.
5049
*
51-
* @param {MetricProducer} metricProducer The MetricProducer to be removed
52-
* from the manager.
50+
* @param metricProducer The MetricProducer to be removed from the manager.
5351
*/
5452
remove(metricProducer: MetricProducer): void {
5553
validateNotNull(metricProducer, 'metricProducer');

0 commit comments

Comments
 (0)