Skip to content

Commit

Permalink
rewrite metrics CW to leverage dimensions and be compatible with meta…
Browse files Browse the repository at this point in the history
… infra (#999)
  • Loading branch information
jeanschmidt authored Nov 2, 2022
1 parent e32b496 commit 2299ad1
Show file tree
Hide file tree
Showing 2 changed files with 483 additions and 154 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,48 @@ describe('./metrics', () => {
m.runRepo({ owner: 'o', repo: 'r' });
m.runRepo({ owner: 'o', repo: 'r' });
m.runRepo({ owner: 'o', repo: 'r' });
m.runRepo({ owner: 'o', repo: 'r1' });
m.runRepo({ owner: 'o', repo: 'r1' });
await m.sendMetrics();

expect(mockCloudWatch.putMetricData).toBeCalledWith({
MetricData: [
{
Counts: [1],
MetricName: 'run.o.r.process',
Dimensions: [
{
Name: 'Owner',
Value: 'o',
},
{
Name: 'Repo',
Value: 'r',
},
],
MetricName: 'run.process',
Timestamp: spyDate.mock.instances[0],
Unit: 'Count',
Values: [3],
},
{
Counts: [1],
Dimensions: [
{
Name: 'Owner',
Value: 'o',
},
{
Name: 'Repo',
Value: 'r1',
},
],
MetricName: 'run.process',
Timestamp: spyDate.mock.instances[0],
Unit: 'Count',
Values: [2],
},
],
Namespace: 'environ-scaleUp',
Namespace: 'environ-scaleUp-dim',
});
});

Expand Down Expand Up @@ -107,7 +136,7 @@ describe('./metrics', () => {
Values: [1],
},
],
Namespace: 'environ-scaleUp',
Namespace: 'environ-scaleUp-dim',
});
});

Expand Down
Loading

0 comments on commit 2299ad1

Please sign in to comment.