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

Commit 77a7b4d

Browse files
committed
refactor: correct a few typos
1 parent 9b02ad4 commit 77a7b4d

7 files changed

Lines changed: 14 additions & 14 deletions

File tree

packages/opencensus-core/src/stats/model/metrics/counter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export class CounterMetric extends BaseMetric<Counter<number>> {
8484
const singleValue = {
8585
timestamp: this.getRecorder(labelKey).timestamp,
8686
value: this.getRecorder(labelKey).value,
87-
type: MetricValuesTypes.single,
87+
type: MetricValuesTypes.SINGLE,
8888
tags: JSON.parse(labelKey),
8989
labelKey
9090
};

packages/opencensus-core/src/stats/model/metrics/gauge.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export class GaugeMetric extends BaseMetric<Gauge<number>> {
107107
timestamp: this.getRecorder(labelKey).timestamp,
108108
value: this.useSumAsValue ? this.getRecorder(labelKey).sum :
109109
this.getRecorder(labelKey).value,
110-
type: MetricValuesTypes.single,
110+
type: MetricValuesTypes.SINGLE,
111111
tags: JSON.parse(labelKey),
112112
labelKey
113113
};

packages/opencensus-core/src/stats/model/metrics/histogram.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export class HdrDefaultHistogram implements Histogram {
174174
boundaries: this.boundaries,
175175
buckets: this.getBuckets(),
176176
tags: {},
177-
type: MetricValuesTypes.distribution,
177+
type: MetricValuesTypes.DISTRIBUTION,
178178
labelKey: ''
179179
};
180180
}

packages/opencensus-core/src/stats/model/metrics/types.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export interface Metric<R> {
137137
*/
138138
labelValues(labelValues: Tags|string[]): R;
139139
/**
140-
* Returns the metric record mechansim associated to the labelValue, if
140+
* Returns the metric record mechanism associated to the labelValue, if
141141
* existed
142142
*/
143143
getRecorder(labelValues?: Tags|string[]): R;
@@ -157,7 +157,7 @@ export type MetricDistributions = Distribution[];
157157

158158

159159
/**
160-
* Maps that contains all labelValues -> Mensuremnt of a Count or Gouge Metric
160+
* Maps that contains all labelValues -> Measurement of a Count or Gauge Metric
161161
*/
162162
export type MetricSingleValues = SingleValue[];
163163

@@ -166,13 +166,13 @@ export type MetricValues = MetricSingleValues|MetricDistributions;
166166

167167
/** Type of MetricValues */
168168
export const enum MetricValuesTypes {
169-
single,
170-
distribution
169+
SINGLE,
170+
DISTRIBUTION
171171
}
172172

173-
/** Config for metrics */
173+
/** Config for metrics */
174174
export interface MetricConfig {
175-
/** Metric descripor */
175+
/** Metric descriptor */
176176
descriptor: MetricDescriptor;
177177
/**
178178
* Only for gauges- if true the value returned from snapshots will be the
@@ -201,7 +201,7 @@ export type SimpleRange = {
201201
/** The bucket boundaries for a histogram. */
202202
export type HistogramBoundaries = {
203203
range: SimpleRange;
204-
/** List of numbers defining the boundaries for a histogram. */
204+
/** List of numbers defining the boundaries for a histogram. */
205205
bucketBoundaries: number[];
206206
};
207207

packages/opencensus-core/test/test-stats-histogram.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ describe('HistogramMetric', () => {
7272
assert.strictEqual(distribution.mean, 83);
7373
assert.strictEqual(distribution.sumSquaredDeviations, 654);
7474
assert.strictEqual(Object.keys(distribution.tags).length, 0);
75-
assert.strictEqual(distribution.type, MetricValuesTypes.distribution);
75+
assert.strictEqual(distribution.type, MetricValuesTypes.DISTRIBUTION);
7676
});
7777
});
7878

@@ -110,7 +110,7 @@ describe('HistogramMetric', () => {
110110
assert.strictEqual(distribution.count, 1010);
111111
assert.strictEqual(distribution.tags.method, tagsGET.method);
112112
assert.strictEqual(distribution.tags.statusCode, tagsGET.statusCode);
113-
assert.strictEqual(distribution.type, MetricValuesTypes.distribution);
113+
assert.strictEqual(distribution.type, MetricValuesTypes.DISTRIBUTION);
114114
assert.strictEqual(
115115
metric.getRecorder(distribution.labelKey),
116116
metric.getRecorder(tagsGET));

packages/opencensus-core/test/test-stats-stats.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ describe('Stats', () => {
150150
const result = method.results[i];
151151
view.recordValue(method.labelValues, value);
152152
const recordValue = view.getSnapshotValue(method.labelValues);
153-
if (recordValue.type === MetricValuesTypes.single) {
153+
if (recordValue.type === MetricValuesTypes.SINGLE) {
154154
checkSnapshotSingleValue(recordValue as SingleValue, result);
155155
}
156156
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ describe('ViewManager', function() {
128128
const result = method.results[i];
129129
view.recordValue(method.labelValues, value);
130130
const recordValue = view.getSnapshotValue(method.labelValues);
131-
if (recordValue.type === MetricValuesTypes.single) {
131+
if (recordValue.type === MetricValuesTypes.SINGLE) {
132132
checkSnapshotSingleValue(recordValue as SingleValue, result);
133133
}
134134
}

0 commit comments

Comments
 (0)