Skip to content

Commit

Permalink
unify capitalization in metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
malteish committed Sep 11, 2024
1 parent 5909efe commit 5fa5ada
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ describe('getMetrics', () => {
);
expect(result).toHaveLength(24);
expect(result[0]).toEqual({
timestamp_start: 1680307200,
duration_seconds: 3600,
timestampStart: 1680307200,
durationSeconds: 3600,
messageCount: 10,
messageSizeBytes: 1000,
notificationCount: 5,
Expand Down Expand Up @@ -86,8 +86,8 @@ describe('getMetrics', () => {

expect(result).toHaveLength(1);
expect(result[0]).toEqual({
timestamp_start: 1680307200,
duration_seconds: 3600,
timestampStart: 1680307200,
durationSeconds: 3600,
messageCount: 10,
messageSizeBytes: 0,
notificationCount: 5,
Expand All @@ -107,11 +107,11 @@ describe('getMetrics', () => {
const result = await getMetricsFunction(mockDeliveryServiceProperties);

expect(result).toHaveLength(1);
expect(result[0].timestamp_start).toBe(currentTimestamp - 3600); // 2023-04-01T11:00:00.000Z
expect(result[0].timestampStart).toBe(currentTimestamp - 3600); // 2023-04-01T11:00:00.000Z
expect(
result.every(
(metric) =>
metric.timestamp_start !==
metric.timestampStart !==
Math.floor(mockDate.getTime() / 1000),
),
).toBe(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export function getMetrics(
);

metrics.push({
timestamp_start: timestamp,
duration_seconds:
timestampStart: timestamp,
durationSeconds:
deliveryServiceProperties.metricsCollectionIntervalInSeconds,
messageCount: parseInt(messageCount || '0', 10),
messageSizeBytes: parseInt(messageSizeBytes || '0', 10),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export type IntervalMetric = {
timestamp_start: number;
duration_seconds: number;
timestampStart: number;
durationSeconds: number;
messageCount: number;
messageSizeBytes: number;
notificationCount: number;
Expand Down

0 comments on commit 5fa5ada

Please sign in to comment.